cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vasiliy Bout (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CXF-4754) Invalid client code generation of wsdl2java with -wsdlList option
Date Fri, 25 Jan 2013 12:15:12 GMT

    [ https://issues.apache.org/jira/browse/CXF-4754?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13562623#comment-13562623
] 

Vasiliy Bout commented on CXF-4754:
-----------------------------------

I understand, what you mean. If I generate code into separate package for each WSDL file,
then it works fine. But I get big number of java files with the same names and the same implementations
(only different package names obviously), which are data-structures from WSDL xsd schema:

ClassAdAttrType.java        
ClassAdStruct.java          
ClassAdStructAndStatus.java 
ClassAdStructArray.java     
ClassAdStructArrayAndStatus.java 
ClassAdStructAttr.java 
Status.java 
StatusCode.java 
StringAndStatus.java 
package-info.java 

and two web service request and response classes:
GetPlatformString.java 
GetPlatformStringResponse.java 
GetVersionString.java 
GetVersionStringResponse.java 


The only class that is present in both packages with different implementations is ObjectFactory.

Other java files contain data structures and request and response classes for web services,
that are unique and present in only one of WSDL files, so they have no corresponding java
classes in another package.


If I generate code for both WSDL files into one package, then I get:
1) all request and response classes with correct implementations (because all requests and
response are unique, except those two GetPlatformString and GetVersionString, which are identical
in both WSDL files);
2) all data structures with correct implementations (because some are unique, and others are
identical in both WSDL files too)
3) and one ObjectFactory class, in which some implementation is missing.

If I compare ObjectFactory classes from the first two packages with that one from the second
single package, then I see, that all methods in the second ObjectFactory are identical to
the corresponding methods from the first two ObjectFactory classes, but some methods are missing,
that is implementation of second ObjectFactory is not full (simple some methods are missing,
but present methods are correct).

So as I can see, the code, generated from two WSDL files into one package, is almost correct,
but simply is not full (some methods in ObjectFactory are missing and were not generated for
some unknown reason)
                
