users@jaxb.java.net

RE: Strange Exception on unmarshalling

From: KARR, DAVID (ATTSI) <"KARR,>
Date: Wed, 5 May 2010 09:54:50 -0700

It can't find your schema. You need to change your "schemaLocation"
value. Change "../java" to "file:../java". I'm not sure whether a
relative path will work, however. If the relative path doesn't work, you
could try an absolute path.

 

In situations like this, it's often handy to use a I/O monitor tool that
can watch file I/O operations to see if and where something is trying to
find your file. On Windows you can use SysInternals "ProcMon" (free).
Using that, you could watch for attempts to open a file named
"TestSet.xsd". The presence or absence of those calls could give you a
hint in situations like this.

 

From: owais zahid [mailto:owais_zahid_at_hotmail.com]
Sent: Wednesday, May 05, 2010 5:10 AM
To: users_at_jaxb.dev.java.net
Subject: Strange Exception on unmarshalling

 

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/Te
stSet"
 
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.
<https://signup.live.com/signup.aspx?id=60969>