You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Pavel Khodchenkov <pa...@kit-digital.com> on 2012/08/20 12:33:09 UTC

cxf-java2ws-plugin wsdl generation on java 7

Hi folks,
When I use jdk 7 I have the following warning in jaxws-maven-plugin when importing the wsdl generated by cxf-java2ws-plugin 2.6.0:
[WARNING] src-resolve: Cannot resolve the name 'ns1:multiItemEntitlementDTO' to a(n) 'element declaration' component.
  line 163 of file:/E:/IdeaProjects/transaction-service/web/target/generated/wsdl/TransactionService.wsdl#types?schema1

[WARNING] src-resolve: Cannot resolve the name 'ns1:multiItemEntitlementDTO' to a(n) 'element declaration' component.
  line 163 of file:/E:/IdeaProjects/transaction-service/web/target/generated/wsdl/TransactionService.wsdl#types?schema1



And the stub generated this wsdl does not work very well: server fails with namespace mismatch.

There is no such issues when I use jdk 6.

I have attached both wsdls generated by jdk 6 and jdk 7.

Does somebody have any ideas?

RE: cxf-java2ws-plugin wsdl generation on java 7

Posted by Pavel Khodchenkov <pa...@kit-digital.com>.
P.S Again I would like pay your attention at XmlRootElement at MultiEntitelementDTO. Once XmlRootElement is removed the warnings disappears.

From: Pavel Khodchenkov
Sent: Friday, August 24, 2012 3:01 PM
To: 'Daniel Kulp'; users@cxf.apache.org
Subject: RE: cxf-java2ws-plugin wsdl generation on java 7

Hi,

I have still have this warning (JDK6+Maven3):


[WARNING] src-resolve: Cannot resolve the name 'ns1:multiItemEntitlementDTO' to a(n) 'type definition' component.
  line 35 of file:/E:/IdeaProjects/1/test-cxf-java2wsdl/target/generated-sources/wsdl/AmazingService.wsdl#types?schema2

[WARNING] src-resolve: Cannot resolve the name 'ns1:multiItemEntitlementDTO' to a(n) 'type definition' component.
  line 35 of file:/E:/IdeaProjects/1/test-cxf-java2wsdl/target/generated-sources/wsdl/AmazingService.wsdl#types?schema2

From: Daniel Kulp [mailto:dkulp@apache.org]<mailto:[mailto:dkulp@apache.org]>
Sent: Friday, August 24, 2012 2:17 PM
To: users@cxf.apache.org<ma...@cxf.apache.org>; Pavel Khodchenkov
Subject: Re: cxf-java2ws-plugin wsdl generation on java 7



I've attached the pom I used.

Dan



On Aug 24, 2012, at 5:23 AM, Pavel Khodchenkov <pa...@kit-digital.com>> wrote:

> Hi,
> If you change the CXF plugin to generate the WSDL into ${project.build.directory}/generated-sources/wsdl, then you get the EXACT same wsdl as if you generate elsewhere, but you no longer get the warning from the JAX-WS plugin.
> ----------------------------------
>
> I have tried to apply proposed solution, but still have warnings (suppose I am doing smth wrong :) ).
> Can you please send me the modified maven project where the wsdl generated by CXF is accepted by Metro without warning?
>
> -----Original Message-----
> From: Daniel Kulp [mailto:dkulp@apache.org]
> Sent: Thursday, August 23, 2012 9:08 PM
> To: users@cxf.apache.org<ma...@cxf.apache.org>
> Subject: Re: cxf-java2ws-plugin wsdl generation on java 7
>
>
> I honestly think you've hit a bug in the jaxws-maven-plugin and not CXF.
>
> If you change the CXF plugin to generate the WSDL into ${project.build.directory}/generated-sources/wsdl, then you get the EXACT same wsdl as if you generate elsewhere, but you no longer get the warning from the JAX-WS plugin.
>
> Also, if you add:
>                <resourceDestDir>${project.build.directory}/generated/wsdl</resourceDestDir>
>                 <inlineSchemas>true</inlineSchemas>
> to the METRO profiles call to wsgen and run "mvn  clean install -PMETRO" and then "mvn install -PMETRO", you get the same error.
>
>
>
> Basically, it looks like the wsimport thing needs to have the "generated" directory on the class path somehow.    If you add:
>
>    <build>
>         <resources>
>              <resource>
>                    <directory>${project.build.directory}/generated</directory>
>              </resource>
>         </resources>
>    </build>
>
> to the pom to make sure the generated directory is on the class path, then it also runs without the error.
>
>
> Dan
>
>
>
> On Aug 22, 2012, at 8:25 AM, Pavel Khodchenkov <pa...@kit-digital.com>> wrote:
>
>> Hi there,
>> I have tried Metro and it was able to generate the wsdl without this warning. The problem is in having the XmlRootElement annotation in one of the entities when this entity is placed inside a list :D . I have extracted the most simple reproducible use case (please see maven 3 project attached) which produce such warning. However , this warning in this sample project is generated also on JDK 6 when using CXF java2wsdl (Metro works fine). Once XmlRootElement annotation is removed from MultiItemEntitlementDTO then CXF also generates a valid wsdl. Please take a look.
>>
>> P.S Some of my services were exposed as SOAP as REST at the same time, so XmlRootElement annotation was required on entity classes , otherwise rest invocation fails with 'No message body writer has been found for class' and  <response> element in wadl will not have type declaration.
>> -----Original Message-----
>> From: Glen Mazza [mailto:gmazza@talend.com]
>> Sent: Tuesday, August 21, 2012 10:02 PM
>> To: users@cxf.apache.org<ma...@cxf.apache.org>
>> Subject: Re: cxf-java2ws-plugin wsdl generation on java 7
>>
>> It might be good to post a *minimal* Java class that reproduces the same error; basically rip out as much as you can from the SEI to give the simplest class that provides the same error.  Checking to see what Metro does (same error? no error?) might also be informative:
>> http://www.jroller.com/gmazza/entry/java_first_web_service.
>>
>> Offhand, I know the default JAXB is different between Java 6 and 7
>> (JAXB
>> 2.1 vs. JAXB 2.2), so that could be the issue.
>>
>> Glen
>>
>> On 08/20/2012 06:33 AM, Pavel Khodchenkov wrote:
>>>
>>> Hi folks,
>>>
>>> When I use jdk 7 I have the following warning in jaxws-maven-plugin
>>> when importing the wsdl generated by cxf-java2ws-plugin 2.6.0:
>>>
>>> [WARNING] src-resolve: Cannot resolve the name
>>> 'ns1:multiItemEntitlementDTO' to a(n) 'element declaration' component.
>>>
>>> line 163 of
>>> file:/E:/IdeaProjects/transaction-service/web/target/generated/wsdl/T
>>> r
>>> ansactionService.wsdl#types?schema1
>>>
>>> [WARNING] src-resolve: Cannot resolve the name
>>> 'ns1:multiItemEntitlementDTO' to a(n) 'element declaration' component.
>>>
>>> line 163 of
>>> file:/E:/IdeaProjects/transaction-service/web/target/generated/wsdl/T
>>> r
>>> ansactionService.wsdl#types?schema1
>>>
>>> And the stub generated this wsdl does not work very well: server
>>> fails with namespace mismatch.
>>>
>>> There is no such issues when I use jdk 6.
>>>
>>> I have attached both wsdls generated by jdk 6 and jdk 7.
>>>
>>> Does somebody have any ideas?
>>>
>>
>> <test-cxf-java2wsdl.zip>
>
> --
> Daniel Kulp
> dkulp@apache.org<ma...@apache.org> - http://dankulp.com/blog Talend Community Coder - http://coders.talend.com
>

--
Daniel Kulp
dkulp@apache.org<ma...@apache.org> - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com

RE: cxf-java2ws-plugin wsdl generation on java 7

Posted by Pavel Khodchenkov <pa...@kit-digital.com>.
Interesting :) Ihave just tried the same on linux and the same warning is produced(see the log below). Anyway I solved my problem by removing all XmlRootElement annotations, so let's consider this problem as resolved. Thanks for your help!

