Closed glassfishrobot closed 13 years ago
Reported by najmi@java.net
jessecrossley@java.net said: I succeeded in getting jaxws-maven-plugin 1.12 to correctly handle xjcArgs intended for XJC extension plugins (specifically equals, toString, hashCode, and inject-prop-listeners). The trick is to specify the complete classpath required by the plugin(s). For inject-prop-listeners, this was simple: we only need proplistinjector-0.3 and coll-prop-0.1.1. However, there were a great deal more needed by the jaxb2-basics plugins.
These are the xjcArgs used to successfully integrate xjc plugins with jaxws-maven-plugin:
Please note the proplistinjector-0.3-SNAPSHOT is a separate debugging effort; use the 0.3 until a new version is available.
shibug@java.net said: Adding to cc list
@lukasj said: Ideally sth like following snippet should work (and still works on JDK 5) but apparently it doesn't work on JDK 6 & 7. Will investigate more after updating plugin to jax-ws 2.2.x
<plugin>
<groupId>org.jvnet.jax-ws-commons</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>some-version</version>
<dependencies>
<dependency>
<groupId>org.jvnet.jaxb2_commons</groupId>
<artifactId>jaxb2-basics</artifactId>
<version>0.6.3</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>id1</id>
<goals>
<goal>wsimport</goal>
</goals>
<configuration>
<xjcArgs>
<xjcArg>-Xequals</xjcArg>
<xjcArg>-XtoString</xjcArg>
</xjcArgs>
</configuration>
</execution>
</executions>
</plugin>
@lukasj said: The problem is: java.util.ServiceConfigurationError: com.sun.tools.xjc.Plugin: Provider org.jvnet.jaxb2_commons.plugin.jaxbindex.JaxbIndexPlugin could not be instantiated: java.lang.ClassCastException: Cannot cast org.jvnet.jaxb2_commons.plugin.jaxbindex.JaxbIndexPlugin to com.sun.tools.xjc.Plugin at java.util.ServiceLoader.fail(ServiceLoader.java:224) ...
The cause of this is that there are currently too many classloaders being created before wsimport is called by WsImportMojo.
Fix is to instead of doing:
1) create and set up classloaders 2) ask jax-ws, particularly Invoker class, to create and set up classloaders 3) call wsimport using reflection
call directly WsImport using API (omit step 2 and change step 3). After this, it should be enough to just declare a dependency on a jaxb2 plugin and it will work.
shibug said: I applied the patch to jaxws-maven-plugin-2.1 and it worked fine but I still need to place jaxb-api-2.2.5 jar in endorsed folder of jdk 6u26. Although I don't require jaxb-api-2.2.5 jar at runtime.
I wish I could use it with default jdk 6u26.
@lukasj said: can you try this with jaxws-maven-plugin-2.2-SNAPSHOT instead, please? Thanks!
to use JAX-WS from some particular JDK, just setup plugin dependencies as described at plugin's usage page (or for the 2.2 plugin version, see http://java.net/projects/jax-ws-commons/sources/svn/content/trunk/jaxws-maven-plugin/src/site/apt/usage.apt?rev=949 )
shibug said: I tried with jaxws-maven-plugin-2.2-SNAPSHOT but it still doesn't work unless I keep jaxb-api-2.2.5 jar under endorsed folder in jdk 6u26. This is the error I get
[ERROR] Failed to execute goal org.jvnet.jax-ws-commons:jaxws-maven-plugin:2.2-SNAPSHOT:wsimport (default) on project account-ejb: Error executing: wsimport [-s, C:\Workspaces\indigo\account\ejb\target\generated-sources\jaxws\wsimport, -d, C:\Workspaces\indigo\account\ejb\target\classes, -httpproxy:199.68.81.27:8080, -wsdllocation, META-INF/WSDL/Account-SoapHttp.wsdl, -Xnocompile, -B-extension, -B-Xcommons-lang, -B-Xfluent-api, -B-Xvalue-constructor, -B-Xdefault-value, -b, C:\Workspaces\indigo\account\ejb\src\main\resources\META-INF\jaxws\bindings.xml, C:\Workspaces\indigo\account\ejb\src\main\resources\META-INF\wsdl\Account-SoapHttp.wsdl]: UndeclaredThrowableException: javax.xml.bind.annotation.XmlElementRef.required() -> [Help 1]
Here are my pom declarations:
@lukasj said: closing old and already fixed issues
File: jax_ws_commons-45-46-tests.diff.txt Attached By: @lukasj
File: jax_ws_commons-45-46.diff.txt Attached By: @lukasj
Issue-Links: depends on JAX_WS_COMMONS-52 is related to JAX_WS_COMMONS-45
This issue was imported from java.net JIRA JAX_WS_COMMONS-46
Marked as fixed on Thursday, November 3rd 2011, 10:03:41 am
I am upgrading from jaxws-maven-plugin from version 1.9 to latest 1.12 and discovered that since version 1.10 it does not handle any XJC args that are really intended to be processed by XJC extension plugins like Equlas, Copy plugins etc.
This causes following in plugin configuration to cause the plugin to fail...
To further compound thhe problem the failure does not say why it failed and instead I had to run a standalone wsimport with same options as the plugin to find out the root problem.
I tested with changing my pom to only change the jaxws-maven-plugin version and found that 1.9 works while 1.10-1.12 do not.
Environment
Operating System: All Platform: All
Affected Versions
[current]