aspose file tools*
The moose likes XML and Related Technologies and the fly likes  Schema not works with xjc and java lang reflect Invocation Target Exception error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark " Schema not works with xjc and java lang reflect Invocation Target Exception error" Watch " Schema not works with xjc and java lang reflect Invocation Target Exception error" New topic
Author

Schema not works with xjc and java lang reflect Invocation Target Exception error

Jayne
Greenhorn

Joined: Apr 08, 2004
Posts: 1
Title: schema does not work and using xjc does not works and java.lang.reflect.InvocationTargetException
Hi
I have changed the classpath and path
CLASSPATH = %SystemRoot%\mysql-connector-java-3.0.11-stable-bin.jar;C:\tamagotchi;C:\jdk1.4.0\lib;C:\jwsdp-1.3\jaxb\lib;C:\jwsdp-1.3\jaxb\lib\jaxb-api.jar;C:\jwsdp1.3\jaxb\lib\jaxb-impl.jar;C:\jwsdp-1.3\jaxb\lib\jaxb-libs.jar;C:\jwsdp-1.3\jaxb\lib\jaxb-xjc.jar;C:\jwsdp-1.3\jaxb\lib\xercesImpl.jar;%CLASSPATH%
PATH = %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;c:\j2sdk1.4.2_04\bin;%JAXB_HOME%\bin;%JWSDP_HOME%\jwdsp-shared\bin;%JAXB_HOME%\bin\xjc.bat;%PATH%
JWSDP_HOME=C:\jwsdp-1.3
JAXB_HOME = C:\jwsdp-1.3\jaxb
The purchaseorder.xsd is in C:\jwsdp-1.3\jaxb\lib
I did: cd jwsdp-1.3\jaxb\lib
And yet when I type xjc �d purchaseorder purchaseorder.xsd
I get this error:
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcce
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.commons.launcher.ChildMain.run(ChildMain.java:269)
Caused by: java.lang.NullPointerException
at com.sun.tools.xjc.util.Util.which(Util.java:54)
at com.sun.tools.xjc.util.Util.which(Util.java:40)
at com.sun.tools.xjc.reader.xmlschema.parser.SchemaConstraintChecker.ch
ckXercesVersion(SchemaConstraintChecker.java:112)
at com.sun.tools.xjc.reader.xmlschema.parser.SchemaConstraintChecker.ch
ck(SchemaConstraintChecker.java:51)
at com.sun.tools.xjc.GrammarLoader.loadXMLSchema(GrammarLoader.java:355
at com.sun.tools.xjc.GrammarLoader.load(GrammarLoader.java:130)
at com.sun.tools.xjc.GrammarLoader.load(GrammarLoader.java:79)
at com.sun.tools.xjc.Driver.run(Driver.java:177)
at com.sun.tools.xjc.Driver._main(Driver.java:80)
at com.sun.tools.xjc.Driver.access$000(Driver.java:46)
at com.sun.tools.xjc.Driver$1.run(Driver.java:60)
My schema:
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited by Sameer Tyagi -->
<xsd:schema targetNamespace="http://www.flutebank.com/schema" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.flutebank.com/schema" elementFormDefault="qualified">
<xsd:element name="billingaddress">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="name"/>
<xsd:element ref="street"/>
<xsd:element ref="city"/>
<xsd:element ref="state"/>
<xsd:element ref="zip"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="city" type="xsd:string"/>
<xsd:element name="date" type="xsd:string"/>
<xsd:element name="description" type="xsd:string"/>
<xsd:element name="identifier" type="xsd:string"/>
<xsd:element name="item">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="quantity"/>
<xsd:element ref="productnumber"/>
<xsd:element ref="description"/>
<xsd:element ref="unitcost"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="items">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="item" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="name" type="xsd:string"/>
<xsd:element name="productnumber" type="xsd:string"/>
<xsd:element name="purchaseorder">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="identifier"/>
<xsd:element ref="date"/>
<xsd:element ref="billingaddress"/>
<xsd:element ref="items"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="quantity" type="xsd:int"/>
<xsd:element name="state" type="xsd:string"/>
<xsd:element name="street" type="xsd:string"/>
<xsd:element name="unitcost" type="xsd ecimal"/>
<xsd:element name="zip" type="xsd:string"/>
</xsd:schema>
Can anyone help?
Thanks Jayne
http://developers.sun.com/forums/index.html
http://forum.java.sun.com/thread.jsp?forum=34&thread=511428
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Hi Jayne,
May I ask you to spend a couple of minutes for reading our naming policy and editing your display name accordingly.
Thanks, and welcome to the JavaRanch!


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Schema not works with xjc and java lang reflect Invocation Target Exception error