paul@pj-workstation ~/_trash/test-cxf-java2wsdl $ mvn clean install
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building test-cxf-java2wsdl 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ test-cxf-java2wsdl ---
[INFO] 
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ test-cxf-java2wsdl ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/paul/_trash/test-cxf-java2wsdl/target/generated-sources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ test-cxf-java2wsdl ---
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 4 source files to /home/paul/_trash/test-cxf-java2wsdl/target/classes
[INFO] 
[INFO] --- cxf-java2ws-plugin:2.6.0:java2ws (generate-amazing-service-wsdl) @ test-cxf-java2wsdl ---
java2ws -cp /home/paul/_trash/test-cxf-java2wsdl/target/classes:/home/paul/_trash/test-cxf-java2wsdl/target/classes:: -o /home/paul/_trash/test-cxf-java2wsdl/target/generated-sources/wsdl/AmazingService.wsdl -wsdl -servicename AmazingService -verbose com.test.AmazingServiceImpl
java2ws - Apache CXF 2.6.0

Aug 24, 2012 4:16:30 PM org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromClass
INFO: Creating Service {http://services.com/amazing}AmazingService from class com.test.AmazingServiceImpl
[INFO] 
[INFO] --- jaxws-maven-plugin:2.2:wsimport (generate-amazing-client) @ test-cxf-java2wsdl ---
[INFO] Processing: file:/home/paul/_trash/test-cxf-java2wsdl/target/generated-sources/wsdl/AmazingService.wsdl
[WARNING] Using platform encoding (UTF-8), build is platform dependent!
[INFO] jaxws:wsimport args: [-keep, -s, /home/paul/_trash/test-cxf-java2wsdl/target/generated-sources/jax-ws-client, -verbose, -extension, -Xnocompile, -p, com.test.ws.client, -wsdllocation, /wsdl/AmazingService.wsdl, -target, 2.0, -B-XautoNameResolution, file:/home/paul/_trash/test-cxf-java2wsdl/target/generated-sources/wsdl/AmazingService.wsdl]
parsing WSDL...


[WARNING] src-resolve: Cannot resolve the name 'ns1:multiItemEntitlementDTO' to a(n) 'type definition' component.
  line 35 of file:/home/paul/_trash/test-cxf-java2wsdl/target/generated-sources/wsdl/AmazingService.wsdl#types?schema2

[WARNING] src-resolve: Cannot resolve the name 'ns1:multiItemEntitlementDTO' to a(n) 'type definition' component.
  line 35 of file:/home/paul/_trash/test-cxf-java2wsdl/target/generated-sources/wsdl/AmazingService.wsdl#types?schema2


Generating code...

com/test/ws/client/AmazingService.java
com/test/ws/client/AmazingServiceImpl.java
com/test/ws/client/GetTransactionsHistory.java
com/test/ws/client/GetTransactionsHistoryResponse.java
com/test/ws/client/GetTransactionsHistoryResult.java
com/test/ws/client/IllegalArgumentException.java
com/test/ws/client/IllegalArgumentException_Exception.java
com/test/ws/client/MultiItemEntitlementDTO.java
com/test/ws/client/ObjectFactory.java
com/test/ws/client/package-info.java
[INFO] 
[INFO] --- maven-resources-plugin:2.4.3:testResources (default-testResources) @ test-cxf-java2wsdl ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/paul/_trash/test-cxf-java2wsdl/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ test-cxf-java2wsdl ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-surefire-plugin:2.7.2:test (default-test) @ test-cxf-java2wsdl ---
[INFO] No tests to run.
[INFO] Surefire report directory: /home/paul/_trash/test-cxf-java2wsdl/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
There are no tests to run.

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO] 
[INFO] --- maven-jar-plugin:2.3.1:jar (default-jar) @ test-cxf-java2wsdl ---
[INFO] Building jar: /home/paul/_trash/test-cxf-java2wsdl/target/test-cxf-java2wsdl-1.0-SNAPSHOT.jar
[INFO] 
[INFO] --- maven-install-plugin:2.3.1:install (default-install) @ test-cxf-java2wsdl ---
[INFO] Installing /home/paul/_trash/test-cxf-java2wsdl/target/test-cxf-java2wsdl-1.0-SNAPSHOT.jar to /home/paul/.m2/repository/test-cxf-java2wsdl/test-cxf-java2wsdl/1.0-SNAPSHOT/test-cxf-java2wsdl-1.0-SNAPSHOT.jar
[INFO] Installing /home/paul/_trash/test-cxf-java2wsdl/pom.xml to /home/paul/.m2/repository/test-cxf-java2wsdl/test-cxf-java2wsdl/1.0-SNAPSHOT/test-cxf-java2wsdl-1.0-SNAPSHOT.pom
[INFO] Installing /home/paul/_trash/test-cxf-java2wsdl/target/generated-sources/wsdl/AmazingService.wsdl to /home/paul/.m2/repository/test-cxf-java2wsdl/test-cxf-java2wsdl/1.0-SNAPSHOT/test-cxf-java2wsdl-1.0-SNAPSHOT.wsdl
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.595s
[INFO] Finished at: Fri Aug 24 16:16:32 CEST 2012
[INFO] Final Memory: 12M/113M
[INFO] ------------------------------------------------------------------------
Apache Maven 3.0.3 (r1075438; 2011-02-28 18:31:09+0100)
Maven home: /opt/maven3
Java version: 1.6.0_32, vendor: Sun Microsystems Inc.
Java home: /opt/jdk1.6.0_32/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.2.0-27-generic", arch: "amd64", family: "unix"







-----Original Message-----
From: Daniel Kulp [mailto:dkulp@apache.org] 
Sent: Friday, August 24, 2012 3:49 PM
To: users@cxf.apache.org; Pavel Khodchenkov
Subject: Re: cxf-java2ws-plugin wsdl generation on java 7


On Aug 24, 2012, at 8:00 AM, Pavel Khodchenkov <pa...@kit-digital.com> wrote:

> Hi,
> 
> I have still have this warning (JDK6+Maven3):

No idea.   My log:

