You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Pasqualino Imbemba <p....@gmail.com> on 2012/03/20 12:03:44 UTC

Exception thrown by JAXB: Two declarations cause a collision in the ObjectFactory class.

Hello,

I'm using CXF 2.5.2.
When I try to run wsdl2Java against this WSDL (
http://cooperazione.sian.it/wspdd/services/AllineamentoGIS?wsdl) I get this
following error:
WSDLToJava Error: Thrown by JAXB:
Thrown by JAXB:
Two declarations cause a collision in the ObjectFactory class.
 at line 21 column 3 of schema
file:/tmp/tempdir769259763399432743.tmp/feature.xsd

(Related to above error) This is the other declaration.
 at line 20 column 3 of schema
file:/tmp/tempdir769259763399432743.tmp/feature.xsd

org.apache.cxf.tools.common.ToolException: Thrown by JAXB:
Thrown by JAXB:
Two declarations cause a collision in the ObjectFactory class.
 at line 21 column 3 of schema
file:/tmp/tempdir769259763399432743.tmp/feature.xsd

(Related to above error) This is the other declaration.
 at line 20 column 3 of schema
file:/tmp/tempdir769259763399432743.tmp/feature.xsd

(...)

Caused by: com.sun.istack.SAXParseException2: Two declarations cause a
collision in the ObjectFactory class.

The above WSDL refers to http://schemas.opengis.net/gml/2.0.0/feature.xsd.
Lines 20 and 21 of this schema relate to the following:

 <element name="_geometryProperty" type="gml:GeometryPropertyType"
abstract="true"/>
 <element name="geometryProperty" type="gml:GeometryPropertyType"/>

Could you please help me in getting me wsdl2Java work in this case?

Thanks,
~pasquale

Re: Exception thrown by JAXB: Two declarations cause a collision in the ObjectFactory class.

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


That error just looks like the server where the schema is found was down.  

I just used a binding file of:
<jxb:bindings version="1.0"
  xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <jxb:bindings 
schemaLocation="http://schemas.opengis.net/gml/2.0.0/feature.xsd"
        node=".//xsd:element[@name='_geometryProperty']">
        <jxb:class name="UndGeomProperty"/>
    </jxb:bindings>
</jxb:bindings>

(note the xs -> xsd prefix change from yours)


and it seemed to work OK for me now.

Dan





On Thursday, March 22, 2012 04:41:37 PM Pasqualino Imbemba wrote:
> Ok,
> 
> not quite sure, could you help me to determine the problem?
> 
> 
> Running Apache CXF wsdl2java for [InterscambioSOAPBinding]
> directory: /home/pb26683/soapToolkit/apache-cxf-2.5.2/bin
> command: [sh, -c, ./wsdl2java.sh -b AllGISCustomBinding.xjb -d
> /home/pb26683/CodeGen/source -exsh false -dns true -dex true -verbose
> http://cooperazione.sian.it/wspdd/services/AllineamentoGIS?wsdl]
> Loading FrontEnd jaxws ...
> Loading DataBinding jaxb ...
> wsdl2java -b AllGISCustomBinding.xjb -d /home/pb26683/CodeGen/source -exsh
> false -dns true -dex true -verbose
> http://cooperazione.sian.it/wspdd/services/AllineamentoGIS?wsdl
> wsdl2java - Apache CXF 2.5.2
> 
> 
> WSDLToJava Error: org.apache.cxf.wsdl11.WSDLRuntimeException: Fail to
> create wsdl definition from :
> http://cooperazione.sian.it/wspdd/services/AllineamentoGIS?wsdl
> Caused by : WSDLException (at /definitions/types/xsd:schema[2]):
> faultCode=PARSER_ERROR: Problem parsing '
> http://schemas.opengis.net/gml/2.0.0/feature.xsd'.:
> java.net.ConnectException: Connection refused
> 
> org.apache.cxf.tools.common.ToolException:
> org.apache.cxf.wsdl11.WSDLRuntimeException: Fail to create wsdl definition
> from : http://cooperazione.sian.it/wspdd/services/AllineamentoGIS?wsdl
> Caused by : WSDLException (at /definitions/types/xsd:schema[2]):
> faultCode=PARSER_ERROR: Problem parsing '
> http://schemas.opengis.net/gml/2.0.0/feature.xsd'.:
> java.net.ConnectException: Connection refused
> at
> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContaine
> r.java:294) at
> org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:10
> 3) at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:113) at
> org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:86) at
> org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:184) Caused
> by: org.apache.cxf.wsdl11.WSDLRuntimeException: Fail to create wsdl
> definition from :
> http://cooperazione.sian.it/wspdd/services/AllineamentoGIS?wsdl
> Caused by : WSDLException (at /definitions/types/xsd:schema[2]):
> faultCode=PARSER_ERROR: Problem parsing '
> http://schemas.opengis.net/gml/2.0.0/feature.xsd'.:
> java.net.ConnectException: Connection refused
> at
> org.apache.cxf.wsdl11.WSDLDefinitionBuilder.parseWSDL(WSDLDefinitionBuilde
> r.java:97) at
> org.apache.cxf.wsdl11.WSDLDefinitionBuilder.build(WSDLDefinitionBuilder.ja
> va:69) at
> org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.b
> uild(JAXWSDefinitionBuilder.java:84) at
> org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.b
> uild(JAXWSDefinitionBuilder.java:61) at
> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaCont
> ainer.java:171) at
> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContaine
> r.java:138) at
> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContaine
> r.java:286) ... 4 more
> Caused by: javax.wsdl.WSDLException: WSDLException (at
> /definitions/types/xsd:schema[2]): faultCode=PARSER_ERROR: Problem parsing
> ' http://schemas.opengis.net/gml/2.0.0/feature.xsd'.:
> java.net.ConnectException: Connection refused
> at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source)
> at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
> at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
> at com.ibm.wsdl.xml.WSDLReaderImpl.parseTypes(Unknown Source)
> at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source)
> at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
> at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
> at
> org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:
> 242) at
> org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:1
> 91) at
> org.apache.cxf.wsdl11.WSDLDefinitionBuilder.parseWSDL(WSDLDefinitionBuilde
> r.java:78) ... 10 more
> Caused by: java.net.ConnectException: Connection refused
> at java.net.PlainSocketImpl.socketConnect(Native Method)
> at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
> at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
> at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
> at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
> at java.net.Socket.connect(Socket.java:529)
> at java.net.Socket.connect(Socket.java:478)
> at sun.net.NetworkClient.doConnect(NetworkClient.java:163)
> at sun.net.www.http.HttpClient.openServer(HttpClient.java:394)
> at sun.net.www.http.HttpClient.openServer(HttpClient.java:529)
> at sun.net.www.http.HttpClient.<init>(HttpClient.java:233)
> at sun.net.www.http.HttpClient.New(HttpClient.java:306)
> at sun.net.www.http.HttpClient.New(HttpClient.java:323)
> at
> sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnec
> tion.java:975) at
> sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection
> .java:916) at
> sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java
> :841) at
> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnecti
> on.java:1177) at
> com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntit
> y(XMLEntityManager.java:677) at
> com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVer
> sion(XMLVersionDetector.java:186) at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11C
> onfiguration.java:772) at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11C
> onfiguration.java:737) at
> com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:
> 119) at
> com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:
> 235) at
> com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Document
> BuilderImpl.java:284) ... 20 more
> 
> 
> The WSDL (http://cooperazione.sian.it/wspdd/services/AllineamentoGIS?wsdl)
> I'm trying to run against refers to this xsd (
> http://schemas.opengis.net/gml/2.0.0/feature.xsd). I can open both with
> the browser, no problem. I can generate other WSDLs with no problem.
> 
> 
> Thanks
> ~pasquale
> 
> p.s.: this is my custom mapping:
> <!-- see
> http://docs.oracle.com/cd/E17802_01/webservices/webservices/docs/2.0/tutor
> ial/doc/JAXBUsing4.html--
> 
> <jxb:bindings version="1.0"
>   xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
>   xmlns:xs="http://www.w3.org/2001/XMLSchema">
> <jxb:bindings schemaLocation="
> http://schemas.opengis.net/gml/2.0.0/feature.xsd"
> node=".//xsd:element[@name='_geometryProperty']">
> <jxb:class name="UndGeomProperty"/>
> </jxb:bindings>
> </jxb:bindings>
> 
> On 22 March 2012 14:55, Adrien DAO-LENA <ad...@gmail.com> wrote:
> > Hi,
> > I think the xpath query is not specific enough.
> > If you use eclipse, open the xpath view and edit your xpath query there.
> > 
> > Regards,
> > Adrien.
> > 
> > 2012/3/22 Pasqualino Imbemba <p....@gmail.com>
> > 
> > > Hi,
> > > 
> > > what's wrong with this binding file, can you help me check this?
> > > 
> > > <jxb:bindings version="1.0"
> > > 
> > >  xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
> > >  xmlns:xs="http://www.w3.org/2001/XMLSchema">
> > > 
> > > <jxb:bindings schemaLocation="
> > > http://schemas.opengis.net/gml/2.0.0/feature.xsd"
> > > node=".//xsd:element[@name='geometryProperty']">
> > > <jxb:class name="NoUndGeomProperty"/>
> > > </jxb:bindings>
> > > </jxb:bindings>
> > > 
> > > 
> > > What I want to happen: the element geometryProperty of
> > > http://schemas.opengis.net/gml/2.0.0/feature.xsd shall be bound to
> > > NoUndGeomProperty when I run CXF against this WSDL (
> > > http://cooperazione.sian.it/wspdd/services/AllineamentoGIS?wsdl) The
> > 
> > WSDL
> > 
> > > imports the opengis namespace.
> > > 
> > > Thank you
> > > ~pasquale
> > > 
> > > On 20 March 2012 13:42, Pasqualino Imbemba <p....@gmail.com> 
wrote:
> > > > Thanks,
> > > > 
> > > > I will try to define a custom binding - the .xsd is not under my
> > 
> > control
> > 
> > > > unfortunately.
> > > > 
> > > > I was thinking tweaking with it, i.e. modify the .xsd and the WSDL
> > > > accordingly to refer to the modified one, but I'm not sure for the
> > > > consequences.
> > > > 
> > > > I was ignoring that _SomeName and SomeName are the same ... uhm...
> > > > 
> > > > Thanks
> > > > ~pasquale
> > > > 
> > > > On 20 March 2012 12:29, Mark Streit <mc...@gmail.com> wrote:
> > > >> Also - Most of the code generation I have seen, both with wsimport
> > > >> (JDK6/Metro) and wsdl2Java (CXF), will not preserve the underscore
> > > >> character like you have in your classes.  I have seen WSDL/XSD
> > > >> files
> > > 
> > > that
> > > 
> > > >> contain things like this -  *some_class_Name* - which results in a
> > > >> collision because it tries to generate classes and ObjectFactory
> > 
> > classes
> > 
> > > >> that use the name *SomeClassName*. This was the result of WSDL that
> > 
> > was
> > 
> > > >> generated by some 3rd party .NET tool and it was messy.
> > > >> 
> > > >> If you have control of this (you own the XSD types), perhaps
> > > >> changing
> > > 
> > > the
> > > 
> > > >> name of the element (the one that starts with the underscore
> > > >> character
> > > >> "_'"
> > > >> ) would resolve the issue - otherwise, the suggested custom binding
> > > >> approach may be your only choice.
> > > >> 
> > > >> On Tue, Mar 20, 2012 at 7:12 AM, Adrien DAO-LENA
> > > >> 
> > > >> <ad...@gmail.com>wrote:
> > > >> > Hi,
> > > >> > These elements share the same name, and the same namespace, so
> > > >> > there
> > > 
> > > is
> > > 
> > > >> a
> > > >> 
> > > >> > conflict, you should have a look at this:
> > http://docs.oracle.com/cd/E17802_01/webservices/webservices/docs/2.0/tut
> > orial/doc/JAXBUsing4.html> 
> > > >> > here a quick sample:
> > > >> > <jaxb:bindings schemaLocation="myFile.xsd">
> > > >> > <jaxb:bindings node="//xsd:element[@name='XpathOfYourNode']">
> > > >> > <jaxb:class name="XpathOfYourNodeWithANewName" />
> > > >> > </jaxb:bindings>
> > > >> > </jaxb:bindings>
> > > >> > Adrien.
> > > >> > 
> > > >> > 2012/3/20 Pasqualino Imbemba <p....@gmail.com>
> > > >> > 
> > > >> > > Hello,
> > > >> > > 
> > > >> > > I'm using CXF 2.5.2.
> > > >> > > When I try to run wsdl2Java against this WSDL (
> > > >> > > http://cooperazione.sian.it/wspdd/services/AllineamentoGIS?wsdl
> > > >> > > )
> > 
> > I
> > 
> > > >> get
> > > >> 
> > > >> > > this
> > > >> > > following error:
> > > >> > > WSDLToJava Error: Thrown by JAXB:
> > > >> > > Thrown by JAXB:
> > > >> > > Two declarations cause a collision in the ObjectFactory class.
> > > >> > > 
> > > >> > >  at line 21 column 3 of schema
> > > >> > > 
> > > >> > > file:/tmp/tempdir769259763399432743.tmp/feature.xsd
> > > >> > > 
> > > >> > > (Related to above error) This is the other declaration.
> > > >> > > 
> > > >> > >  at line 20 column 3 of schema
> > > >> > > 
> > > >> > > file:/tmp/tempdir769259763399432743.tmp/feature.xsd
> > > >> > > 
> > > >> > > org.apache.cxf.tools.common.ToolException: Thrown by JAXB:
> > > >> > > Thrown by JAXB:
> > > >> > > Two declarations cause a collision in the ObjectFactory class.
> > > >> > > 
> > > >> > >  at line 21 column 3 of schema
> > > >> > > 
> > > >> > > file:/tmp/tempdir769259763399432743.tmp/feature.xsd
> > > >> > > 
> > > >> > > (Related to above error) This is the other declaration.
> > > >> > > 
> > > >> > >  at line 20 column 3 of schema
> > > >> > > 
> > > >> > > file:/tmp/tempdir769259763399432743.tmp/feature.xsd
> > > >> > > 
> > > >> > > (...)
> > > >> > > 
> > > >> > > Caused by: com.sun.istack.SAXParseException2: Two declarations
> > > 
> > > cause a
> > > 
> > > >> > > collision in the ObjectFactory class.
> > > >> > > 
> > > >> > > The above WSDL refers to
> > > >> > 
> > > >> > http://schemas.opengis.net/gml/2.0.0/feature.xsd.
> > > >> > 
> > > >> > > Lines 20 and 21 of this schema relate to the following:
> > > >> > >  <element name="_geometryProperty"
> > > >> > >  type="gml:GeometryPropertyType"
> > > >> > > 
> > > >> > > abstract="true"/>
> > > >> > > 
> > > >> > >  <element name="geometryProperty"
> > 
> > type="gml:GeometryPropertyType"/>
> > 
> > > >> > > Could you please help me in getting me wsdl2Java work in this
> > 
> > case?
> > 
> > > >> > > Thanks,
> > > >> > > ~pasquale
> > > >> 
> > > >> *
> > > >> *
-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


Re: Exception thrown by JAXB: Two declarations cause a collision in the ObjectFactory class.

Posted by Pasqualino Imbemba <p....@gmail.com>.
Ok,

not quite sure, could you help me to determine the problem?


Running Apache CXF wsdl2java for [InterscambioSOAPBinding]
directory: /home/pb26683/soapToolkit/apache-cxf-2.5.2/bin
command: [sh, -c, ./wsdl2java.sh -b AllGISCustomBinding.xjb -d
/home/pb26683/CodeGen/source -exsh false -dns true -dex true -verbose
http://cooperazione.sian.it/wspdd/services/AllineamentoGIS?wsdl]
Loading FrontEnd jaxws ...
Loading DataBinding jaxb ...
wsdl2java -b AllGISCustomBinding.xjb -d /home/pb26683/CodeGen/source -exsh
false -dns true -dex true -verbose
http://cooperazione.sian.it/wspdd/services/AllineamentoGIS?wsdl
wsdl2java - Apache CXF 2.5.2


WSDLToJava Error: org.apache.cxf.wsdl11.WSDLRuntimeException: Fail to
create wsdl definition from :
http://cooperazione.sian.it/wspdd/services/AllineamentoGIS?wsdl
Caused by : WSDLException (at /definitions/types/xsd:schema[2]):
faultCode=PARSER_ERROR: Problem parsing '
http://schemas.opengis.net/gml/2.0.0/feature.xsd'.:
java.net.ConnectException: Connection refused

org.apache.cxf.tools.common.ToolException:
org.apache.cxf.wsdl11.WSDLRuntimeException: Fail to create wsdl definition
from : http://cooperazione.sian.it/wspdd/services/AllineamentoGIS?wsdl
Caused by : WSDLException (at /definitions/types/xsd:schema[2]):
faultCode=PARSER_ERROR: Problem parsing '
http://schemas.opengis.net/gml/2.0.0/feature.xsd'.:
java.net.ConnectException: Connection refused
at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:294)
at
org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:103)
at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:113)
at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:86)
at org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:184)
Caused by: org.apache.cxf.wsdl11.WSDLRuntimeException: Fail to create wsdl
definition from :
http://cooperazione.sian.it/wspdd/services/AllineamentoGIS?wsdl
Caused by : WSDLException (at /definitions/types/xsd:schema[2]):
faultCode=PARSER_ERROR: Problem parsing '
http://schemas.opengis.net/gml/2.0.0/feature.xsd'.:
java.net.ConnectException: Connection refused
at
org.apache.cxf.wsdl11.WSDLDefinitionBuilder.parseWSDL(WSDLDefinitionBuilder.java:97)
at
org.apache.cxf.wsdl11.WSDLDefinitionBuilder.build(WSDLDefinitionBuilder.java:69)
at
org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.build(JAXWSDefinitionBuilder.java:84)
at
org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.build(JAXWSDefinitionBuilder.java:61)
at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaContainer.java:171)
at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:138)
at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:286)
... 4 more
Caused by: javax.wsdl.WSDLException: WSDLException (at
/definitions/types/xsd:schema[2]): faultCode=PARSER_ERROR: Problem parsing '
http://schemas.opengis.net/gml/2.0.0/feature.xsd'.:
java.net.ConnectException: Connection refused
at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.parseTypes(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
at
org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:242)
at
org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:191)
at
org.apache.cxf.wsdl11.WSDLDefinitionBuilder.parseWSDL(WSDLDefinitionBuilder.java:78)
... 10 more
Caused by: java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at java.net.Socket.connect(Socket.java:478)
at sun.net.NetworkClient.doConnect(NetworkClient.java:163)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:394)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:529)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:233)
at sun.net.www.http.HttpClient.New(HttpClient.java:306)
at sun.net.www.http.HttpClient.New(HttpClient.java:323)
at
sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:975)
at
sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:916)
at
sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:841)
at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1177)
at
com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:677)
at
com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:186)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:772)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
at
com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:235)
at
com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)
... 20 more


