Apparently you are not unmarshalling using Java classes compiled from
the XML schema, and so the XML schema isn't so important. But you must
make sure that the namespaces from the XML and the ones defined in
your hand-coded Java classes agree. What is the package of your class
TestSetImpl? What does your ObjectFactory define for the testSet
element?
Notice that the XML parser doesn't find what it has been instructed to
look for; it's very likely to be a namespace disagreement.
-W
On Wed, May 5, 2010 at 2:09 PM, owais zahid <owais_zahid_at_hotmail.com> wrote:
> Hi people, i am getting the following exception on unmarshaling. Can anyone
> help me out .
>
> javax.xml.bind.UnmarshalException
> - with linked exception:
> [org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of
> element 'stf:testSet'.]
>
> -------------------------------------------------------------------
>
> Following is my xml
>
> <?xml version="1.0" encoding="UTF-8"?>
> <stf:testSet xmlns:stf="http://localhost/SystemTestFramework/TestSet"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>
> xsi:schemaLocation="http://localhost/SystemTestFramework/TestSet
>
> ../java/com/demo/systemtesting2/implementation/TestSet.xsd"
> abortOnFailure="false">
> <login id="test" password="test"/>
> <testSuites>
> <testSuite id="Basic Tests" category="AdvancedScheduler_AutoScheduler"
> abortOnFailure="true">
> <testCases>
> <testCase
> source="workforce/SystemTests/AdvancedScheduler_AutoScheduler_Test1.xml"/>
> </testCases>
> </testSuite>
> </testSuites>
> </stf:testSet>
>
> ---------------------------------------------------------------------
>
> Following is my xsd
>
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <xs:schema version="1.0"
> attributeFormDefault="unqualified"
> elementFormDefault="unqualified"
>
> targetNamespace="http://www.workforcesoftware.com/SystemTestFramework/TestSet"
>
> xmlns="http://www.workforcesoftware.com/SystemTestFramework/TestSet"
> xmlns:xs="http://www.w3.org/2001/XMLSchema">
>
> <xs:element name="testSet" type="TestSet"/>
>
> <xs:complexType name="TestSet">
> <xs:sequence>
> <xs:element name="login" type="LoginInfo" minOccurs="0"/>
> <xs:element name="testSuites" nillable="true" minOccurs="0">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="testSuite" type="TestSuite" minOccurs="0"
> maxOccurs="unbounded"/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:sequence>
> <xs:attribute name="abortOnFailure" type="xs:boolean"/>
> </xs:complexType>
> .........................
>
> --------------------------------------------------------------------
>
> Following is my class
>
> @SuppressWarnings({"ValidExternallyBoundObject"})
> @XmlRootElement(name = "testSet")
> @XmlType(name = "TestSet", propOrder = {"loginInfo", "testSuiteSet"})
> public class TestSetImpl extends AbstractTestSet {
>
> ............
>
> -------------------------------------------------------------------
>
> Please help
>
> -Owais
>
>
> ________________________________
> Hotmail: Free, trusted and rich email service. Get it now.