dkulp@dilbert ~/tmp/test-cxf-java2wsdl $ mvn --version Apache Maven 3.0.4 (r1232337; 2012-01-17 03:44:56-0500) Maven home: /opt/tools/maven Java version: 1.6.0_33, vendor: Sun Microsystems Inc.
Java home: /opt/sun-jdk-1.6.0.33/jre
Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "3.3.8", arch: "amd64", family: "unix"
dkulp@dilbert ~/tmp/test-cxf-java2wsdl $ mvn clean install [INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building test-cxf-java2wsdl 1.0-SNAPSHOT [INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ test-cxf-java2wsdl --- [INFO] Deleting /home/dkulp/tmp/test-cxf-java2wsdl/target
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ test-cxf-java2wsdl --- [debug] execute contextualize [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/dkulp/tmp/test-cxf-java2wsdl/target/generated-sources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ test-cxf-java2wsdl --- [WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 4 source files to /home/dkulp/tmp/test-cxf-java2wsdl/target/classes
[INFO]
[INFO] --- cxf-java2ws-plugin:2.6.0:java2ws (generate-amazing-service-wsdl) @ test-cxf-java2wsdl --- java2ws -cp /home/dkulp/tmp/test-cxf-java2wsdl/target/classes:/home/dkulp/tmp/test-cxf-java2wsdl/target/classes:: -o /home/dkulp/tmp/test-cxf-java2wsdl/target/generated-sources/wsdl/AmazingService.wsdl -wsdl -servicename AmazingService -verbose com.test.AmazingServiceImpl java2ws - Apache CXF 2.6.0

Aug 24, 2012 8:46:07 AM org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromClass
INFO: Creating Service {http://services.com/amazing}AmazingService from class com.test.AmazingServiceImpl [INFO] [INFO] --- jaxws-maven-plugin:2.2:wsimport (generate-amazing-client) @ test-cxf-java2wsdl --- [INFO] Processing: file:/home/dkulp/tmp/test-cxf-java2wsdl/target/generated-sources/wsdl/AmazingService.wsdl
[WARNING] Using platform encoding (UTF-8), build is platform dependent!
[INFO] jaxws:wsimport args: [-keep, -s, /home/dkulp/tmp/test-cxf-java2wsdl/target/generated-sources/jax-ws-client, -verbose, -extension, -Xnocompile, -p, com.test.ws.client, -wsdllocation, /wsdl/AmazingService.wsdl, -target, 2.0, -B-XautoNameResolution, file:/home/dkulp/tmp/test-cxf-java2wsdl/target/generated-sources/wsdl/AmazingService.wsdl]
parsing WSDL...



Generating code...

com/test/ws/client/AmazingService.java
com/test/ws/client/AmazingServiceImpl.java
com/test/ws/client/GetTransactionsHistory.java
com/test/ws/client/GetTransactionsHistoryResponse.java
com/test/ws/client/GetTransactionsHistoryResult.java
com/test/ws/client/IllegalArgumentException.java
com/test/ws/client/IllegalArgumentException_Exception.java
com/test/ws/client/MultiItemEntitlementDTO.java
com/test/ws/client/ObjectFactory.java
com/test/ws/client/package-info.java
[INFO] 
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ test-cxf-java2wsdl ---
[debug] execute contextualize
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/dkulp/tmp/test-cxf-java2wsdl/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ test-cxf-java2wsdl ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-surefire-plugin:2.10:test (default-test) @ test-cxf-java2wsdl ---
[INFO] No tests to run.
[INFO] Surefire report directory: /home/dkulp/tmp/test-cxf-java2wsdl/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO] 
[INFO] --- maven-jar-plugin:2.3.2:jar (default-jar) @ test-cxf-java2wsdl ---
[INFO] Building jar: /home/dkulp/tmp/test-cxf-java2wsdl/target/test-cxf-java2wsdl-1.0-SNAPSHOT.jar
[INFO] 
[INFO] --- maven-install-plugin:2.3.1:install (default-install) @ test-cxf-java2wsdl ---
[INFO] Installing /home/dkulp/tmp/test-cxf-java2wsdl/target/test-cxf-java2wsdl-1.0-SNAPSHOT.jar to /home/dkulp/.m2/repository/test-cxf-java2wsdl/test-cxf-java2wsdl/1.0-SNAPSHOT/test-cxf-java2wsdl-1.0-SNAPSHOT.jar
[INFO] Installing /home/dkulp/tmp/test-cxf-java2wsdl/pom.xml to /home/dkulp/.m2/repository/test-cxf-java2wsdl/test-cxf-java2wsdl/1.0-SNAPSHOT/test-cxf-java2wsdl-1.0-SNAPSHOT.pom
[INFO] Installing /home/dkulp/tmp/test-cxf-java2wsdl/target/generated-sources/wsdl/AmazingService.wsdl to /home/dkulp/.m2/repository/test-cxf-java2wsdl/test-cxf-java2wsdl/1.0-SNAPSHOT/test-cxf-java2wsdl-1.0-SNAPSHOT.wsdl
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.326s
[INFO] Finished at: Fri Aug 24 08:46:10 EDT 2012
[INFO] Final Memory: 12M/179M
[INFO] ------------------------------------------------------------------------
dkulp@dilbert ~/tmp/test-cxf-java2wsdl



> 
> 
> [WARNING] src-resolve: Cannot resolve the name 'ns1:multiItemEntitlementDTO' to a(n) 'type definition' component.
>  line 35 of file:/E:/IdeaProjects/1/test-cxf-java2wsdl/target/generated-sources/wsdl/AmazingService.wsdl#types?schema2
> 
> [WARNING] src-resolve: Cannot resolve the name 'ns1:multiItemEntitlementDTO' to a(n) 'type definition' component.
>  line 35 of file:/E:/IdeaProjects/1/test-cxf-java2wsdl/target/generated-sources/wsdl/AmazingService.wsdl#types?schema2
> 
> From: Daniel Kulp [mailto:dkulp@apache.org]
> Sent: Friday, August 24, 2012 2:17 PM
> To: users@cxf.apache.org; Pavel Khodchenkov
> Subject: Re: cxf-java2ws-plugin wsdl generation on java 7
> 
> 
> 
> I've attached the pom I used.
> 
> Dan
> 
> 
> 
> 
> On Aug 24, 2012, at 5:23 AM, Pavel Khodchenkov <pa...@kit-digital.com>> wrote:
> 
>> Hi,
>> If you change the CXF plugin to generate the WSDL into ${project.build.directory}/generated-sources/wsdl, then you get the EXACT same wsdl as if you generate elsewhere, but you no longer get the warning from the JAX-WS plugin.
>> ----------------------------------
>> 
>> I have tried to apply proposed solution, but still have warnings (suppose I am doing smth wrong :) ).
>> Can you please send me the modified maven project where the wsdl generated by CXF is accepted by Metro without warning?
>> 
>> -----Original Message-----
>> From: Daniel Kulp [mailto:dkulp@apache.org]
>> Sent: Thursday, August 23, 2012 9:08 PM
>> To: users@cxf.apache.org<ma...@cxf.apache.org>
>> Subject: Re: cxf-java2ws-plugin wsdl generation on java 7
>> 
>> 
>> I honestly think you've hit a bug in the jaxws-maven-plugin and not CXF.
>> 
>> If you change the CXF plugin to generate the WSDL into ${project.build.directory}/generated-sources/wsdl, then you get the EXACT same wsdl as if you generate elsewhere, but you no longer get the warning from the JAX-WS plugin.
>> 
>> Also, if you add:
>>               <resourceDestDir>${project.build.directory}/generated/wsdl</resourceDestDir>
>>                <inlineSchemas>true</inlineSchemas>
>> to the METRO profiles call to wsgen and run "mvn  clean install -PMETRO" and then "mvn install -PMETRO", you get the same error.
>> 
>> 
>> 
>> Basically, it looks like the wsimport thing needs to have the "generated" directory on the class path somehow.    If you add:
>> 
>>   <build>
>>        <resources>
>>             <resource>
>>                   <directory>${project.build.directory}/generated</directory>
>>             </resource>
>>        </resources>
>>   </build>
>> 
>> to the pom to make sure the generated directory is on the class path, then it also runs without the error.
>> 
>> 
>> Dan
>> 
>> 
>> 
>> On Aug 22, 2012, at 8:25 AM, Pavel Khodchenkov <pa...@kit-digital.com>> wrote:
>> 
>>> Hi there,
>>> I have tried Metro and it was able to generate the wsdl without this warning. The problem is in having the XmlRootElement annotation in one of the entities when this entity is placed inside a list :D . I have extracted the most simple reproducible use case (please see maven 3 project attached) which produce such warning. However , this warning in this sample project is generated also on JDK 6 when using CXF java2wsdl (Metro works fine). Once XmlRootElement annotation is removed from MultiItemEntitlementDTO then CXF also generates a valid wsdl. Please take a look.
>>> 
>>> P.S Some of my services were exposed as SOAP as REST at the same time, so XmlRootElement annotation was required on entity classes , otherwise rest invocation fails with 'No message body writer has been found for class' and  <response> element in wadl will not have type declaration.
>>> -----Original Message-----
>>> From: Glen Mazza [mailto:gmazza@talend.com]
>>> Sent: Tuesday, August 21, 2012 10:02 PM
>>> To: users@cxf.apache.org<ma...@cxf.apache.org>
>>> Subject: Re: cxf-java2ws-plugin wsdl generation on java 7
>>> 
>>> It might be good to post a *minimal* Java class that reproduces the same error; basically rip out as much as you can from the SEI to give the simplest class that provides the same error.  Checking to see what Metro does (same error? no error?) might also be informative:
>>> http://www.jroller.com/gmazza/entry/java_first_web_service.
>>> 
>>> Offhand, I know the default JAXB is different between Java 6 and 7
>>> (JAXB
>>> 2.1 vs. JAXB 2.2), so that could be the issue.
>>> 
>>> Glen
>>> 
>>> On 08/20/2012 06:33 AM, Pavel Khodchenkov wrote:
>>>> 
>>>> Hi folks,
>>>> 
>>>> When I use jdk 7 I have the following warning in jaxws-maven-plugin
>>>> when importing the wsdl generated by cxf-java2ws-plugin 2.6.0:
>>>> 
>>>> [WARNING] src-resolve: Cannot resolve the name
>>>> 'ns1:multiItemEntitlementDTO' to a(n) 'element declaration' component.
>>>> 
>>>> line 163 of
>>>> file:/E:/IdeaProjects/transaction-service/web/target/generated/wsdl/T
>>>> r
>>>> ansactionService.wsdl#types?schema1
>>>> 
>>>> [WARNING] src-resolve: Cannot resolve the name
>>>> 'ns1:multiItemEntitlementDTO' to a(n) 'element declaration' component.
>>>> 
>>>> line 163 of
>>>> file:/E:/IdeaProjects/transaction-service/web/target/generated/wsdl/T
>>>> r
>>>> ansactionService.wsdl#types?schema1
>>>> 
>>>> And the stub generated this wsdl does not work very well: server
>>>> fails with namespace mismatch.
>>>> 
>>>> There is no such issues when I use jdk 6.
>>>> 
>>>> I have attached both wsdls generated by jdk 6 and jdk 7.
>>>> 
>>>> Does somebody have any ideas?
>>>> 
>>> 
>>> <test-cxf-java2wsdl.zip>
>> 
>> --
>> Daniel Kulp
>> dkulp@apache.org<ma...@apache.org> - http://dankulp.com/blog Talend Community Coder - http://coders.talend.com
>> 
> 
> --
> Daniel Kulp
> dkulp@apache.org<ma...@apache.org> - http://dankulp.com/blog
> Talend Community Coder - http://coders.talend.com

-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


Re: cxf-java2ws-plugin wsdl generation on java 7

Posted by Daniel Kulp <dk...@apache.org>.
On Aug 24, 2012, at 8:00 AM, Pavel Khodchenkov <pa...@kit-digital.com> wrote:

> Hi,
> 
> I have still have this warning (JDK6+Maven3):

No idea.   My log:

dkulp@dilbert ~/tmp/test-cxf-java2wsdl $ mvn --version
Apache Maven 3.0.4 (r1232337; 2012-01-17 03:44:56-0500)
Maven home: /opt/tools/maven
Java version: 1.6.0_33, vendor: Sun Microsystems Inc.
Java home: /opt/sun-jdk-1.6.0.33/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.3.8", arch: "amd64", family: "unix"
dkulp@dilbert ~/tmp/test-cxf-java2wsdl $ mvn clean install
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building test-cxf-java2wsdl 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ test-cxf-java2wsdl ---
[INFO] Deleting /home/dkulp/tmp/test-cxf-java2wsdl/target
[INFO] 
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ test-cxf-java2wsdl ---
[debug] execute contextualize
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/dkulp/tmp/test-cxf-java2wsdl/target/generated-sources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ test-cxf-java2wsdl ---
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 4 source files to /home/dkulp/tmp/test-cxf-java2wsdl/target/classes
[INFO] 
[INFO] --- cxf-java2ws-plugin:2.6.0:java2ws (generate-amazing-service-wsdl) @ test-cxf-java2wsdl ---
java2ws -cp /home/dkulp/tmp/test-cxf-java2wsdl/target/classes:/home/dkulp/tmp/test-cxf-java2wsdl/target/classes:: -o /home/dkulp/tmp/test-cxf-java2wsdl/target/generated-sources/wsdl/AmazingService.wsdl -wsdl -servicename AmazingService -verbose com.test.AmazingServiceImpl
java2ws - Apache CXF 2.6.0

Aug 24, 2012 8:46:07 AM org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromClass
INFO: Creating Service {http://services.com/amazing}AmazingService from class com.test.AmazingServiceImpl
[INFO] 
[INFO] --- jaxws-maven-plugin:2.2:wsimport (generate-amazing-client) @ test-cxf-java2wsdl ---
[INFO] Processing: file:/home/dkulp/tmp/test-cxf-java2wsdl/target/generated-sources/wsdl/AmazingService.wsdl
[WARNING] Using platform encoding (UTF-8), build is platform dependent!
[INFO] jaxws:wsimport args: [-keep, -s, /home/dkulp/tmp/test-cxf-java2wsdl/target/generated-sources/jax-ws-client, -verbose, -extension, -Xnocompile, -p, com.test.ws.client, -wsdllocation, /wsdl/AmazingService.wsdl, -target, 2.0, -B-XautoNameResolution, file:/home/dkulp/tmp/test-cxf-java2wsdl/target/generated-sources/wsdl/AmazingService.wsdl]
parsing WSDL...



Generating code...

com/test/ws/client/AmazingService.java
com/test/ws/client/AmazingServiceImpl.java
com/test/ws/client/GetTransactionsHistory.java
com/test/ws/client/GetTransactionsHistoryResponse.java
com/test/ws/client/GetTransactionsHistoryResult.java
com/test/ws/client/IllegalArgumentException.java
com/test/ws/client/IllegalArgumentException_Exception.java
com/test/ws/client/MultiItemEntitlementDTO.java
com/test/ws/client/ObjectFactory.java
com/test/ws/client/package-info.java
[INFO] 
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ test-cxf-java2wsdl ---
[debug] execute contextualize
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/dkulp/tmp/test-cxf-java2wsdl/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ test-cxf-java2wsdl ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-surefire-plugin:2.10:test (default-test) @ test-cxf-java2wsdl ---
[INFO] No tests to run.
[INFO] Surefire report directory: /home/dkulp/tmp/test-cxf-java2wsdl/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO] 
[INFO] --- maven-jar-plugin:2.3.2:jar (default-jar) @ test-cxf-java2wsdl ---
[INFO] Building jar: /home/dkulp/tmp/test-cxf-java2wsdl/target/test-cxf-java2wsdl-1.0-SNAPSHOT.jar
[INFO] 
[INFO] --- maven-install-plugin:2.3.1:install (default-install) @ test-cxf-java2wsdl ---
[INFO] Installing /home/dkulp/tmp/test-cxf-java2wsdl/target/test-cxf-java2wsdl-1.0-SNAPSHOT.jar to /home/dkulp/.m2/repository/test-cxf-java2wsdl/test-cxf-java2wsdl/1.0-SNAPSHOT/test-cxf-java2wsdl-1.0-SNAPSHOT.jar
[INFO] Installing /home/dkulp/tmp/test-cxf-java2wsdl/pom.xml to /home/dkulp/.m2/repository/test-cxf-java2wsdl/test-cxf-java2wsdl/1.0-SNAPSHOT/test-cxf-java2wsdl-1.0-SNAPSHOT.pom
[INFO] Installing /home/dkulp/tmp/test-cxf-java2wsdl/target/generated-sources/wsdl/AmazingService.wsdl to /home/dkulp/.m2/repository/test-cxf-java2wsdl/test-cxf-java2wsdl/1.0-SNAPSHOT/test-cxf-java2wsdl-1.0-SNAPSHOT.wsdl
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.326s
[INFO] Finished at: Fri Aug 24 08:46:10 EDT 2012
[INFO] Final Memory: 12M/179M
[INFO] ------------------------------------------------------------------------
dkulp@dilbert ~/tmp/test-cxf-java2wsdl



> 
> 
> [WARNING] src-resolve: Cannot resolve the name 'ns1:multiItemEntitlementDTO' to a(n) 'type definition' component.
>  line 35 of file:/E:/IdeaProjects/1/test-cxf-java2wsdl/target/generated-sources/wsdl/AmazingService.wsdl#types?schema2
> 
> [WARNING] src-resolve: Cannot resolve the name 'ns1:multiItemEntitlementDTO' to a(n) 'type definition' component.
>  line 35 of file:/E:/IdeaProjects/1/test-cxf-java2wsdl/target/generated-sources/wsdl/AmazingService.wsdl#types?schema2
> 
> From: Daniel Kulp [mailto:dkulp@apache.org]
> Sent: Friday, August 24, 2012 2:17 PM
> To: users@cxf.apache.org; Pavel Khodchenkov
> Subject: Re: cxf-java2ws-plugin wsdl generation on java 7
> 
> 
> 
> I've attached the pom I used.
> 
> Dan
> 
> 
> 
> 
> On Aug 24, 2012, at 5:23 AM, Pavel Khodchenkov <pa...@kit-digital.com>> wrote:
> 
>> Hi,
>> If you change the CXF plugin to generate the WSDL into ${project.build.directory}/generated-sources/wsdl, then you get the EXACT same wsdl as if you generate elsewhere, but you no longer get the warning from the JAX-WS plugin.
>> ----------------------------------
>> 
>> I have tried to apply proposed solution, but still have warnings (suppose I am doing smth wrong :) ).
>> Can you please send me the modified maven project where the wsdl generated by CXF is accepted by Metro without warning?
>> 
>> -----Original Message-----
>> From: Daniel Kulp [mailto:dkulp@apache.org]
>> Sent: Thursday, August 23, 2012 9:08 PM
>> To: users@cxf.apache.org<ma...@cxf.apache.org>
>> Subject: Re: cxf-java2ws-plugin wsdl generation on java 7
>> 
>> 
>> I honestly think you've hit a bug in the jaxws-maven-plugin and not CXF.
>> 
>> If you change the CXF plugin to generate the WSDL into ${project.build.directory}/generated-sources/wsdl, then you get the EXACT same wsdl as if you generate elsewhere, but you no longer get the warning from the JAX-WS plugin.
>> 
>> Also, if you add:
>>               <resourceDestDir>${project.build.directory}/generated/wsdl</resourceDestDir>
>>                <inlineSchemas>true</inlineSchemas>
>> to the METRO profiles call to wsgen and run "mvn  clean install -PMETRO" and then "mvn install -PMETRO", you get the same error.
>> 
>> 
>> 
>> Basically, it looks like the wsimport thing needs to have the "generated" directory on the class path somehow.    If you add:
>> 
>>   <build>
>>        <resources>
>>             <resource>
>>                   <directory>${project.build.directory}/generated</directory>
>>             </resource>
>>        </resources>
>>   </build>
>> 
>> to the pom to make sure the generated directory is on the class path, then it also runs without the error.
>> 
>> 
>> Dan
>> 
>> 
>> 
>> On Aug 22, 2012, at 8:25 AM, Pavel Khodchenkov <pa...@kit-digital.com>> wrote:
>> 
>>> Hi there,
>>> I have tried Metro and it was able to generate the wsdl without this warning. The problem is in having the XmlRootElement annotation in one of the entities when this entity is placed inside a list :D . I have extracted the most simple reproducible use case (please see maven 3 project attached) which produce such warning. However , this warning in this sample project is generated also on JDK 6 when using CXF java2wsdl (Metro works fine). Once XmlRootElement annotation is removed from MultiItemEntitlementDTO then CXF also generates a valid wsdl. Please take a look.
>>> 
>>> P.S Some of my services were exposed as SOAP as REST at the same time, so XmlRootElement annotation was required on entity classes , otherwise rest invocation fails with 'No message body writer has been found for class' and  <response> element in wadl will not have type declaration.
>>> -----Original Message-----
>>> From: Glen Mazza [mailto:gmazza@talend.com]
>>> Sent: Tuesday, August 21, 2012 10:02 PM
>>> To: users@cxf.apache.org<ma...@cxf.apache.org>
>>> Subject: Re: cxf-java2ws-plugin wsdl generation on java 7
>>> 
>>> It might be good to post a *minimal* Java class that reproduces the same error; basically rip out as much as you can from the SEI to give the simplest class that provides the same error.  Checking to see what Metro does (same error? no error?) might also be informative:
>>> http://www.jroller.com/gmazza/entry/java_first_web_service.
>>> 
>>> Offhand, I know the default JAXB is different between Java 6 and 7
>>> (JAXB
>>> 2.1 vs. JAXB 2.2), so that could be the issue.
>>> 
>>> Glen
>>> 
>>> On 08/20/2012 06:33 AM, Pavel Khodchenkov wrote:
>>>> 
>>>> Hi folks,
>>>> 
>>>> When I use jdk 7 I have the following warning in jaxws-maven-plugin
>>>> when importing the wsdl generated by cxf-java2ws-plugin 2.6.0:
>>>> 
>>>> [WARNING] src-resolve: Cannot resolve the name
>>>> 'ns1:multiItemEntitlementDTO' to a(n) 'element declaration' component.
>>>> 
>>>> line 163 of
>>>> file:/E:/IdeaProjects/transaction-service/web/target/generated/wsdl/T
>>>> r
>>>> ansactionService.wsdl#types?schema1
>>>> 
>>>> [WARNING] src-resolve: Cannot resolve the name
>>>> 'ns1:multiItemEntitlementDTO' to a(n) 'element declaration' component.
>>>> 
>>>> line 163 of
>>>> file:/E:/IdeaProjects/transaction-service/web/target/generated/wsdl/T
>>>> r
>>>> ansactionService.wsdl#types?schema1
>>>> 
>>>> And the stub generated this wsdl does not work very well: server
>>>> fails with namespace mismatch.
>>>> 
>>>> There is no such issues when I use jdk 6.
>>>> 
>>>> I have attached both wsdls generated by jdk 6 and jdk 7.
>>>> 
>>>> Does somebody have any ideas?
>>>> 
>>> 
>>> <test-cxf-java2wsdl.zip>
>> 
>> --
>> Daniel Kulp
>> dkulp@apache.org<ma...@apache.org> - http://dankulp.com/blog Talend Community Coder - http://coders.talend.com
>> 
> 
> --
> Daniel Kulp
> dkulp@apache.org<ma...@apache.org> - http://dankulp.com/blog
> Talend Community Coder - http://coders.talend.com

-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


RE: cxf-java2ws-plugin wsdl generation on java 7

Posted by Pavel Khodchenkov <pa...@kit-digital.com>.
Hi,

I have still have this warning (JDK6+Maven3):


[WARNING] src-resolve: Cannot resolve the name 'ns1:multiItemEntitlementDTO' to a(n) 'type definition' component.
  line 35 of file:/E:/IdeaProjects/1/test-cxf-java2wsdl/target/generated-sources/wsdl/AmazingService.wsdl#types?schema2

[WARNING] src-resolve: Cannot resolve the name 'ns1:multiItemEntitlementDTO' to a(n) 'type definition' component.
  line 35 of file:/E:/IdeaProjects/1/test-cxf-java2wsdl/target/generated-sources/wsdl/AmazingService.wsdl#types?schema2

From: Daniel Kulp [mailto:dkulp@apache.org]
Sent: Friday, August 24, 2012 2:17 PM
To: users@cxf.apache.org; Pavel Khodchenkov
Subject: Re: cxf-java2ws-plugin wsdl generation on java 7



I've attached the pom I used.

Dan




On Aug 24, 2012, at 5:23 AM, Pavel Khodchenkov <pa...@kit-digital.com>> wrote:

> Hi,
> If you change the CXF plugin to generate the WSDL into ${project.build.directory}/generated-sources/wsdl, then you get the EXACT same wsdl as if you generate elsewhere, but you no longer get the warning from the JAX-WS plugin.
> ----------------------------------
>
> I have tried to apply proposed solution, but still have warnings (suppose I am doing smth wrong :) ).
> Can you please send me the modified maven project where the wsdl generated by CXF is accepted by Metro without warning?
>
> -----Original Message-----
> From: Daniel Kulp [mailto:dkulp@apache.org]
> Sent: Thursday, August 23, 2012 9:08 PM
> To: users@cxf.apache.org<ma...@cxf.apache.org>
> Subject: Re: cxf-java2ws-plugin wsdl generation on java 7
>
>
> I honestly think you've hit a bug in the jaxws-maven-plugin and not CXF.
>
> If you change the CXF plugin to generate the WSDL into ${project.build.directory}/generated-sources/wsdl, then you get the EXACT same wsdl as if you generate elsewhere, but you no longer get the warning from the JAX-WS plugin.
>
> Also, if you add:
>                <resourceDestDir>${project.build.directory}/generated/wsdl</resourceDestDir>
>                 <inlineSchemas>true</inlineSchemas>
> to the METRO profiles call to wsgen and run "mvn  clean install -PMETRO" and then "mvn install -PMETRO", you get the same error.
>
>
>
> Basically, it looks like the wsimport thing needs to have the "generated" directory on the class path somehow.    If you add:
>
>    <build>
>         <resources>
>              <resource>
>                    <directory>${project.build.directory}/generated</directory>
>              </resource>
>         </resources>
>    </build>
>
> to the pom to make sure the generated directory is on the class path, then it also runs without the error.
>
>
> Dan
>
>
>
> On Aug 22, 2012, at 8:25 AM, Pavel Khodchenkov <pa...@kit-digital.com>> wrote:
>
>> Hi there,
>> I have tried Metro and it was able to generate the wsdl without this warning. The problem is in having the XmlRootElement annotation in one of the entities when this entity is placed inside a list :D . I have extracted the most simple reproducible use case (please see maven 3 project attached) which produce such warning. However , this warning in this sample project is generated also on JDK 6 when using CXF java2wsdl (Metro works fine). Once XmlRootElement annotation is removed from MultiItemEntitlementDTO then CXF also generates a valid wsdl. Please take a look.
>>
>> P.S Some of my services were exposed as SOAP as REST at the same time, so XmlRootElement annotation was required on entity classes , otherwise rest invocation fails with 'No message body writer has been found for class' and  <response> element in wadl will not have type declaration.
>> -----Original Message-----
>> From: Glen Mazza [mailto:gmazza@talend.com]
>> Sent: Tuesday, August 21, 2012 10:02 PM
>> To: users@cxf.apache.org<ma...@cxf.apache.org>
>> Subject: Re: cxf-java2ws-plugin wsdl generation on java 7
>>
>> It might be good to post a *minimal* Java class that reproduces the same error; basically rip out as much as you can from the SEI to give the simplest class that provides the same error.  Checking to see what Metro does (same error? no error?) might also be informative:
>> http://www.jroller.com/gmazza/entry/java_first_web_service.
>>
>> Offhand, I know the default JAXB is different between Java 6 and 7
>> (JAXB
>> 2.1 vs. JAXB 2.2), so that could be the issue.
>>
>> Glen
>>
>> On 08/20/2012 06:33 AM, Pavel Khodchenkov wrote:
>>>
>>> Hi folks,
>>>
>>> When I use jdk 7 I have the following warning in jaxws-maven-plugin
>>> when importing the wsdl generated by cxf-java2ws-plugin 2.6.0:
>>>
>>> [WARNING] src-resolve: Cannot resolve the name
>>> 'ns1:multiItemEntitlementDTO' to a(n) 'element declaration' component.
>>>
>>> line 163 of
>>> file:/E:/IdeaProjects/transaction-service/web/target/generated/wsdl/T
>>> r
>>> ansactionService.wsdl#types?schema1
>>>
>>> [WARNING] src-resolve: Cannot resolve the name
>>> 'ns1:multiItemEntitlementDTO' to a(n) 'element declaration' component.
>>>
>>> line 163 of
>>> file:/E:/IdeaProjects/transaction-service/web/target/generated/wsdl/T
>>> r
>>> ansactionService.wsdl#types?schema1
>>>
>>> And the stub generated this wsdl does not work very well: server
>>> fails with namespace mismatch.
>>>
>>> There is no such issues when I use jdk 6.
>>>
>>> I have attached both wsdls generated by jdk 6 and jdk 7.
>>>
>>> Does somebody have any ideas?
>>>
>>
>> <test-cxf-java2wsdl.zip>
>
> --
> Daniel Kulp
> dkulp@apache.org<ma...@apache.org> - http://dankulp.com/blog Talend Community Coder - http://coders.talend.com
>

--
Daniel Kulp
dkulp@apache.org<ma...@apache.org> - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com

Re: cxf-java2ws-plugin wsdl generation on java 7

Posted by Daniel Kulp <dk...@apache.org>.

I've attached the pom I used.

Dan



Re: cxf-java2ws-plugin wsdl generation on java 7

Posted by Glen Mazza <gm...@talend.com>.
Our WSDL to Java Maven plugin does use generated-sources as its default 
(to store the generated Java artifacts), but apparently the Java to WSDL 
uses just "generated", perhaps because we didn't want to mix WSDL files 
with Java files for larger projects using a combination of the two 
tools.  If your business needs require a different output folder for the 
WSDL than CXF's default, I'd go ahead and just use the option CXF 
already provides to change the output folder that Dan showed below.

Rather than have CXF change its defaults to cover up Metro's 
configuration shortcomings, it would be better if you wish to submit a 
bug report to the Metro team to get those shortcomings fixed: 
http://java.net/jira/browse/JAX_WS .

Glen

On 08/24/2012 05:23 AM, Pavel Khodchenkov wrote:
> Hi,
> If you change the CXF plugin to generate the WSDL into ${project.build.directory}/generated-sources/wsdl, then you get the EXACT same wsdl as if you generate elsewhere, but you no longer get the warning from the JAX-WS plugin.
> ----------------------------------
>
> I have tried to apply proposed solution, but still have warnings (suppose I am doing smth wrong :) ).
> Can you please send me the modified maven project where the wsdl generated by CXF is accepted by Metro without warning?
>
> -----Original Message-----
> From: Daniel Kulp [mailto:dkulp@apache.org]
> Sent: Thursday, August 23, 2012 9:08 PM
> To: users@cxf.apache.org
> Subject: Re: cxf-java2ws-plugin wsdl generation on java 7
>
>
> I honestly think you've hit a bug in the jaxws-maven-plugin and not CXF.
>
> If you change the CXF plugin to generate the WSDL into ${project.build.directory}/generated-sources/wsdl, then you get the EXACT same wsdl as if you generate elsewhere, but you no longer get the warning from the JAX-WS plugin.
>
> Also, if you add:
>                  <resourceDestDir>${project.build.directory}/generated/wsdl</resourceDestDir>
>                   <inlineSchemas>true</inlineSchemas>
> to the METRO profiles call to wsgen and run "mvn  clean install -PMETRO" and then "mvn install -PMETRO", you get the same error.
>
>
>
> Basically, it looks like the wsimport thing needs to have the "generated" directory on the class path somehow.    If you add:
>
>      <build>
>           <resources>
>                <resource>
>                      <directory>${project.build.directory}/generated</directory>
>                </resource>
>           </resources>
>      </build>
>
> to the pom to make sure the generated directory is on the class path, then it also runs without the error.
>
>
> Dan
>
>
>
> On Aug 22, 2012, at 8:25 AM, Pavel Khodchenkov <pa...@kit-digital.com> wrote:
>
>> Hi there,
>> I have tried Metro and it was able to generate the wsdl without this warning. The problem is in having the XmlRootElement annotation in one of the entities when this entity is placed inside a list :D . I have extracted the most simple reproducible use case (please see maven 3 project attached) which produce such warning. However , this warning in this sample project is generated also on JDK 6 when using CXF java2wsdl (Metro works fine). Once XmlRootElement annotation is removed from MultiItemEntitlementDTO then CXF also generates a valid wsdl. Please take a look.
>>
>> P.S Some of my services were exposed as SOAP as REST at the same time, so XmlRootElement annotation was required on entity classes , otherwise rest invocation fails with 'No message body writer has been found for class' and  <response> element in wadl will not have type declaration.
>> -----Original Message-----
>> From: Glen Mazza [mailto:gmazza@talend.com]
>> Sent: Tuesday, August 21, 2012 10:02 PM
>> To: users@cxf.apache.org
>> Subject: Re: cxf-java2ws-plugin wsdl generation on java 7
>>
>> It might be good to post a *minimal* Java class that reproduces the same error; basically rip out as much as you can from the SEI to give the simplest class that provides the same error.  Checking to see what Metro does (same error? no error?) might also be informative:
>> http://www.jroller.com/gmazza/entry/java_first_web_service.
>>
>> Offhand, I know the default JAXB is different between Java 6 and 7
>> (JAXB
>> 2.1 vs. JAXB 2.2), so that could be the issue.
>>
>> Glen
>>
>> On 08/20/2012 06:33 AM, Pavel Khodchenkov wrote:
>>> Hi folks,
>>>
>>> When I use jdk 7 I have the following warning in jaxws-maven-plugin
>>> when importing the wsdl generated by cxf-java2ws-plugin 2.6.0:
>>>
>>> [WARNING] src-resolve: Cannot resolve the name
>>> 'ns1:multiItemEntitlementDTO' to a(n) 'element declaration' component.
>>>
>>>   line 163 of
>>> file:/E:/IdeaProjects/transaction-service/web/target/generated/wsdl/T
>>> r
>>> ansactionService.wsdl#types?schema1
>>>
>>> [WARNING] src-resolve: Cannot resolve the name
>>> 'ns1:multiItemEntitlementDTO' to a(n) 'element declaration' component.
>>>
>>>   line 163 of
>>> file:/E:/IdeaProjects/transaction-service/web/target/generated/wsdl/T
>>> r
>>> ansactionService.wsdl#types?schema1
>>>
>>> And the stub generated this wsdl does not work very well: server
>>> fails with namespace mismatch.
>>>
>>> There is no such issues when I use jdk 6.
>>>
>>> I have attached both wsdls generated by jdk 6 and jdk 7.
>>>
>>> Does somebody have any ideas?
>>>
>> <test-cxf-java2wsdl.zip>
> --
> Daniel Kulp
> dkulp@apache.org - http://dankulp.com/blog Talend Community Coder - http://coders.talend.com
>


