It's actually more likely a version miss-match. Check the versions of the jaxb-xjc jar and the jaxb-impl jars. They must match exactly or you run into things like this.
Dan On Tuesday 25 May 2010 9:59:36 am Forrest Xia wrote: > Hi, > > In Geronimo, there is a module which wrap cxf tools class to execute > wsdl2java and java2ws commands, but when it call > "org.apache.cxf.tools.wsdlto.WSDLToJava", an exception throws like this: > > Exception in thread "main" java.lang.reflect.InvocationTargetException > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:3 > 9) at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp > l.java:25) at java.lang.reflect.Method.invoke(Method.java:597) > at > org.apache.geronimo.cxf.tools.JAXWSToolsCLI.invokeWSDL2Java(JAXWSToolsCLI.j > ava:145) at > org.apache.geronimo.cxf.tools.JAXWSToolsCLI.run(JAXWSToolsCLI.java:115) > at > org.apache.geronimo.cxf.tools.JAXWSToolsCLI.main(JAXWSToolsCLI.java:77) > Caused by: java.lang.NoSuchMethodError: > com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>([Ljava/lang/Class;Ljava/ > util/Collection;Ljava/util/Map;Ljava/lang/String;ZLcom/sun/xml/bind/v2/mode > l/annotation/RuntimeAnnotationReader;ZZ)V at > com.sun.tools.xjc.reader.xmlschema.bindinfo.BindInfo.getJAXBContext(BindInf > o.java:332) at > com.sun.tools.xjc.reader.internalizer.SCDBasedBindingSet.apply(SCDBasedBind > ingSet.java:231) at > com.sun.tools.xjc.ModelLoader.createXSOM(ModelLoader.java:522) at > com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.j > ava:237) at > com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.j > ava:85) at > org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding.initialize(JAX > BDataBinding.java:221) at > org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.generateTypes(WSDLToJavaCon > tainer.java:588) at > org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaConta > iner.java:239) at > org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer > .java:130) at > org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer > .java:283) at > org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:83) > at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:103) > at org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:173) > ... 7 more > > The command line used is "wsdl2java -verbose -keep -d /tmp/jaxws > /tmp/jaxws/greeter_control.wsdl". I guess this might be a classpath issue, > but I am not familiar with cxf tools, anyone can help me out of this? > thanks! > > Forrest -- Daniel Kulp [email protected] http://dankulp.com/blog
