4

I'm trying out apachecxf 2.3.0 and i'm having problems using the wsdlToJava tool. No matter what, i get an WSDLToJava Error: java.lang.reflect.UndeclaredThrowableException. Tried an older version 2.1 and it works fine on the same WSDL. Are anyone else having the same problem with this version?

Donal Fellows
  • 133,037
  • 18
  • 149
  • 215
Northa
  • 41
  • 1
  • 3

1 Answers1

7

Add -frontend jaxws21 as jdk6 has 2.1 jaxb builtin while 2.3 is trying to use 2.2 jaxb(or put 2.2 jaxb into your jdk so it uses that instead of 2.1)....

      <java classname="org.apache.cxf.tools.wsdlto.WSDLToJava" fork="true" failonerror="true">
         <arg value="-impl"/>
         <arg value="-d"/>
         <arg value="${gen.src}"/>
         <arg value="-frontend"/>
         <arg value="jaxws21"/>
         <arg value="${input}/schemas/enrollment.wsdl"/>
         <classpath>
            <path refid="cxf.classpath"/>
         </classpath>
      </java>
Dean Hiller
  • 19,235
  • 25
  • 129
  • 212
  • Yep that did it for me. Hopefully this doesn't have any bad side effects? Good answer. – Nicholas DiPiazza Dec 27 '12 at 18:01
  • Hi I was having same problem as above, using CXF 2.3.0 and jdk6. I added -frontend jax21 but then I am getting error WSDLToJava Error: Could not find jaxws21 frontend within classpath Any help on this will be really helpful – sagar Jan 29 '14 at 21:40