RE: cxf-java2ws-plugin wsdl generation on java 7

Posted by Pavel Khodchenkov <pa...@kit-digital.com>.
Hi,
If you change the CXF plugin to generate the WSDL into ${project.build.directory}/generated-sources/wsdl, then you get the EXACT same wsdl as if you generate elsewhere, but you no longer get the warning from the JAX-WS plugin.
----------------------------------

I have tried to apply proposed solution, but still have warnings (suppose I am doing smth wrong :) ).
Can you please send me the modified maven project where the wsdl generated by CXF is accepted by Metro without warning?

-----Original Message-----
From: Daniel Kulp [mailto:dkulp@apache.org] 
Sent: Thursday, August 23, 2012 9:08 PM
To: users@cxf.apache.org
Subject: Re: cxf-java2ws-plugin wsdl generation on java 7


I honestly think you've hit a bug in the jaxws-maven-plugin and not CXF.  

If you change the CXF plugin to generate the WSDL into ${project.build.directory}/generated-sources/wsdl, then you get the EXACT same wsdl as if you generate elsewhere, but you no longer get the warning from the JAX-WS plugin.

Also, if you add:
                <resourceDestDir>${project.build.directory}/generated/wsdl</resourceDestDir>
                 <inlineSchemas>true</inlineSchemas>
