Hibernate OGM / JAX-RS / JAX-WS redeployment issue on WildFly8.2: java.lang.NoSuchMethodException: org.objectweb.asm.MethodWriter.visitLabel

I’ve been struggling with failing redeploys on WildFly8.2 while I’m developing my app. If the app is deployed, on first server start it starts up fine, but then if I redeploy some code changes I get this NoSuchMethodException in the asm library, suggesting I’ve got some conflict of versions of the asm library used by my app:

Caused by: java.lang.NoSuchMethodException: org.objectweb.asm.MethodWriter.visitLabel(org.objectweb.asm.Label)
 at java.lang.Class.getMethod(Class.java:1773) [rt.jar:1.8.0_20]
 at org.apache.cxf.common.util.ReflectionInvokationHandler.invoke(ReflectionInvokationHandler.java:85)
 ... 28 more

Luckily I came across this post with the same error, putting me on the right direction about the possibility of my app being packaged with a conflicting version of asm. Looking at a ‘mvn dependency:tree’ on my app, I could see asm being pulled in from my use of Hibernate OGM and Jersey as transitive dependencies.

Despite trying to add excludes to not get asm included in the packaging of my app, I eventually gave up and decided to just remove my luckily minimal use of Hibernate OGM. I think the issue was caused my OGM’s deployment of modules onto the WildFly server, one of which was asm. After I had removed OGM from my app, removed the modules, I was back to speedy redeploys of my app.

I’m sure there’s a way to get OGM to deploy happily, or maybe I had just ran across an asm version conflict with other libraries my app is using (Jersey?), but I don’t have time right now to deal with it. Another project for another day 🙂

Forge app error “No mime type could be found for file favicon.ico”

Apps generated using JBoss Forge get this error showing up in the server log:

JSF1091: No mime type could be found for file favicon.ico.  To resolve this, add a mime-type mapping to the applications web.xml

This is described in this bug: https://issues.jboss.org/browse/FORGE-657

The quick fix is to add this to your web.xml:

<mime-mapping>
   <extension>ico</extension>
   <mime-type>image/x-icon</mime-type>
</mime-mapping>

EE6 @Schedule Timer Service on JBoss AS 7.1

It seems that @Schedule methods won’t execute on JBoss AS7.1 unless you specify at least both the hours and minutes values on the scheduled method.

For example, to execute a method every 30 seconds:

@Schedule(seconds="*/30")
public void doSomething() { ...}

Doesn’t execute, but if you include hours and minutes wildcards too then it does:

@Schedule(hour="*", minute-="*", second="*/30")
public void doSomething() { ...}