users@jaxb.java.net

Re: Marshalling problem

From: Wolfgang Laun <wolfgang.laun_at_gmail.com>
Date: Tue, 5 Apr 2011 14:56:06 +0200

Is Sample2.xsd the second schema you have added, incompletely?

What is the <xsd:schema> element of that second XSD?

-W

On 5 April 2011 13:41, Rey Guiller M. Lorenzo <shrewdrenz_at_yahoo.com> wrote:

> I'm having this error upon JBoss startup which suggest that the schema
> definition for a particular element does not exist in the generated wsdl in
> Jboss.
> It was detected that 'ProductName' is in namespace 'http:/
> sample2.com/sample2', but components from this namespace are not
> referenceable from schema document.
> Here are the sample xsd that I used to generate that jaxb artifacts to be
> used in Jboss deployment.
>
>
> Here is a snniplet of the main XSD used.
>
> <?xml version="1.0" encoding="utf-8"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http:/
> sample.com/mainXSD" xmlns:mm="http:/sample2.com/sample2"
> targetNamespace="http:/sample.com/mainXSD" elementFormDefault="qualified"
> attributeFormDefault="unqualified">
> <xs:import namespace="http:/sample2.com/sample2"
> schemaLocation="Sample2.xsd" />
>
> <xs:complexType>
> <xs:complexContent>
>
> <
> xs:extension base=*"someComplexType"*>
> <xs:sequence minOccurs=*"0"*>
> <xs:complexType>
> <xs:sequence>
> <xs:element ref="mm:LastThreeNumber" />
> <xs:element ref="mm:ProductName" />
> </xs:sequence>
> </xs:complexType>
>
>
> My main xsd references to another schema ex.
>
> <?xml version="1.0" encoding="utf-8"?>
> <xs:element name="LastThreeNumber">
> <xs:annotation>
> <xs:documentation>documentation.</xs:documentation>
> </xs:annotation>
> <xs:simpleType>
> <xs:restriction base="xs:string">
> <xs:pattern value="\d{3}"/>
> </xs:restriction>
> </xs:simpleType>
> </xs:element>
> <xs:element name="ProductName" type="xs:string">
> <xs:annotation>
> <xs:documentation>Product Name.</xs:documentation>
> </xs:annotation>
> </xs:element>
>
> When I checked the generated wsdl it indeed doest not contain schema
> definition for namespace "http:/sample2.com/sample2". Am I doing wrong or
> jaxb does not support marshalling of base types? If so what alternative I
> can do
>
>