to the METRO profiles call to wsgen and run "mvn  clean install -PMETRO" and then "mvn install -PMETRO", you get the same error.



Basically, it looks like the wsimport thing needs to have the "generated" directory on the class path somehow.    If you add:

    <build>
         <resources>
              <resource>
                    <directory>${project.build.directory}/generated</directory>
              </resource>
         </resources>
    </build>

to the pom to make sure the generated directory is on the class path, then it also runs without the error.


Dan



On Aug 22, 2012, at 8:25 AM, Pavel Khodchenkov <pa...@kit-digital.com> wrote:

> Hi there,
> I have tried Metro and it was able to generate the wsdl without this warning. The problem is in having the XmlRootElement annotation in one of the entities when this entity is placed inside a list :D . I have extracted the most simple reproducible use case (please see maven 3 project attached) which produce such warning. However , this warning in this sample project is generated also on JDK 6 when using CXF java2wsdl (Metro works fine). Once XmlRootElement annotation is removed from MultiItemEntitlementDTO then CXF also generates a valid wsdl. Please take a look.
> 
> P.S Some of my services were exposed as SOAP as REST at the same time, so XmlRootElement annotation was required on entity classes , otherwise rest invocation fails with 'No message body writer has been found for class' and  <response> element in wadl will not have type declaration.
> -----Original Message-----
> From: Glen Mazza [mailto:gmazza@talend.com]
> Sent: Tuesday, August 21, 2012 10:02 PM
> To: users@cxf.apache.org
> Subject: Re: cxf-java2ws-plugin wsdl generation on java 7
> 
> It might be good to post a *minimal* Java class that reproduces the same error; basically rip out as much as you can from the SEI to give the simplest class that provides the same error.  Checking to see what Metro does (same error? no error?) might also be informative: 
> http://www.jroller.com/gmazza/entry/java_first_web_service.
> 
> Offhand, I know the default JAXB is different between Java 6 and 7 
> (JAXB
> 2.1 vs. JAXB 2.2), so that could be the issue.
> 
> Glen
> 
> On 08/20/2012 06:33 AM, Pavel Khodchenkov wrote:
>> 
>> Hi folks,
>> 
>> When I use jdk 7 I have the following warning in jaxws-maven-plugin 
>> when importing the wsdl generated by cxf-java2ws-plugin 2.6.0:
>> 
>> [WARNING] src-resolve: Cannot resolve the name 
>> 'ns1:multiItemEntitlementDTO' to a(n) 'element declaration' component.
>> 
>>  line 163 of
>> file:/E:/IdeaProjects/transaction-service/web/target/generated/wsdl/T
>> r
>> ansactionService.wsdl#types?schema1
>> 
>> [WARNING] src-resolve: Cannot resolve the name 
>> 'ns1:multiItemEntitlementDTO' to a(n) 'element declaration' component.
>> 
>>  line 163 of
>> file:/E:/IdeaProjects/transaction-service/web/target/generated/wsdl/T
>> r
>> ansactionService.wsdl#types?schema1
>> 
>> And the stub generated this wsdl does not work very well: server 
>> fails with namespace mismatch.
>> 
>> There is no such issues when I use jdk 6.
>> 
>> I have attached both wsdls generated by jdk 6 and jdk 7.
>> 
>> Does somebody have any ideas?
>> 
> 
> <test-cxf-java2wsdl.zip>

