• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Henry Wong
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Joe Ess
  • salvin francis

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

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Mo-om! You're embarassing me! Can you just read a tiny ad like a normal person?
Sauce Labs - World's Largest Continuous Testing Cloud for Websites and Mobile Apps
https://coderanch.com/t/722574/Sauce-Labs-World-Largest-Continuous
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!