1

I'm using clientgen to generate client-side classes from third party WSDLs. Then I'm using wsgen to create my web service, bundling up my classes, as well as the generated ones.

The jaxws-maven-plugin wsgen throws JAXBContext IllegalAnnotationsException complaining that the generated classes do not have a no-arg default constructor.

One solution that I saw on this site was to wrap the classes in XMLWrappers. Problem is the third-party classes are used in the third-party methods that I don't have control over.

Is there a solution or workaround for this?

moribvndvs
  • 42,191
  • 11
  • 135
  • 149
Shahriar
  • 303
  • 4
  • 12

1 Answers1

0

A possible workaround is to use the axis2 maven wsdl2code generators.

This will however generate a totally different client(still easy to use though).

The doc tells to add the following dependency as well:

<dependency>
      <groupId>org.apache.axis2</groupId>
      <artifactId>axis2</artifactId>
      <version>1.4</version>
</dependency>
Udo Held
  • 12,314
  • 11
  • 67
  • 93
  • Thank you. I did try that. I included these dependencies: org.apache.axis2: axis2 org.apache.xmlbeans: xmlbeans-xpath net.sf.saxon: saxon8-dom saxon: saxon 8.5.1 Now I'm getting an error .NoClassDefFoundError: net/sf/saxon/om/Name net/sf/saxon/om/Name – Shahriar Jun 15 '12 at 22:25
  • I added the dependency mentioned in the doc, I cannot remember adding any further libs. However I don't have a repo here. You can search for "saxon" and add it as well. It should be included in saxon 8.5.1 though http://www.jarfinder.com/index.php/java/info/net.sf.saxon.om.Name. – Udo Held Jun 15 '12 at 22:35
  • Thanks again. But ran into the same problem in the end. The generated classes don't have a no-arg constructor. – Shahriar Jun 18 '12 at 14:49
  • Finally resolved it by using jaxws-maven-plugin, wsimport to generate the 3rd party classes from their wsdls. – Shahriar Jun 19 '12 at 15:50