--
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog Talend Community Coder - http://coders.talend.com


Re: cxf-java2ws-plugin wsdl generation on java 7

Posted by Daniel Kulp <dk...@apache.org>.
I honestly think you've hit a bug in the jaxws-maven-plugin and not CXF.  

If you change the CXF plugin to generate the WSDL into ${project.build.directory}/generated-sources/wsdl, then you get the EXACT same wsdl as if you generate elsewhere, but you no longer get the warning from the JAX-WS plugin.

Also, if you add:
                <resourceDestDir>${project.build.directory}/generated/wsdl</resourceDestDir>
                 <inlineSchemas>true</inlineSchemas>
to the METRO profiles call to wsgen and run "mvn  clean install -PMETRO" and then "mvn install -PMETRO", you get the same error.



Basically, it looks like the wsimport thing needs to have the "generated" directory on the class path somehow.    If you add:

    <build>
         <resources>
              <resource>
                    <directory>${project.build.directory}/generated</directory>
              </resource>
         </resources>
    </build>

to the pom to make sure the generated directory is on the class path, then it also runs without the error.


Dan



On Aug 22, 2012, at 8:25 AM, Pavel Khodchenkov <pa...@kit-digital.com> wrote:

> Hi there,
> I have tried Metro and it was able to generate the wsdl without this warning. The problem is in having the XmlRootElement annotation in one of the entities when this entity is placed inside a list :D . I have extracted the most simple reproducible use case (please see maven 3 project attached) which produce such warning. However , this warning in this sample project is generated also on JDK 6 when using CXF java2wsdl (Metro works fine). Once XmlRootElement annotation is removed from MultiItemEntitlementDTO then CXF also generates a valid wsdl. Please take a look.
> 
> P.S Some of my services were exposed as SOAP as REST at the same time, so XmlRootElement annotation was required on entity classes , otherwise rest invocation fails with 'No message body writer has been found for class' and  <response> element in wadl will not have type declaration.
> -----Original Message-----
> From: Glen Mazza [mailto:gmazza@talend.com] 
> Sent: Tuesday, August 21, 2012 10:02 PM
> To: users@cxf.apache.org
> Subject: Re: cxf-java2ws-plugin wsdl generation on java 7
> 
> It might be good to post a *minimal* Java class that reproduces the same error; basically rip out as much as you can from the SEI to give the simplest class that provides the same error.  Checking to see what Metro does (same error? no error?) might also be informative: 
> http://www.jroller.com/gmazza/entry/java_first_web_service.
> 
> Offhand, I know the default JAXB is different between Java 6 and 7 (JAXB
> 2.1 vs. JAXB 2.2), so that could be the issue.
> 
> Glen
> 
> On 08/20/2012 06:33 AM, Pavel Khodchenkov wrote:
>> 
>> Hi folks,
>> 
>> When I use jdk 7 I have the following warning in jaxws-maven-plugin 
>> when importing the wsdl generated by cxf-java2ws-plugin 2.6.0:
>> 
>> [WARNING] src-resolve: Cannot resolve the name 
>> 'ns1:multiItemEntitlementDTO' to a(n) 'element declaration' component.
>> 
>>  line 163 of
>> file:/E:/IdeaProjects/transaction-service/web/target/generated/wsdl/Tr
>> ansactionService.wsdl#types?schema1
>> 
>> [WARNING] src-resolve: Cannot resolve the name 
>> 'ns1:multiItemEntitlementDTO' to a(n) 'element declaration' component.
>> 
>>  line 163 of
>> file:/E:/IdeaProjects/transaction-service/web/target/generated/wsdl/Tr
>> ansactionService.wsdl#types?schema1
>> 
>> And the stub generated this wsdl does not work very well: server fails 
>> with namespace mismatch.
>> 
>> There is no such issues when I use jdk 6.
>> 
>> I have attached both wsdls generated by jdk 6 and jdk 7.
>> 
>> Does somebody have any ideas?
>> 
> 
> <test-cxf-java2wsdl.zip>