> Invalid client code generation of wsdl2java with -wsdlList option
> -----------------------------------------------------------------
>
>                 Key: CXF-4754
>                 URL: https://issues.apache.org/jira/browse/CXF-4754
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.6.5, 2.7.2
>         Environment: Mac OS X, version 10.6.8
> JDK 1.6.0
>            Reporter: Vasiliy Bout
>            Priority: Critical
>         Attachments: condorCollector.wsdl, condorSchedd.wsdl, wsdl.list
>
>
> I tried to build a client for the Web Service (WS) of HTCondor GRID system ([http://research.cs.wisc.edu/htcondor/]).
> They have two WSDL files, that come with original tar.gz downloadable file. I have used
HTCondor version 7.8.7. You can find two WSDL files in subfolder "lib/webservice": they are
"condorCollector.wsdl" and "condorSchedd.wsdl".
> When I create client Java code with the following commands:
> {noformat}
> wsdl2java -frontend jaxws21 -client -V -compile \
>     -classdir out/classes -d out -wsdlLocation '' \
>     -p org.htcondor.collector    condorCollector.wsdl
> wsdl2java -frontend jaxws21 -client -V -compile \
>     -classdir out/classes -d out -wsdlLocation '' \
>     -p org.htcondor.schedd      condorSchedd.wsdl
> {noformat}
> then compiled code behaves as expected. By default, WS address is specified as localhost:80
in WSDL file, so when I try to launch the client on clean machine (without HTCondor installed):
> {noformat}
> java -cp out/classes org.htcondor.collector.CondorCollectorPortType_CondorCollector_Client
condorCollector.wsdl
> {noformat}
> ... then I simply get connection error. It is ok.
> But If I generate client Java code with the following command:
> {noformat}
> wsdl2java -frontend jaxws21 -client -V -compile \
>     -classdir out/classes -d out -wsdlLocation '' \
>     -p org.htcondor      -wsdlList   wsdl.list
> {noformat}
> ... with "wsdl.list" file containing two lines:
> {noformat}
> condorCollector.wsdl
> condorSchedd.wsdl
> {noformat}
> ... and then launch the client with the following command:
> {noformat}
> java -cp out/classes org.htcondor.CondorCollectorPortType_CondorCollector_Client condorCollector.wsdl
> {noformat}
> ... then I get the following exception:
> {noformat}
> Exception in thread "main" javax.xml.ws.WebServiceException: Unable to create JAXBContext
> 	at com.sun.xml.internal.ws.model.AbstractSEIModelImpl.createJAXBContext(AbstractSEIModelImpl.java:153)
> 	at com.sun.xml.internal.ws.model.AbstractSEIModelImpl.postProcess(AbstractSEIModelImpl.java:83)
> 	at com.sun.xml.internal.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:244)
> 	at com.sun.xml.internal.ws.client.WSServiceDelegate.createSEIPortInfo(WSServiceDelegate.java:687)
> 	at com.sun.xml.internal.ws.client.WSServiceDelegate.addSEI(WSServiceDelegate.java:675)
> 	at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:330)
> 	at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:313)
> 	at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:295)
> 	at javax.xml.ws.Service.getPort(Service.java:92)
> 	at org.htcondor.CondorCollector.getCondorCollector(CondorCollector.java:50)
> 	at org.htcondor.CondorCollectorPortType_CondorCollector_Client.main(CondorCollectorPortType_CondorCollector_Client.java:50)
> Caused by: java.security.PrivilegedActionException: com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException:
7 counts of IllegalAnnotationExceptions
> There's no ObjectFactory with an @XmlElementDecl for the element {}constraint.
> 	this problem is related to the following location:
> 		at protected javax.xml.bind.JAXBElement org.htcondor.QuerySubmittorAds.constraint
> 		at org.htcondor.QuerySubmittorAds
> There's no ObjectFactory with an @XmlElementDecl for the element {}constraint.
> 	this problem is related to the following location:
> 		at protected javax.xml.bind.JAXBElement org.htcondor.QueryAnyAds.constraint
> 		at org.htcondor.QueryAnyAds
> There's no ObjectFactory with an @XmlElementDecl for the element {}constraint.
> 	this problem is related to the following location:
> 		at protected javax.xml.bind.JAXBElement org.htcondor.QueryLicenseAds.constraint
> 		at org.htcondor.QueryLicenseAds
> There's no ObjectFactory with an @XmlElementDecl for the element {}constraint.
> 	this problem is related to the following location:
> 		at protected javax.xml.bind.JAXBElement org.htcondor.QueryStorageAds.constraint
> 		at org.htcondor.QueryStorageAds
> There's no ObjectFactory with an @XmlElementDecl for the element {}constraint.
> 	this problem is related to the following location:
> 		at protected javax.xml.bind.JAXBElement org.htcondor.QueryMasterAds.constraint
> 		at org.htcondor.QueryMasterAds
> There's no ObjectFactory with an @XmlElementDecl for the element {}constraint.
> 	this problem is related to the following location:
> 		at protected javax.xml.bind.JAXBElement org.htcondor.QueryStartdAds.constraint
> 		at org.htcondor.QueryStartdAds
> There's no ObjectFactory with an @XmlElementDecl for the element {}constraint.
> 	this problem is related to the following location:
> 		at protected javax.xml.bind.JAXBElement org.htcondor.QueryScheddAds.constraint
> 		at org.htcondor.QueryScheddAds
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at com.sun.xml.internal.ws.model.AbstractSEIModelImpl.createJAXBContext(AbstractSEIModelImpl.java:140)
> 	... 10 more
> Caused by: com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 7 counts
of IllegalAnnotationExceptions
> There's no ObjectFactory with an @XmlElementDecl for the element {}constraint.
> 	this problem is related to the following location:
> 		at protected javax.xml.bind.JAXBElement org.htcondor.QuerySubmittorAds.constraint
> 		at org.htcondor.QuerySubmittorAds
> There's no ObjectFactory with an @XmlElementDecl for the element {}constraint.
> 	this problem is related to the following location:
> 		at protected javax.xml.bind.JAXBElement org.htcondor.QueryAnyAds.constraint
> 		at org.htcondor.QueryAnyAds
> There's no ObjectFactory with an @XmlElementDecl for the element {}constraint.
> 	this problem is related to the following location:
> 		at protected javax.xml.bind.JAXBElement org.htcondor.QueryLicenseAds.constraint
> 		at org.htcondor.QueryLicenseAds
> There's no ObjectFactory with an @XmlElementDecl for the element {}constraint.
> 	this problem is related to the following location:
> 		at protected javax.xml.bind.JAXBElement org.htcondor.QueryStorageAds.constraint
> 		at org.htcondor.QueryStorageAds
> There's no ObjectFactory with an @XmlElementDecl for the element {}constraint.
> 	this problem is related to the following location:
> 		at protected javax.xml.bind.JAXBElement org.htcondor.QueryMasterAds.constraint
> 		at org.htcondor.QueryMasterAds
> There's no ObjectFactory with an @XmlElementDecl for the element {}constraint.
> 	this problem is related to the following location:
> 		at protected javax.xml.bind.JAXBElement org.htcondor.QueryStartdAds.constraint
> 		at org.htcondor.QueryStartdAds
> There's no ObjectFactory with an @XmlElementDecl for the element {}constraint.
> 	this problem is related to the following location:
> 		at protected javax.xml.bind.JAXBElement org.htcondor.QueryScheddAds.constraint
> 		at org.htcondor.QueryScheddAds
> 	at com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:91)
> 	at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:436)
> 	at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:277)
> 	at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1100)
> 	at com.sun.xml.internal.bind.v2.ContextFactory.createContext(ContextFactory.java:143)
> 	at com.sun.xml.internal.bind.api.JAXBRIContext.newInstance(JAXBRIContext.java:95)
> 	at com.sun.xml.internal.ws.developer.JAXBContextFactory$1.createJAXBContext(JAXBContextFactory.java:97)
> 	at com.sun.xml.internal.ws.model.AbstractSEIModelImpl$1.run(AbstractSEIModelImpl.java:148)
> 	at com.sun.xml.internal.ws.model.AbstractSEIModelImpl$1.run(AbstractSEIModelImpl.java:140)
> 	... 12 more
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message