-
Bug
-
Resolution: Done
-
Minor
-
2.6.0-fuse-01-15
-
None
-
None
-
apache-cxf-2.3.3-fuse-01-15
apache-activemq-5.5.0-fuse-00-27
spring-framework-3.0.5.RELEASE
jetty-6.1.26
Windows XP and Linux machines
Sun's JDK 1.6.0_24 and 26
A customer encountered a java.lang.NoClassDefFoundError: javax/jbi/JBIException in wsdl2java when trying to run camel-example-loan-broker using Ant. I reproduced a similar error in the Ant build for camel-example-cxf as well.
Neither of these examples list an exact version of Apache CXF version they must be run with in their README files. Thus, I chose a relatively recent but stable version apache-cxf-2.3.3-fuse-01-15. Here is the output I get when I use that version as a dependency for the Ant build:
[java] wsdl2java - Apache CXF 2.3.3-fuse-01-15 [java] [java] Exception in thread "main" java.lang.NoClassDefFoundError: javax/jbi/JBIException [java] at java.lang.Class.getDeclaredFields0(Native Method) [java] at java.lang.Class.privateGetDeclaredFields(Class.java:2291) [java] at java.lang.Class.getField0(Class.java:2618) [java] at java.lang.Class.getField(Class.java:1518) [java] at org.apache.cxf.transport.TransportFinder$4.loadBean(TransportFinder.java:251) [java] at org.apache.cxf.bus.spring.SpringBeanLocator.loadBeansOfType(SpringBeanLocator.java:71) [java] at org.apache.cxf.transport.TransportFinder.loadDefaultNamespace(TransportFinder.java:263) [java] at org.apache.cxf.transport.TransportFinder.findTransportForNamespace(TransportFinder.java:55) [java] at org.apache.cxf.transport.DestinationFactoryManagerImpl.getDestinationFactory(DestinationFactoryManagerImpl.java:119) [java] at org.apache.cxf.wsdl11.WSDLServiceBuilder.buildEndpoint(WSDLServiceBuilder.java:398) [java] at org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices(WSDLServiceBuilder.java:341) [java] at org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices(WSDLServiceBuilder.java:181) [java] at org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices(WSDLServiceBuilder.java:157) [java] at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaContainer.java:199) [java] at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:138) [java] at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:290) [java] at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:103) [java] at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:113) [java] at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:86) [java] at org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:184) [java] Caused by: java.lang.ClassNotFoundException: javax.jbi.JBIException [java] at java.net.URLClassLoader$1.run(URLClassLoader.java:202) [java] at java.security.AccessController.doPrivileged(Native Method) [java] at java.net.URLClassLoader.findClass(URLClassLoader.java:190) [java] at java.lang.ClassLoader.loadClass(ClassLoader.java:307) [java] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) [java] at java.lang.ClassLoader.loadClass(ClassLoader.java:248) [java] ... 20 more
and the build fails. When I run wsdl2java manually with the arguments given by Ant, it succeeds.
When I replace the CXF dependency with version apache-cxf-2.0.10, the error disappears. build.xml for camel-example-cxf has been last updated on March, 9 2010. It looks like the classpath requirements for wsdl2java have changed since without being reflected in that file.
Ant build files seem to be falling behind on dependency updates. One possible solution would be to generate them automatically from Maven projects during the build process.