-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


RE: cxf-java2ws-plugin wsdl generation on java 7

Posted by Pavel Khodchenkov <pa...@kit-digital.com>.
Hi there,
I have tried Metro and it was able to generate the wsdl without this warning. The problem is in having the XmlRootElement annotation in one of the entities when this entity is placed inside a list :D . I have extracted the most simple reproducible use case (please see maven 3 project attached) which produce such warning. However , this warning in this sample project is generated also on JDK 6 when using CXF java2wsdl (Metro works fine). Once XmlRootElement annotation is removed from MultiItemEntitlementDTO then CXF also generates a valid wsdl. Please take a look.

P.S Some of my services were exposed as SOAP as REST at the same time, so XmlRootElement annotation was required on entity classes , otherwise rest invocation fails with 'No message body writer has been found for class' and  <response> element in wadl will not have type declaration.
-----Original Message-----
From: Glen Mazza [mailto:gmazza@talend.com] 
Sent: Tuesday, August 21, 2012 10:02 PM
To: users@cxf.apache.org
Subject: Re: cxf-java2ws-plugin wsdl generation on java 7

It might be good to post a *minimal* Java class that reproduces the same error; basically rip out as much as you can from the SEI to give the simplest class that provides the same error.  Checking to see what Metro does (same error? no error?) might also be informative: 
http://www.jroller.com/gmazza/entry/java_first_web_service.