The WSDL (http://cooperazione.sian.it/wspdd/services/AllineamentoGIS?wsdl) I'm
trying to run against refers to this xsd (
http://schemas.opengis.net/gml/2.0.0/feature.xsd). I can open both with the
browser, no problem. I can generate other WSDLs with no problem.


Thanks
~pasquale

p.s.: this is my custom mapping:
<!-- see
http://docs.oracle.com/cd/E17802_01/webservices/webservices/docs/2.0/tutorial/doc/JAXBUsing4.html--
>
<jxb:bindings version="1.0"
  xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
  xmlns:xs="http://www.w3.org/2001/XMLSchema">
<jxb:bindings schemaLocation="
http://schemas.opengis.net/gml/2.0.0/feature.xsd"
node=".//xsd:element[@name='_geometryProperty']">
<jxb:class name="UndGeomProperty"/>
</jxb:bindings>
</jxb:bindings>


On 22 March 2012 14:55, Adrien DAO-LENA <ad...@gmail.com> wrote:

> Hi,
> I think the xpath query is not specific enough.
> If you use eclipse, open the xpath view and edit your xpath query there.
>
> Regards,
> Adrien.
>
> 2012/3/22 Pasqualino Imbemba <p....@gmail.com>
>
> > Hi,
> >
> > what's wrong with this binding file, can you help me check this?
> >
> > <jxb:bindings version="1.0"
> >  xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
> >  xmlns:xs="http://www.w3.org/2001/XMLSchema">
> > <jxb:bindings schemaLocation="
> > http://schemas.opengis.net/gml/2.0.0/feature.xsd"
> > node=".//xsd:element[@name='geometryProperty']">
> > <jxb:class name="NoUndGeomProperty"/>
> > </jxb:bindings>
> > </jxb:bindings>
> >
> >
> > What I want to happen: the element geometryProperty of
> > http://schemas.opengis.net/gml/2.0.0/feature.xsd shall be bound to
> > NoUndGeomProperty when I run CXF against this WSDL (
> > http://cooperazione.sian.it/wspdd/services/AllineamentoGIS?wsdl) The
> WSDL
> > imports the opengis namespace.
> >
> > Thank you
> > ~pasquale
> >
> > On 20 March 2012 13:42, Pasqualino Imbemba <p....@gmail.com> wrote:
> >
> > > Thanks,
> > >
> > > I will try to define a custom binding - the .xsd is not under my
> control
> > > unfortunately.
> > >
> > > I was thinking tweaking with it, i.e. modify the .xsd and the WSDL
> > > accordingly to refer to the modified one, but I'm not sure for the
> > > consequences.
> > >
> > > I was ignoring that _SomeName and SomeName are the same ... uhm...
> > >
> > > Thanks
> > > ~pasquale
> > >
> > >
> > > On 20 March 2012 12:29, Mark Streit <mc...@gmail.com> wrote:
> > >
> > >> Also - Most of the code generation I have seen, both with wsimport
> > >> (JDK6/Metro) and wsdl2Java (CXF), will not preserve the underscore
> > >> character like you have in your classes.  I have seen WSDL/XSD files
> > that
> > >> contain things like this -  *some_class_Name* - which results in a
> > >> collision because it tries to generate classes and ObjectFactory
> classes
> > >> that use the name *SomeClassName*. This was the result of WSDL that
> was
> > >> generated by some 3rd party .NET tool and it was messy.
> > >>
> > >> If you have control of this (you own the XSD types), perhaps changing
> > the
> > >> name of the element (the one that starts with the underscore character
> > >> "_'"
> > >> ) would resolve the issue - otherwise, the suggested custom binding
> > >> approach may be your only choice.
> > >>
> > >> On Tue, Mar 20, 2012 at 7:12 AM, Adrien DAO-LENA
> > >> <ad...@gmail.com>wrote:
> > >>
> > >> > Hi,
> > >> > These elements share the same name, and the same namespace, so there
> > is
> > >> a
> > >> > conflict, you should have a look at this:
> > >> >
> > >> >
> > >> >
> > >>
> >
> http://docs.oracle.com/cd/E17802_01/webservices/webservices/docs/2.0/tutorial/doc/JAXBUsing4.html
> > >> >
> > >> > here a quick sample:
> > >> > <jaxb:bindings schemaLocation="myFile.xsd">
> > >> > <jaxb:bindings node="//xsd:element[@name='XpathOfYourNode']">
> > >> > <jaxb:class name="XpathOfYourNodeWithANewName" />
> > >> > </jaxb:bindings>
> > >> > </jaxb:bindings>
> > >> > Adrien.
> > >> >
> > >> > 2012/3/20 Pasqualino Imbemba <p....@gmail.com>
> > >> >
> > >> > > Hello,
> > >> > >
> > >> > > I'm using CXF 2.5.2.
> > >> > > When I try to run wsdl2Java against this WSDL (
> > >> > > http://cooperazione.sian.it/wspdd/services/AllineamentoGIS?wsdl)
> I
> > >> get
> > >> > > this
> > >> > > following error:
> > >> > > WSDLToJava Error: Thrown by JAXB:
> > >> > > Thrown by JAXB:
> > >> > > Two declarations cause a collision in the ObjectFactory class.
> > >> > >  at line 21 column 3 of schema
> > >> > > file:/tmp/tempdir769259763399432743.tmp/feature.xsd
> > >> > >
> > >> > > (Related to above error) This is the other declaration.
> > >> > >  at line 20 column 3 of schema
> > >> > > file:/tmp/tempdir769259763399432743.tmp/feature.xsd
> > >> > >
> > >> > > org.apache.cxf.tools.common.ToolException: Thrown by JAXB:
> > >> > > Thrown by JAXB:
> > >> > > Two declarations cause a collision in the ObjectFactory class.
> > >> > >  at line 21 column 3 of schema
> > >> > > file:/tmp/tempdir769259763399432743.tmp/feature.xsd
> > >> > >
> > >> > > (Related to above error) This is the other declaration.
> > >> > >  at line 20 column 3 of schema
> > >> > > file:/tmp/tempdir769259763399432743.tmp/feature.xsd
> > >> > >
> > >> > > (...)
> > >> > >
> > >> > > Caused by: com.sun.istack.SAXParseException2: Two declarations
> > cause a
> > >> > > collision in the ObjectFactory class.
> > >> > >
> > >> > > The above WSDL refers to
> > >> > http://schemas.opengis.net/gml/2.0.0/feature.xsd.
> > >> > > Lines 20 and 21 of this schema relate to the following:
> > >> > >
> > >> > >  <element name="_geometryProperty" type="gml:GeometryPropertyType"
> > >> > > abstract="true"/>
> > >> > >  <element name="geometryProperty"
> type="gml:GeometryPropertyType"/>
> > >> > >
> > >> > > Could you please help me in getting me wsdl2Java work in this
> case?
> > >> > >
> > >> > > Thanks,
> > >> > > ~pasquale
> > >> > >
> > >> >
> > >>
> > >>
> > >>
> > >> *
> > >> *
> > >>
> > >
> > >
> >
>

Re: Exception thrown by JAXB: Two declarations cause a collision in the ObjectFactory class.

Posted by Adrien DAO-LENA <ad...@gmail.com>.
Hi,
I think the xpath query is not specific enough.
If you use eclipse, open the xpath view and edit your xpath query there.

Regards,
Adrien.

2012/3/22 Pasqualino Imbemba <p....@gmail.com>

> Hi,
>
> what's wrong with this binding file, can you help me check this?
>
> <jxb:bindings version="1.0"
>  xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
>  xmlns:xs="http://www.w3.org/2001/XMLSchema">
> <jxb:bindings schemaLocation="
> http://schemas.opengis.net/gml/2.0.0/feature.xsd"
> node=".//xsd:element[@name='geometryProperty']">
> <jxb:class name="NoUndGeomProperty"/>
> </jxb:bindings>
> </jxb:bindings>
>
>
> What I want to happen: the element geometryProperty of
> http://schemas.opengis.net/gml/2.0.0/feature.xsd shall be bound to
> NoUndGeomProperty when I run CXF against this WSDL (
> http://cooperazione.sian.it/wspdd/services/AllineamentoGIS?wsdl) The WSDL
> imports the opengis namespace.
>
> Thank you
> ~pasquale
>
> On 20 March 2012 13:42, Pasqualino Imbemba <p....@gmail.com> wrote:
>
> > Thanks,
> >
> > I will try to define a custom binding - the .xsd is not under my control
> > unfortunately.
> >
> > I was thinking tweaking with it, i.e. modify the .xsd and the WSDL
> > accordingly to refer to the modified one, but I'm not sure for the
> > consequences.
> >
> > I was ignoring that _SomeName and SomeName are the same ... uhm...
> >
> > Thanks
> > ~pasquale
> >
> >
> > On 20 March 2012 12:29, Mark Streit <mc...@gmail.com> wrote:
> >
> >> Also - Most of the code generation I have seen, both with wsimport
> >> (JDK6/Metro) and wsdl2Java (CXF), will not preserve the underscore
> >> character like you have in your classes.  I have seen WSDL/XSD files
> that
> >> contain things like this -  *some_class_Name* - which results in a
> >> collision because it tries to generate classes and ObjectFactory classes
> >> that use the name *SomeClassName*. This was the result of WSDL that was
> >> generated by some 3rd party .NET tool and it was messy.
> >>
> >> If you have control of this (you own the XSD types), perhaps changing
> the
> >> name of the element (the one that starts with the underscore character
> >> "_'"
> >> ) would resolve the issue - otherwise, the suggested custom binding
> >> approach may be your only choice.
> >>
> >> On Tue, Mar 20, 2012 at 7:12 AM, Adrien DAO-LENA
> >> <ad...@gmail.com>wrote:
> >>
> >> > Hi,
> >> > These elements share the same name, and the same namespace, so there
> is
> >> a
> >> > conflict, you should have a look at this:
> >> >
> >> >
> >> >
> >>
> http://docs.oracle.com/cd/E17802_01/webservices/webservices/docs/2.0/tutorial/doc/JAXBUsing4.html
> >> >
> >> > here a quick sample:
> >> > <jaxb:bindings schemaLocation="myFile.xsd">
> >> > <jaxb:bindings node="//xsd:element[@name='XpathOfYourNode']">
> >> > <jaxb:class name="XpathOfYourNodeWithANewName" />
> >> > </jaxb:bindings>
> >> > </jaxb:bindings>
> >> > Adrien.
> >> >
> >> > 2012/3/20 Pasqualino Imbemba <p....@gmail.com>
> >> >
> >> > > Hello,
> >> > >
> >> > > I'm using CXF 2.5.2.
> >> > > When I try to run wsdl2Java against this WSDL (
> >> > > http://cooperazione.sian.it/wspdd/services/AllineamentoGIS?wsdl) I
> >> get
> >> > > this
> >> > > following error:
> >> > > WSDLToJava Error: Thrown by JAXB:
> >> > > Thrown by JAXB:
> >> > > Two declarations cause a collision in the ObjectFactory class.
> >> > >  at line 21 column 3 of schema
> >> > > file:/tmp/tempdir769259763399432743.tmp/feature.xsd
> >> > >
> >> > > (Related to above error) This is the other declaration.
> >> > >  at line 20 column 3 of schema
> >> > > file:/tmp/tempdir769259763399432743.tmp/feature.xsd
> >> > >
> >> > > org.apache.cxf.tools.common.ToolException: Thrown by JAXB:
> >> > > Thrown by JAXB:
> >> > > Two declarations cause a collision in the ObjectFactory class.
> >> > >  at line 21 column 3 of schema
> >> > > file:/tmp/tempdir769259763399432743.tmp/feature.xsd
> >> > >
> >> > > (Related to above error) This is the other declaration.
> >> > >  at line 20 column 3 of schema
> >> > > file:/tmp/tempdir769259763399432743.tmp/feature.xsd
> >> > >
> >> > > (...)
> >> > >
> >> > > Caused by: com.sun.istack.SAXParseException2: Two declarations
> cause a
> >> > > collision in the ObjectFactory class.
> >> > >
> >> > > The above WSDL refers to
> >> > http://schemas.opengis.net/gml/2.0.0/feature.xsd.
> >> > > Lines 20 and 21 of this schema relate to the following:
> >> > >
> >> > >  <element name="_geometryProperty" type="gml:GeometryPropertyType"
> >> > > abstract="true"/>
> >> > >  <element name="geometryProperty" type="gml:GeometryPropertyType"/>
> >> > >
> >> > > Could you please help me in getting me wsdl2Java work in this case?
> >> > >
> >> > > Thanks,
> >> > > ~pasquale
> >> > >
> >> >
> >>
> >>
> >>
> >> *
> >> *
> >>
> >
> >
>

Re: Exception thrown by JAXB: Two declarations cause a collision in the ObjectFactory class.

Posted by Pasqualino Imbemba <p....@gmail.com>.
Hi,

what's wrong with this binding file, can you help me check this?

<jxb:bindings version="1.0"
  xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
  xmlns:xs="http://www.w3.org/2001/XMLSchema">
<jxb:bindings schemaLocation="
http://schemas.opengis.net/gml/2.0.0/feature.xsd"
node=".//xsd:element[@name='geometryProperty']">
<jxb:class name="NoUndGeomProperty"/>
</jxb:bindings>
</jxb:bindings>


What I want to happen: the element geometryProperty of
http://schemas.opengis.net/gml/2.0.0/feature.xsd shall be bound to
NoUndGeomProperty when I run CXF against this WSDL (
http://cooperazione.sian.it/wspdd/services/AllineamentoGIS?wsdl) The WSDL
imports the opengis namespace.

Thank you
~pasquale

On 20 March 2012 13:42, Pasqualino Imbemba <p....@gmail.com> wrote:

> Thanks,
>
> I will try to define a custom binding - the .xsd is not under my control
> unfortunately.
>
> I was thinking tweaking with it, i.e. modify the .xsd and the WSDL
> accordingly to refer to the modified one, but I'm not sure for the
> consequences.
>
> I was ignoring that _SomeName and SomeName are the same ... uhm...
>
> Thanks
> ~pasquale
>
>
> On 20 March 2012 12:29, Mark Streit <mc...@gmail.com> wrote:
>
>> Also - Most of the code generation I have seen, both with wsimport
>> (JDK6/Metro) and wsdl2Java (CXF), will not preserve the underscore
>> character like you have in your classes.  I have seen WSDL/XSD files that
>> contain things like this -  *some_class_Name* - which results in a
>> collision because it tries to generate classes and ObjectFactory classes
>> that use the name *SomeClassName*. This was the result of WSDL that was
>> generated by some 3rd party .NET tool and it was messy.
>>
>> If you have control of this (you own the XSD types), perhaps changing the
>> name of the element (the one that starts with the underscore character
>> "_'"
>> ) would resolve the issue - otherwise, the suggested custom binding
>> approach may be your only choice.
>>
>> On Tue, Mar 20, 2012 at 7:12 AM, Adrien DAO-LENA
>> <ad...@gmail.com>wrote:
>>
>> > Hi,
>> > These elements share the same name, and the same namespace, so there is
>> a
>> > conflict, you should have a look at this:
>> >
>> >
>> >
>> http://docs.oracle.com/cd/E17802_01/webservices/webservices/docs/2.0/tutorial/doc/JAXBUsing4.html
>> >
>> > here a quick sample:
>> > <jaxb:bindings schemaLocation="myFile.xsd">
>> > <jaxb:bindings node="//xsd:element[@name='XpathOfYourNode']">
>> > <jaxb:class name="XpathOfYourNodeWithANewName" />
>> > </jaxb:bindings>
>> > </jaxb:bindings>
>> > Adrien.
>> >
>> > 2012/3/20 Pasqualino Imbemba <p....@gmail.com>
>> >
>> > > Hello,
>> > >
>> > > I'm using CXF 2.5.2.
>> > > When I try to run wsdl2Java against this WSDL (
>> > > http://cooperazione.sian.it/wspdd/services/AllineamentoGIS?wsdl) I
>> get
>> > > this
>> > > following error:
>> > > WSDLToJava Error: Thrown by JAXB:
>> > > Thrown by JAXB:
>> > > Two declarations cause a collision in the ObjectFactory class.
>> > >  at line 21 column 3 of schema
>> > > file:/tmp/tempdir769259763399432743.tmp/feature.xsd
>> > >
>> > > (Related to above error) This is the other declaration.
>> > >  at line 20 column 3 of schema
>> > > file:/tmp/tempdir769259763399432743.tmp/feature.xsd
>> > >
>> > > org.apache.cxf.tools.common.ToolException: Thrown by JAXB:
>> > > Thrown by JAXB:
>> > > Two declarations cause a collision in the ObjectFactory class.
>> > >  at line 21 column 3 of schema
>> > > file:/tmp/tempdir769259763399432743.tmp/feature.xsd
>> > >
>> > > (Related to above error) This is the other declaration.
>> > >  at line 20 column 3 of schema
>> > > file:/tmp/tempdir769259763399432743.tmp/feature.xsd
>> > >
>> > > (...)
>> > >
>> > > Caused by: com.sun.istack.SAXParseException2: Two declarations cause a
>> > > collision in the ObjectFactory class.
>> > >
>> > > The above WSDL refers to
>> > http://schemas.opengis.net/gml/2.0.0/feature.xsd.
>> > > Lines 20 and 21 of this schema relate to the following:
>> > >
>> > >  <element name="_geometryProperty" type="gml:GeometryPropertyType"
>> > > abstract="true"/>
>> > >  <element name="geometryProperty" type="gml:GeometryPropertyType"/>
>> > >
>> > > Could you please help me in getting me wsdl2Java work in this case?
>> > >
>> > > Thanks,
>> > > ~pasquale
>> > >
>> >
>>
>>
>>
>> *
>> *
>>
>
>

Re: Exception thrown by JAXB: Two declarations cause a collision in the ObjectFactory class.

Posted by Pasqualino Imbemba <p....@gmail.com>.
Thanks,

I will try to define a custom binding - the .xsd is not under my control
unfortunately.

I was thinking tweaking with it, i.e. modify the .xsd and the WSDL
accordingly to refer to the modified one, but I'm not sure for the
consequences.

I was ignoring that _SomeName and SomeName are the same ... uhm...

Thanks
~pasquale

On 20 March 2012 12:29, Mark Streit <mc...@gmail.com> wrote:

> Also - Most of the code generation I have seen, both with wsimport
> (JDK6/Metro) and wsdl2Java (CXF), will not preserve the underscore
> character like you have in your classes.  I have seen WSDL/XSD files that
> contain things like this -  *some_class_Name* - which results in a
> collision because it tries to generate classes and ObjectFactory classes
> that use the name *SomeClassName*. This was the result of WSDL that was
> generated by some 3rd party .NET tool and it was messy.
>
> If you have control of this (you own the XSD types), perhaps changing the
> name of the element (the one that starts with the underscore character "_'"
> ) would resolve the issue - otherwise, the suggested custom binding
> approach may be your only choice.
>
> On Tue, Mar 20, 2012 at 7:12 AM, Adrien DAO-LENA
> <ad...@gmail.com>wrote:
>
> > Hi,
> > These elements share the same name, and the same namespace, so there is a
> > conflict, you should have a look at this:
> >
> >
> >
> http://docs.oracle.com/cd/E17802_01/webservices/webservices/docs/2.0/tutorial/doc/JAXBUsing4.html
> >
> > here a quick sample:
> > <jaxb:bindings schemaLocation="myFile.xsd">
> > <jaxb:bindings node="//xsd:element[@name='XpathOfYourNode']">
> > <jaxb:class name="XpathOfYourNodeWithANewName" />
> > </jaxb:bindings>
> > </jaxb:bindings>
> > Adrien.
> >
> > 2012/3/20 Pasqualino Imbemba <p....@gmail.com>
> >
> > > Hello,
> > >
> > > I'm using CXF 2.5.2.
> > > When I try to run wsdl2Java against this WSDL (
> > > http://cooperazione.sian.it/wspdd/services/AllineamentoGIS?wsdl) I get
> > > this
> > > following error:
> > > WSDLToJava Error: Thrown by JAXB:
> > > Thrown by JAXB:
> > > Two declarations cause a collision in the ObjectFactory class.
> > >  at line 21 column 3 of schema
> > > file:/tmp/tempdir769259763399432743.tmp/feature.xsd
> > >
> > > (Related to above error) This is the other declaration.
> > >  at line 20 column 3 of schema
> > > file:/tmp/tempdir769259763399432743.tmp/feature.xsd
> > >
> > > org.apache.cxf.tools.common.ToolException: Thrown by JAXB:
> > > Thrown by JAXB:
> > > Two declarations cause a collision in the ObjectFactory class.
> > >  at line 21 column 3 of schema
> > > file:/tmp/tempdir769259763399432743.tmp/feature.xsd
> > >
> > > (Related to above error) This is the other declaration.
> > >  at line 20 column 3 of schema
> > > file:/tmp/tempdir769259763399432743.tmp/feature.xsd
> > >
> > > (...)
> > >
> > > Caused by: com.sun.istack.SAXParseException2: Two declarations cause a
> > > collision in the ObjectFactory class.
> > >
> > > The above WSDL refers to
> > http://schemas.opengis.net/gml/2.0.0/feature.xsd.
> > > Lines 20 and 21 of this schema relate to the following:
> > >
> > >  <element name="_geometryProperty" type="gml:GeometryPropertyType"
> > > abstract="true"/>
> > >  <element name="geometryProperty" type="gml:GeometryPropertyType"/>
> > >
> > > Could you please help me in getting me wsdl2Java work in this case?
> > >
> > > Thanks,
> > > ~pasquale
> > >
> >
>
>
>
> *
> *
>

Re: Exception thrown by JAXB: Two declarations cause a collision in the ObjectFactory class.

Posted by Mark Streit <mc...@gmail.com>.
Also - Most of the code generation I have seen, both with wsimport
(JDK6/Metro) and wsdl2Java (CXF), will not preserve the underscore
character like you have in your classes.  I have seen WSDL/XSD files that
contain things like this -  *some_class_Name* - which results in a
collision because it tries to generate classes and ObjectFactory classes
that use the name *SomeClassName*. This was the result of WSDL that was
generated by some 3rd party .NET tool and it was messy.

If you have control of this (you own the XSD types), perhaps changing the
name of the element (the one that starts with the underscore character "_'"
) would resolve the issue - otherwise, the suggested custom binding
approach may be your only choice.

On Tue, Mar 20, 2012 at 7:12 AM, Adrien DAO-LENA
<ad...@gmail.com>wrote:

> Hi,
> These elements share the same name, and the same namespace, so there is a
> conflict, you should have a look at this:
>
>
> http://docs.oracle.com/cd/E17802_01/webservices/webservices/docs/2.0/tutorial/doc/JAXBUsing4.html
>
> here a quick sample:
> <jaxb:bindings schemaLocation="myFile.xsd">
> <jaxb:bindings node="//xsd:element[@name='XpathOfYourNode']">
> <jaxb:class name="XpathOfYourNodeWithANewName" />
> </jaxb:bindings>
> </jaxb:bindings>
> Adrien.
>
> 2012/3/20 Pasqualino Imbemba <p....@gmail.com>
>
> > Hello,
> >
> > I'm using CXF 2.5.2.
> > When I try to run wsdl2Java against this WSDL (
> > http://cooperazione.sian.it/wspdd/services/AllineamentoGIS?wsdl) I get
> > this
> > following error:
> > WSDLToJava Error: Thrown by JAXB:
> > Thrown by JAXB:
> > Two declarations cause a collision in the ObjectFactory class.
> >  at line 21 column 3 of schema
> > file:/tmp/tempdir769259763399432743.tmp/feature.xsd
> >
> > (Related to above error) This is the other declaration.
> >  at line 20 column 3 of schema
> > file:/tmp/tempdir769259763399432743.tmp/feature.xsd
> >
> > org.apache.cxf.tools.common.ToolException: Thrown by JAXB:
> > Thrown by JAXB:
> > Two declarations cause a collision in the ObjectFactory class.
> >  at line 21 column 3 of schema
> > file:/tmp/tempdir769259763399432743.tmp/feature.xsd
> >
> > (Related to above error) This is the other declaration.
> >  at line 20 column 3 of schema
> > file:/tmp/tempdir769259763399432743.tmp/feature.xsd
> >
> > (...)
> >
> > Caused by: com.sun.istack.SAXParseException2: Two declarations cause a
> > collision in the ObjectFactory class.
> >
> > The above WSDL refers to
> http://schemas.opengis.net/gml/2.0.0/feature.xsd.
> > Lines 20 and 21 of this schema relate to the following:
> >
> >  <element name="_geometryProperty" type="gml:GeometryPropertyType"
> > abstract="true"/>
> >  <element name="geometryProperty" type="gml:GeometryPropertyType"/>
> >
> > Could you please help me in getting me wsdl2Java work in this case?
> >
> > Thanks,
> > ~pasquale
> >
>



*
*

Re: Exception thrown by JAXB: Two declarations cause a collision in the ObjectFactory class.

Posted by Adrien DAO-LENA <ad...@gmail.com>.
Hi,
These elements share the same name, and the same namespace, so there is a
conflict, you should have a look at this:

http://docs.oracle.com/cd/E17802_01/webservices/webservices/docs/2.0/tutorial/doc/JAXBUsing4.html

here a quick sample:
<jaxb:bindings schemaLocation="myFile.xsd">
<jaxb:bindings node="//xsd:element[@name='XpathOfYourNode']">
<jaxb:class name="XpathOfYourNodeWithANewName" />
</jaxb:bindings>
</jaxb:bindings>
Adrien.

2012/3/20 Pasqualino Imbemba <p....@gmail.com>

> Hello,
>
> I'm using CXF 2.5.2.
> When I try to run wsdl2Java against this WSDL (
> http://cooperazione.sian.it/wspdd/services/AllineamentoGIS?wsdl) I get
> this
> following error:
> WSDLToJava Error: Thrown by JAXB:
> Thrown by JAXB:
> Two declarations cause a collision in the ObjectFactory class.
>  at line 21 column 3 of schema
> file:/tmp/tempdir769259763399432743.tmp/feature.xsd
>
> (Related to above error) This is the other declaration.
>  at line 20 column 3 of schema
> file:/tmp/tempdir769259763399432743.tmp/feature.xsd
>
> org.apache.cxf.tools.common.ToolException: Thrown by JAXB:
> Thrown by JAXB:
> Two declarations cause a collision in the ObjectFactory class.
>  at line 21 column 3 of schema
> file:/tmp/tempdir769259763399432743.tmp/feature.xsd
>
> (Related to above error) This is the other declaration.
>  at line 20 column 3 of schema
> file:/tmp/tempdir769259763399432743.tmp/feature.xsd
>
> (...)
>
> Caused by: com.sun.istack.SAXParseException2: Two declarations cause a
> collision in the ObjectFactory class.
>
> The above WSDL refers to http://schemas.opengis.net/gml/2.0.0/feature.xsd.
> Lines 20 and 21 of this schema relate to the following:
>
>  <element name="_geometryProperty" type="gml:GeometryPropertyType"
> abstract="true"/>
>  <element name="geometryProperty" type="gml:GeometryPropertyType"/>
>
> Could you please help me in getting me wsdl2Java work in this case?
>
> Thanks,
> ~pasquale
>