On Aug 24, 2012, at 8:00 AM, Pavel Khodchenkov
<[email protected]> 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:[email protected]]
> Sent: Friday, August 24, 2012 2:17 PM
> To: [email protected]; 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
> <[email protected]<mailto:[email protected]>>
> 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:[email protected]]
>> Sent: Thursday, August 23, 2012 9:08 PM
>> To: [email protected]<mailto:[email protected]>
>> 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
>> <[email protected]<mailto:[email protected]>>
>> 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:[email protected]]
>>> Sent: Tuesday, August 21, 2012 10:02 PM
>>> To: [email protected]<mailto:[email protected]>
>>> 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
>> [email protected]<mailto:[email protected]> - http://dankulp.com/blog Talend
>> Community Coder - http://coders.talend.com
>>
>
> --
> Daniel Kulp
> [email protected]<mailto:[email protected]> - http://dankulp.com/blog
> Talend Community Coder - http://coders.talend.com
--
Daniel Kulp
[email protected] - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com