Offhand, I know the default JAXB is different between Java 6 and 7 (JAXB
2.1 vs. JAXB 2.2), so that could be the issue.

Glen

On 08/20/2012 06:33 AM, Pavel Khodchenkov wrote:
>
> Hi folks,
>
> When I use jdk 7 I have the following warning in jaxws-maven-plugin 
> when importing the wsdl generated by cxf-java2ws-plugin 2.6.0:
>
> [WARNING] src-resolve: Cannot resolve the name 
> 'ns1:multiItemEntitlementDTO' to a(n) 'element declaration' component.
>
>   line 163 of
> file:/E:/IdeaProjects/transaction-service/web/target/generated/wsdl/Tr
> ansactionService.wsdl#types?schema1
>
> [WARNING] src-resolve: Cannot resolve the name 
> 'ns1:multiItemEntitlementDTO' to a(n) 'element declaration' component.
>
>   line 163 of
> file:/E:/IdeaProjects/transaction-service/web/target/generated/wsdl/Tr
> ansactionService.wsdl#types?schema1
>
> And the stub generated this wsdl does not work very well: server fails 
> with namespace mismatch.
>
> There is no such issues when I use jdk 6.
>
> I have attached both wsdls generated by jdk 6 and jdk 7.
>
> Does somebody have any ideas?
>


Re: cxf-java2ws-plugin wsdl generation on java 7

Posted by Glen Mazza <gm...@talend.com>.
It might be good to post a *minimal* Java class that reproduces the same 
error; basically rip out as much as you can from the SEI to give the 
simplest class that provides the same error.  Checking to see what Metro 
does (same error? no error?) might also be informative: 
http://www.jroller.com/gmazza/entry/java_first_web_service.

Offhand, I know the default JAXB is different between Java 6 and 7 (JAXB 
2.1 vs. JAXB 2.2), so that could be the issue.

Glen

On 08/20/2012 06:33 AM, Pavel Khodchenkov wrote:
>
> Hi folks,
>
> When I use jdk 7 I have the following warning in jaxws-maven-plugin 
> when importing the wsdl generated by cxf-java2ws-plugin 2.6.0:
>
> [WARNING] src-resolve: Cannot resolve the name 
> 'ns1:multiItemEntitlementDTO' to a(n) 'element declaration' component.
>
>   line 163 of 
> file:/E:/IdeaProjects/transaction-service/web/target/generated/wsdl/TransactionService.wsdl#types?schema1
>
> [WARNING] src-resolve: Cannot resolve the name 
> 'ns1:multiItemEntitlementDTO' to a(n) 'element declaration' component.
>
>   line 163 of 
> file:/E:/IdeaProjects/transaction-service/web/target/generated/wsdl/TransactionService.wsdl#types?schema1
>
> And the stub generated this wsdl does not work very well: server fails 
> with namespace mismatch.
>
> There is no such issues when I use jdk 6.
>
> I have attached both wsdls generated by jdk 6 and jdk 7.
>
> Does somebody have any ideas?
>


Re: cxf-java2ws-plugin wsdl generation on java 7

Posted by Daniel Kulp <dk...@apache.org>.
It looks like you may have some strange annotations on either your MultiItemEntitlementDTO class or on the multiItemEntitlementDTO element in your TransactionEntitlementDTO object.   I would double check those and make sure they have the appropriate namespace attributes, etc…  I'm really not sure why there are those three elements being generated in the http://services.kitd.com/entitlement schema.   Slightly strange to me.

Dan



On Aug 20, 2012, at 6:33 AM, Pavel Khodchenkov <pa...@kit-digital.com> wrote:

> Hi folks,
> When I use jdk 7 I have the following warning in jaxws-maven-plugin when importing the wsdl generated by cxf-java2ws-plugin 2.6.0:

> [WARNING] src-resolve: Cannot resolve the name 'ns1:multiItemEntitlementDTO' to a(n) 'element declaration' component.
>   line 163 of file:/E:/IdeaProjects/transaction-service/web/target/generated/wsdl/TransactionService.wsdl#types?schema1
>  
> [WARNING] src-resolve: Cannot resolve the name 'ns1:multiItemEntitlementDTO' to a(n) 'element declaration' component.
>   line 163 of file:/E:/IdeaProjects/transaction-service/web/target/generated/wsdl/TransactionService.wsdl#types?schema1
>  
>  
>  
> And the stub generated this wsdl does not work very well: server fails with namespace mismatch.
>  
> There is no such issues when I use jdk 6.
>  
> I have attached both wsdls generated by jdk 6 and jdk 7.
>  
> Does somebody have any ideas?
> <wsdls.zip>

-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com