tuscany-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ritika Maheshwari <riti...@us.ibm.com>
Subject java.lang.NullPointer exception when invoking XSDHelper.INSTANCE
Date Fri, 18 Aug 2006 18:26:11 GMT
Hi,
      here is my test client code

    //Create a DataGraph
                        //SDOUtil.createTypeHelper();
                        DataObjectUtil.initRuntime();
                        URL url = thisClass.getResource("/newEMF.xsd");
                        InputStream inputStream = url.openStream();
                        //HelperProviderImpl helperProvider = new 
HelperProviderImpl();
                        XSDHelper.INSTANCE.define(inputStream, 
url.toString());
                        inputStream.close();
                        DataGraphImpl datagraph = (DataGraphImpl)SDOUtil.
createDataGraph();
                       datagraph.createRootObject(
"http://www.ibm.com/websphere/fvt/ejbquery/emf","DataGraphRoot");

XSDHelper.INSTANCE invocation gives the following stack trace
Caused by: java.lang.NullPointerException
        at commonj.sdo.impl.HelperProvider.getXSDHelper(
HelperProvider.java:343)
        at commonj.sdo.helper.XSDHelper.<clinit>(XSDHelper.java:192)
        at java.lang.J9VMInternals.initializeImpl(Native Method)
        at java.lang.J9VMInternals.initialize(J9VMInternals.java:148)
        ... 4 more
I tried to put the HelperProviderImpl class name  in the 
META-INF/services/commonj.sdo.impl.HelperProviderImpl text file in the 
src.main.resources package.But looks like it is not picking up the name 
for the HelperProviderImpl.

Here is the xsd file

<schema 
xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.ibm.com/websphere/fvt/ejbquery/emf"
xmlns:ritika="http://www.ibm.com/websphere/fvt/ejbquery/emf"
xmlns:sdo="commonj.sdo/XML"
xmlns:sdoJava="commonj.sdo/java"
sdoJava:package="com.ibm.websphere.fvt.ejbquery.emf">
<complexType name="DataGraphRoot">
    <sequence>
      <element maxOccurs="unbounded" minOccurs="0" name="deptMed" 
type="ritika:DeptMed"/>
      <element maxOccurs="unbounded" minOccurs="0" name="empMed" 
type="ritika:EmpMed"/>
      <element maxOccurs="unbounded" minOccurs="0" name="projectMed" 
type="ritika:ProjectMed"/>
      <element maxOccurs="unbounded" minOccurs="0" name="taskMed" 
type="ritika:TaskMed"/>
      <!-- <element name="changeSummary" type="sdo:ChangeSummaryType" /> 
-->
    </sequence>
  </complexType>
<complexType name="DeptMed">
   <sequence>
    <element name="deptno" type="int"/>
    <element name="name" type="string"/>
    <element name="budget" type="double"/>
    <element sdo:oppositeProperty="manages" 
sdo:propertyType="ritika:EmpMed" name="mgr" type="ritika:EmpMed" />
    <element sdo:oppositeProperty="dept" 
sdo:propertyType="ritika:ProjectMed"  name="proj" type="ritika:ProjectMed" 
/>
    <element sdo:oppositeProperty="dept" sdo:propertyType="ritika:EmpMed" 
name="emp" type="ritika:EmpMed"  />
   </sequence>
  </complexType>
<complexType name="EmpMed">
    <sequence>
    <element name="empid" type="int"/>
    <element name="name" type="string"/>
    <element name="salary" type="double"/>
    <element name="bonus" type="double"/>
    <element sdo:oppositeProperty="emp" sdo:propertyType="ritika:DeptMed" 
name="dept" type="ritika:DeptMed" />
    <element sdo:oppositeProperty="emp" sdo:propertyType="ritika:TaskMed" 
name="task" type="ritika:TaskMed" />
    <element sdo:oppositeProperty="mgr" sdo:propertyType="ritika:DeptMed" 
name="manages" type="ritika:DeptMed" />
    </sequence>
  </complexType>
 <complexType name="ProjectMed">
     <sequence>
    <element name="projid" type="int"/>
    <element name="cost" type="double"/>
    <element name="startDate" type="dateTime" 
sdoJava:instanceClass="java.sql.Timestamp"/>
    <element name="endDate" type="dateTime" 
sdoJava:instanceClass="java.sql.Timestamp"/>
    <element sdo:oppositeProperty="proj" sdo:propertyType="ritika:DeptMed" 
name="dept" type="ritika:DeptMed" />
    <element sdo:oppositeProperty="proj" sdo:propertyType="ritika:TaskMed" 
name="task" type="ritika:TaskMed" />
    </sequence>
  </complexType>
<complexType name="TaskMed">
    <sequence>
    <element name="taskid" type="int"/>
    <element name="description" type="string"/>
    <element name="startDate" type="dateTime" 
sdoJava:instanceClass="java.sql.Timestamp" />
    <element name="endDate" type="dateTime" 
sdoJava:instanceClass="java.sql.Timestamp" />
    <element sdo:oppositeProperty="task" 
sdo:propertyType="ritika:ProjectMed" name="proj" 
type="ritika:ProjectMed"/>
    <element sdo:oppositeProperty="task" sdo:propertyType="ritika:EmpMed" 
name="emp" type="ritika:EmpMed" />
    </sequence>
  </complexType>
</schema>

ritika
 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message