You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by paolo10 <pa...@gmail.com> on 2008/09/15 15:07:44 UTC
Re: jaxws-maven-plugin issue
Hi ! I think i get the same error as you , it works from home but not from
the office , my pom looks like this but i get the following error ? Can you
post your pom file , so i can compare ?
Thx
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-rt</artifactId>
<version>2.1</version>
</dependency>
</dependencies>
<build>
<finalName>my-webapp</finalName>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>wsimport</goal>
</goals>
</execution>
</executions>
<configuration>
<wsdlUrls>
<wsdlUrl>http://localhost:9083/service/test?wsdl</wsdlUrl>
</wsdlUrls>
<packageName>com.example.myschema</packageName> <!-- The name of
your generated source package -->
</configuration>
<dependencies>
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-tools</artifactId>
<version>2.1.1</version>
</dependency>
<dependency>
<groupId>javax.jws</groupId>
<artifactId>jsr181-api</artifactId>
<version>1.0-MR1</version>
</dependency>
</dependencies>
</plugin>
<!-- Don't forget Java 5!! -->
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>maven-repository.dev.java.net</id>
<name>Java.net Repository for Maven 1</name>
<url>https://maven-repository.dev.java.net/repository/</url>
<layout>legacy</layout>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>maven2-repository.dev.java.net</id>
<name>Java.net Maven 2 Repository</name>
<url>http://download.java.net/maven/2/</url>
</pluginRepository>
</pluginRepositories>
</project>
Error stack ;
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Error executing: wsimport [-s,
C:\dev\my-webapp\target\jaxws\wsimport\jav
a, -d, C:\dev\my-webapp\target\classes, -p, com.example.myschema,
http://localho
st:9083/uccreditreport/service/uccreditreport?wsdl]
[INFO]
------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Error executing:
wsimpor
t [-s, C:\dev\my-webapp\target\jaxws\wsimport\java, -d,
C:\dev\my-webapp\target\
classes, -p, com.example.myschema,
http://localhost:9083/uccreditreport/service/
uccreditreport?wsdl]
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:583)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
fecycle(DefaultLifecycleExecutor.java:499)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
ltLifecycleExecutor.java:478)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
dleFailures(DefaultLifecycleExecutor.java:330)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
ts(DefaultLifecycleExecutor.java:291)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
fecycleExecutor.java:142)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error executing:
wsim
port [-s, C:\dev\my-webapp\target\jaxws\wsimport\java, -d,
C:\dev\my-webapp\targ
et\classes, -p, com.example.myschema,
http://localhost:9083/uccreditreport/servi
ce/uccreditreport?wsdl]
at
org.codehaus.mojo.jaxws.WsImportMojo.wsImport(WsImportMojo.java:283)
at
org.codehaus.mojo.jaxws.WsImportMojo.processWsdlViaUrls(WsImportMojo.
java:260)
at
org.codehaus.mojo.jaxws.WsImportMojo.execute(WsImportMojo.java:189)
at
org.codehaus.mojo.jaxws.MainWsImportMojo.execute(MainWsImportMojo.jav
a:15)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
nManager.java:451)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:558)
... 16 more
stug23 wrote:
>
> There is another more subtle problem when using the jaxws plugins that I
> just ran into. The wsimport was working fine at home, but not in my work
> environment. I tracked this problem down to an old version of
> javax.xml.ws:jaxws-api:2.1 that was being resolved from the Maven Central
> Repository. Sun released a "new" version of this same artifact with the
> same version number in their
> https://maven-repository.dev.java.net/repository. The Sun version includes
> 4 dependencies (jaxb-api, saaj-api, jsr250-api and jsr181-api) whereas the
> Maven Central version of the jaxws-api only includes the first dependency.
>
> So if you resolve first from
> https://maven-repository.dev.java.net/repository the jaxws maven plugin
> works rather nicely. However if first resolving from Maven Central repo
> numerous dependencies will be missing.
>
> I solved this problem by configuring Artifactory so that it checks the Sun
> repo before Maven Central. A better solution would be for Sun to STOP
> overloading version numbers (i.e. if Sun had released a new version of
> javax.xml.ws:jaxws-api:2.1a (or some such, different version) this whole
> problem could have been avoided.
>
>
>
>
>
> Dmitry Kudrenko wrote:
>>
>> It seems I forgot to specify the following pluginRepository at the root
>> pom.xml:
>> <pluginRepositories>
>> <pluginRepository>
>> <id>maven2-repository.dev.java.net</id>
>> <name>Java.net Maven 2 Repository</name>
>> <url>http://download.java.net/maven/2/</url>
>> </pluginRepository>
>> </pluginRepositories>
>>
>> Also I added dependence for jdk-1.5
>> <dependency>
>> <groupId>javax.jws</groupId>
>> <artifactId>jsr181-api</artifactId>
>> <version>1.0-MR1</version>
>> </dependency>
>>
>> So generation and compilation work now.
>>> I am using jaxws-maven-plugin for generation artefacts by wsdl based
>>> on the documentation provided on the following site:
>>> https://jax-ws-commons.dev.java.net/jaxws-maven-plugin/usage.html
>>>
>>> But I have not success using this manual. I have the following stack
>>> trace of the error when start "mvn -e":
>>>
>>> [INFO] Trace
>>> org.apache.maven.lifecycle.LifecycleExecutionException: Error
>>> executing: wsimport [-s, xxx/java, -d, xxx/classes, -verbose, -p,
>>> package, -Xdebug, xxx/xxx.wsdl]
>>> at
>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:583)
>>>
>>> ...
>>> Caused by: org.apache.maven.plugin.MojoExecutionException: Error
>>> executing: wsimport [-s, xxx/java, -d, xxx/classes, -verbose, -p,
>>> package, -Xdebug, xxx/xxx.wsdl]
>>> at
>>> org.codehaus.mojo.jaxws.WsImportMojo.wsImport(WsImportMojo.java:283)
>>> ...
>>>
>>> It seems WsImportMojo.java generates exception because of
>>> ClassNotFoundException:
>>> try {
>>> final ClassLoader cl =
>>> Invoker.createClassLoader(Thread.currentThread().getContextClassLoader());
>>>
>>> Class c =
>>> cl.loadClass("com.sun.tools.ws.wscompile.WsimportTool");
>>> Object tool =
>>> c.getConstructor(OutputStream.class).newInstance(System.out);
>>> String[] ar = args.toArray( new String[args.size()] );
>>> Boolean result = (Boolean)c.getMethod("run",
>>> ar.getClass()).invoke(tool, new Object[]{ar});
>>> if ( !result )
>>> {
>>> throw new MojoExecutionException( "Error executing:
>>> wsimport " + args );
>>> }
>>> } catch (Exception e) {
>>> throw new MojoExecutionException( "Error executing: wsimport "
>>> + args ); // 283 line
>>> }
>>>
>>> Because it can't load com.sum.tools.ws.wscompile.WsimportTool. This
>>> class should be found in the jaxws-tools-2.1.1.jar and it is loaded by
>>> dependencies management.
>>>
>>> Could somebody help me how to fix this problem or where to find the
>>> solution?
>>>
>>> I use Maven 2.0.9 and Java 1.5.0_15.
>>>
>>> Also during installing/configuring this plugin I met the following
>>> problems:
>>> 1. Maven found the pom of the plugin but could not find the jar:
>>> jaxws-maven-plugin-1.10.jar. I downloaded it and install manually
>>> from:
>>> http://download.java.net/maven/2/org/codehaus/mojo/jaxws-maven-plugin/1.10/
>>>
>>>
>>> 2. I didn't find the com.sun.xml.ws jaxws-rt-2.1 at the standard
>>> repositories:
>>>
>>> <dependency>
>>> <groupId>com.sun.xml.ws</groupId>
>>> <artifactId>jaxws-rt</artifactId>
>>> <version>2.1</version>
>>> </dependency>
>>>
>>> But I found 2.1EA1, also I found 2.1.1 but for group id sun-jaxws.
>>>
>>> I tried both but the MojoExecutionException occurred.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>>
>
>
--
View this message in context: http://www.nabble.com/jaxws-maven-plugin-issue-tp18567259p19492590.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: jaxws-maven-plugin issue
Posted by stug23 <pa...@gmail.com>.
The pom.xml isn't the issue -- it's the order in which remote repositories
are searched for the artifacts.
For example, javax.xml.ws:jaxws-api:2.1 is available from both Maven Central
and Sun M1 repositories.
These two artifacts are fundamentally different even though they both have
the same Maven coordinates (i.e., javax.xml.ws:jaxws-api:2.1). The Sun
artifact has 5 new classes (RespectBinding, Addressing, MTOM,
WebServiceFeatureAnnotation & W3CEndpointReferenceBuilder) with 2 old
classes (Feature & FeatureParameter) removed. And there are also 9 existing
classes that have been modified.
paolo10 wrote:
>
> Hi ! I think i get the same error as you , it works from home but not from
> the office , my pom looks like this but i get the following error ? Can
> you post your pom file , so i can compare ?
>
> Thx
>
> <dependencies>
> <dependency>
> <groupId>junit</groupId>
> <artifactId>junit</artifactId>
> <version>3.8.1</version>
> <scope>test</scope>
> </dependency>
> <dependency>
> <groupId>com.sun.xml.ws</groupId>
> <artifactId>jaxws-rt</artifactId>
> <version>2.1</version>
> </dependency>
>
> </dependencies>
> <build>
> <finalName>my-webapp</finalName>
> <plugins>
> <plugin>
> <groupId>org.codehaus.mojo</groupId>
> <artifactId>jaxws-maven-plugin</artifactId>
> <executions>
> <execution>
> <goals>
> <goal>wsimport</goal>
> </goals>
> </execution>
> </executions>
> <configuration>
> <wsdlUrls>
> <wsdlUrl>http://localhost:9083/service/test?wsdl</wsdlUrl>
> </wsdlUrls>
>
> <packageName>com.example.myschema</packageName> <!-- The name of
> your generated source package -->
> </configuration>
>
> <dependencies>
> <dependency>
> <groupId>com.sun.xml.ws</groupId>
> <artifactId>jaxws-tools</artifactId>
> <version>2.1.1</version>
> </dependency>
> <dependency>
> <groupId>javax.jws</groupId>
> <artifactId>jsr181-api</artifactId>
> <version>1.0-MR1</version>
> </dependency>
> </dependencies>
> </plugin>
> <!-- Don't forget Java 5!! -->
> <plugin>
> <artifactId>maven-compiler-plugin</artifactId>
> <configuration>
> <source>1.5</source>
> <target>1.5</target>
> </configuration>
> </plugin>
> </plugins>
> </build>
> <repositories>
> <repository>
> <id>maven-repository.dev.java.net</id>
> <name>Java.net Repository for Maven 1</name>
> <url>https://maven-repository.dev.java.net/repository/</url>
> <layout>legacy</layout>
> </repository>
> </repositories>
> <pluginRepositories>
> <pluginRepository>
> <id>maven2-repository.dev.java.net</id>
> <name>Java.net Maven 2 Repository</name>
> <url>http://download.java.net/maven/2/</url>
> </pluginRepository>
> </pluginRepositories>
> </project>
>
>
> Error stack ;
>
>
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Error executing: wsimport [-s,
> C:\dev\my-webapp\target\jaxws\wsimport\jav
> a, -d, C:\dev\my-webapp\target\classes, -p, com.example.myschema,
> http://localho
> st:9083/uccreditreport/service/uccreditreport?wsdl]
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Trace
> org.apache.maven.lifecycle.LifecycleExecutionException: Error executing:
> wsimpor
> t [-s, C:\dev\my-webapp\target\jaxws\wsimport\java, -d,
> C:\dev\my-webapp\target\
> classes, -p, com.example.myschema,
> http://localhost:9083/uccreditreport/service/
> uccreditreport?wsdl]
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
> ultLifecycleExecutor.java:583)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
> fecycle(DefaultLifecycleExecutor.java:499)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
> ltLifecycleExecutor.java:478)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
> dleFailures(DefaultLifecycleExecutor.java:330)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
> ts(DefaultLifecycleExecutor.java:291)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
> fecycleExecutor.java:142)
> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
> at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at
> org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
> at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
> at
> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>
> at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> Caused by: org.apache.maven.plugin.MojoExecutionException: Error
> executing: wsim
> port [-s, C:\dev\my-webapp\target\jaxws\wsimport\java, -d,
> C:\dev\my-webapp\targ
> et\classes, -p, com.example.myschema,
> http://localhost:9083/uccreditreport/servi
> ce/uccreditreport?wsdl]
> at
> org.codehaus.mojo.jaxws.WsImportMojo.wsImport(WsImportMojo.java:283)
> at
> org.codehaus.mojo.jaxws.WsImportMojo.processWsdlViaUrls(WsImportMojo.
> java:260)
> at
> org.codehaus.mojo.jaxws.WsImportMojo.execute(WsImportMojo.java:189)
> at
> org.codehaus.mojo.jaxws.MainWsImportMojo.execute(MainWsImportMojo.jav
> a:15)
> at
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
> nManager.java:451)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
> ultLifecycleExecutor.java:558)
> ... 16 more
>
>
>
>
> stug23 wrote:
>>
>> There is another more subtle problem when using the jaxws plugins that I
>> just ran into. The wsimport was working fine at home, but not in my work
>> environment. I tracked this problem down to an old version of
>> javax.xml.ws:jaxws-api:2.1 that was being resolved from the Maven Central
>> Repository. Sun released a "new" version of this same artifact with the
>> same version number in their
>> https://maven-repository.dev.java.net/repository. The Sun version
>> includes 4 dependencies (jaxb-api, saaj-api, jsr250-api and jsr181-api)
>> whereas the Maven Central version of the jaxws-api only includes the
>> first dependency.
>>
>> So if you resolve first from
>> https://maven-repository.dev.java.net/repository the jaxws maven plugin
>> works rather nicely. However if first resolving from Maven Central repo
>> numerous dependencies will be missing.
>>
>> I solved this problem by configuring Artifactory so that it checks the
>> Sun repo before Maven Central. A better solution would be for Sun to STOP
>> overloading version numbers (i.e. if Sun had released a new version of
>> javax.xml.ws:jaxws-api:2.1a (or some such, different version) this whole
>> problem could have been avoided.
>>
>>
>>
>>
>>
>> Dmitry Kudrenko wrote:
>>>
>>> It seems I forgot to specify the following pluginRepository at the root
>>> pom.xml:
>>> <pluginRepositories>
>>> <pluginRepository>
>>> <id>maven2-repository.dev.java.net</id>
>>> <name>Java.net Maven 2 Repository</name>
>>> <url>http://download.java.net/maven/2/</url>
>>> </pluginRepository>
>>> </pluginRepositories>
>>>
>>> Also I added dependence for jdk-1.5
>>> <dependency>
>>> <groupId>javax.jws</groupId>
>>> <artifactId>jsr181-api</artifactId>
>>> <version>1.0-MR1</version>
>>> </dependency>
>>>
>>> So generation and compilation work now.
>>>> I am using jaxws-maven-plugin for generation artefacts by wsdl based
>>>> on the documentation provided on the following site:
>>>> https://jax-ws-commons.dev.java.net/jaxws-maven-plugin/usage.html
>>>>
>>>> But I have not success using this manual. I have the following stack
>>>> trace of the error when start "mvn -e":
>>>>
>>>> [INFO] Trace
>>>> org.apache.maven.lifecycle.LifecycleExecutionException: Error
>>>> executing: wsimport [-s, xxx/java, -d, xxx/classes, -verbose, -p,
>>>> package, -Xdebug, xxx/xxx.wsdl]
>>>> at
>>>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:583)
>>>>
>>>> ...
>>>> Caused by: org.apache.maven.plugin.MojoExecutionException: Error
>>>> executing: wsimport [-s, xxx/java, -d, xxx/classes, -verbose, -p,
>>>> package, -Xdebug, xxx/xxx.wsdl]
>>>> at
>>>> org.codehaus.mojo.jaxws.WsImportMojo.wsImport(WsImportMojo.java:283)
>>>> ...
>>>>
>>>> It seems WsImportMojo.java generates exception because of
>>>> ClassNotFoundException:
>>>> try {
>>>> final ClassLoader cl =
>>>> Invoker.createClassLoader(Thread.currentThread().getContextClassLoader());
>>>>
>>>> Class c =
>>>> cl.loadClass("com.sun.tools.ws.wscompile.WsimportTool");
>>>> Object tool =
>>>> c.getConstructor(OutputStream.class).newInstance(System.out);
>>>> String[] ar = args.toArray( new String[args.size()] );
>>>> Boolean result = (Boolean)c.getMethod("run",
>>>> ar.getClass()).invoke(tool, new Object[]{ar});
>>>> if ( !result )
>>>> {
>>>> throw new MojoExecutionException( "Error executing:
>>>> wsimport " + args );
>>>> }
>>>> } catch (Exception e) {
>>>> throw new MojoExecutionException( "Error executing: wsimport "
>>>> + args ); // 283 line
>>>> }
>>>>
>>>> Because it can't load com.sum.tools.ws.wscompile.WsimportTool. This
>>>> class should be found in the jaxws-tools-2.1.1.jar and it is loaded by
>>>> dependencies management.
>>>>
>>>> Could somebody help me how to fix this problem or where to find the
>>>> solution?
>>>>
>>>> I use Maven 2.0.9 and Java 1.5.0_15.
>>>>
>>>> Also during installing/configuring this plugin I met the following
>>>> problems:
>>>> 1. Maven found the pom of the plugin but could not find the jar:
>>>> jaxws-maven-plugin-1.10.jar. I downloaded it and install manually
>>>> from:
>>>> http://download.java.net/maven/2/org/codehaus/mojo/jaxws-maven-plugin/1.10/
>>>>
>>>>
>>>> 2. I didn't find the com.sun.xml.ws jaxws-rt-2.1 at the standard
>>>> repositories:
>>>>
>>>> <dependency>
>>>> <groupId>com.sun.xml.ws</groupId>
>>>> <artifactId>jaxws-rt</artifactId>
>>>> <version>2.1</version>
>>>> </dependency>
>>>>
>>>> But I found 2.1EA1, also I found 2.1.1 but for group id sun-jaxws.
>>>>
>>>> I tried both but the MojoExecutionException occurred.
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>
>>>
>>
>>
>
>
--
View this message in context: http://www.nabble.com/jaxws-maven-plugin-issue-tp18567259p19505059.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org