This seems to be a bug in JAXB. Basicall, it's generating two schema documents. One is completely empty (no element or type defs or anything) and a second that defines the type, but imports the empty one. We can hack a workaround, but it definitely is a bug in jaxb.
Dan On Thursday 28 August 2008 11:43:59 am John Hite wrote: > https://issues.apache.org/jira/browse/CXF-1769 > > I included a wsdl and ant build that demonstrate the problem. > > John > -----Original Message----- > > It's at least one bug. It might be more. This is not a polite > diagnosis of whatever is going on. Could we have a JIRA? > > On Wed, Aug 27, 2008 at 4:31 PM, John Hite <[EMAIL PROTECTED]> wrote: > > Hi, > > > > I have a WSDL with a schema definition like this. > > > > > > > > <element name="rules-config-dropResponse"> > > > > <complexType> > > > > <sequence> > > > > <element name="output" type="xsd:string" minOccurs="0" maxOccurs="1" > > nillable="true" /> > > > > </sequence> > > > > </complexType> > > > > </element> > > > > </schema> > > > > > > > > I can generate java code from this with WSDLToJava, but the > > JaxWsServiceFactoryBean throws an exception when trying to create a > > client or a server. > > > > > > > > [javac] Compiling 6 source files to C:\lib > > > > [java] java2ws -wsdl -verbose -cp C:\ib -frontend jaxws -t > > urn:company-product -servicename AppSensor -portname AppSensorPortType -o > > AppSensorGenerated.wsdl -d C:\wsdl com.example.soap.arc.AppSensorPortType > > > > [java] java2ws - Apache CXF 2.1.2 > > > > [java] Aug 27, 2008 4:15:29 PM > > org.apache.cxf.service.factory.ReflectionServiceFactoryBean > > buildServiceFromClass > > > > [java] INFO: Creating Service > > {urn:company-product}AppSensorPortTypeService from class > > com.example.soap.arc.AppSensorPortType > > > > [java] Error: org.apache.ws.commons.schema.XmlSchemaException: Schema > > name conflict in collection. Namespace: urn:company-product > > > > [java] java.lang.RuntimeException: > > org.apache.ws.commons.schema.XmlSchemaException: Schema name conflict in > > collection. Namespace: urn:company-product > > > > > > > > > > > > I found that if I set the nillable attribute to false or remove it > > completely the exception goes away. Is this a bug or is this the correct > > behavior? > > > > > > > > I'm using CXF 2.1.2. > > > > > > > > Thanks, > > > > John -- Daniel Kulp [EMAIL PROTECTED] http://www.dankulp.com/blog
