JBoss 3.2.2 and the Java Web Services Developer Pack

While attempting to deploy an EJB jar on a fresh installation of JBoss 3.2.2 I received the following error: (Sorry about the long lines.)

java.lang.NoSuchMethodError: org.apache.bcel.generic.InstructionFactory.createNewArray(Lorg/apache/bcel/generic/Type;S)Lorg/apache/bcel/generic/Instruction;

Looked like a version mismatch to me, which would be wierd because JBoss should be using the version of Apache BCEL that shipped with it, no? But what if we have a traitor among us?

I quickly remembered all the cruft that the Java Web Services Developer Pack wanted me to install in the JRE’s endorsed directory, might something there be the culprit?

Indeed, it seems that xsltc.jar contains a version of BCEL. (A rant for another day: even if it makes people do more deployement work, please do not include dependancies in your jars.) I believe that some versions of the Xalan jar also include BCEL, so beware.

Solution: I hope this doesn’t have any side-effects, but you can solve the immediate problem by copying the version of BCEL that ships with JBoss 3.2.2 into your endorsed directory. The BCEL jar is probably located at $JAVA_HOME/server/default/lib/bcel.jar and you want to put it in $JAVA_HOME/jre/lib/endorsed.

How little things can become time-sinks.

Comments are closed.