Xjc in jaxp 1.2
Hi,
i probably didn't search long enough, or i didn't
understand the changes of jaxp 1.2 comparing to
the old versions.
in the beta release i had following steps:
.) write the dtd file
.) write the xjs file
.) generate my object files and compile them
.) use them in my code
I would like to keep it in that way, because i can't parse a
file, everytime i need it. I have to have already generated
objects. But i can't find the xjc anymore in 1.2
Is this still in 1.2 version?
thx for any help
C
oh, damn,
it's jaxb and not jaxp.
I guess it's a while since i used it...
Cheers
C
Similar Messages
-
JAXB Demo Crashes - using JDK 1.4.2
I have installed the pack (1.6) with JDK 1.4.2. That finished 'ok'.
Now I am getting the error: [java] java.lang.NoSuchMethodError: javax.xml.parsers.SAXParserFactory.getSchema()Ljavax/xml/validation/Schema;
when trying to run the bind choice jaxb demo.
As far as I can tell the javax.xml libraries in the java jdk1.4 are too old. How will this work with jdk 1.4 ?
Thanks.Just FYI -
(This issue is also discussed in this forum, named Java Forums - JAXB JDK requirement.)
I had a hard time trying to figure out the -D and the build file config. I am using Eclipse 3.1, so it is supposed to take care of all this for me, right?
In Eclipse, if you click on the right side of the Run button to open it up, then from the dropdown select Run, a new window will open up that has all of your projects displayed. Select your JAXB project (which might already be highlighted) and you'll see some tabs.
Select the Classpath tab.
Here you'll see Bootstrap Entries. On the right you'll see an Add Jars button. Click on it.
Add the JAXB and JAXP jar files, per the Sun specs:
jaxb-api.jar
jaxb-impl.jar
jaxb-libs.jar
jaxb-xjc.jar
jaxp-api.jar
dom.jar
sax.jar
xalan.jar
xercesImpl.jar
....basically all the jars in the JAXB and JAXP lib directories, including the endorsed files, will do.
This will take care of this issue with JAXB and the 1.4.2 issue when you use Eclipse 3.1. Hope this helps, as it took an experienced Eclipse developer to show me this... -
import com.sun.xml.bind.unmarshaller.InterningXMLReader cannot resolved.
is any seperate jar file to be add.The following is the list of JAR files that you need for JAXB.
jaxb-api.jar
jaxb-impl.jar
jaxb-libs.jar
jaxb-xjc.jar
jaxp-api.jar
relaxingDatatype.jar
xsdlib.jar
xercesImpl.jar
xmlParseAPIs.jar -
An XJC compilation error - Could not load class (..) for type cvsversion
I've got a strange compilation error using NetBeans 4.0 (I'd guess the version does not matter here) and Ant 1.6.2. When the following task is executed,
<target name="compile_ofx_schema">
<antcall target="clean-ofx"/>
<delete dir="${ofx-jaxb-src.dir}"/>
<mkdir dir="${ofx-jaxb-src.dir}" />
<xjc schema="${schema.dir}/ofx102.xsd" package="com.xxx.ofx102" target="${ofx-jaxb-src.dir}">
<arg value="-nv" />
<arg value="-extension" />
</xjc>
</target>
I get the error from NetBeans console,
Class org.xml.sax.SAXException loaded from parent loader (parentFirst)
Class java.io.IOException loaded from parent loader (parentFirst)
D:\appserver\build.xml:797: unable to parse the schema. Error messages should have been provided
at com.sun.tools.xjc.XJCTask._doXJC(XJCTask.java:334)
at com.sun.tools.xjc.XJCTask.doXJC(XJCTask.java:283)
at com.sun.tools.xjc.XJCTask.execute(XJCTask.java:227)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
at org.apache.tools.ant.Project.executeTargets(Project.java:1062)
at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:217)
at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:236)
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:125)
BUILD FAILED (total time: 4 seconds)
Could not load class (org.apache.tools.ant.tasksdefs.cvslib.CvsVersion) for type cvsversion
Could not load class (org.apache.tools.ant.tasksdefs.cvslib.CvsVersion) for type cvsversion
And when I run the Ant task from the command line, I don't get the error at all.
Any help is greatly appreciated.That was a great finding from you. Thank you.
I followed your alternative approach and updated the ant.jar file. The "Could not load class..." error went away but the stack trace still remains. Now I am clueless again since I have ant on the debug mode and can't find any more useful info.
Class com.sun.tools.xjc.reader.internalizer.LocatorTable loaded from ant loader (parentFirst)
Class java.util.HashSet loaded from parent loader (parentFirst)
Class javax.xml.parsers.DocumentBuilderFactory loaded from parent loader (parentFirst)
Couldn't load Resource org/netbeans/core/xml/DOMFactoryImpl.class
Couldn't load ResourceStream for META-INF/services/javax.xml.parsers.DocumentBuilderFactory
Class org.apache.crimson.jaxp.DocumentBuilderFactoryImpl loaded from parent loader (parentFirst)
Class javax.xml.parsers.SAXParserFactory loaded from parent loader (parentFirst)
Couldn't load Resource org/netbeans/core/xml/SAXFactoryImpl.class
Couldn't load ResourceStream for META-INF/services/javax.xml.parsers.SAXParserFactory
Class org.apache.crimson.jaxp.SAXParserFactoryImpl loaded from parent loader (parentFirst)
Class javax.xml.parsers.DocumentBuilder loaded from parent loader (parentFirst)
Class java.util.Map loaded from parent loader (parentFirst)
Class javax.xml.parsers.SAXParser loaded from parent loader (parentFirst)
Finding class com.sun.tools.xjc.reader.xmlschema.parser.XMLSchemaInternalizationLogic$ReferenceFinder
Loaded from D:\bbw\build\Common_3.6\Packaged\appserver\lib\jaxb\jaxb-xjc.jar com/sun/tools/xjc/reader/xmlschema/parser/XMLSchemaInternalizationLogic$ReferenceFinder.class
Finding class com.sun.tools.xjc.reader.internalizer.AbstractReferenceFinderImpl
Loaded from D:\bbw\build\Common_3.6\Packaged\appserver\lib\jaxb\jaxb-xjc.jar com/sun/tools/xjc/reader/internalizer/AbstractReferenceFinderImpl.class
Class org.xml.sax.helpers.XMLFilterImpl loaded from parent loader (parentFirst)
Class com.sun.tools.xjc.reader.internalizer.AbstractReferenceFinderImpl loaded from ant loader (parentFirst)
Class com.sun.tools.xjc.reader.xmlschema.parser.XMLSchemaInternalizationLogic$ReferenceFinder loaded from ant loader (parentFirst)
Class org.xml.sax.XMLFilter loaded from parent loader (parentFirst)
Finding class com.sun.tools.xjc.reader.internalizer.VersionChecker
Loaded from D:\bbw\build\Common_3.6\Packaged\appserver\lib\jaxb\jaxb-xjc.jar com/sun/tools/xjc/reader/internalizer/VersionChecker.class
Class com.sun.tools.xjc.reader.internalizer.VersionChecker loaded from ant loader (parentFirst)
Finding class com.sun.tools.xjc.reader.internalizer.DOMBuilder
Loaded from D:\bbw\build\Common_3.6\Packaged\appserver\lib\jaxb\jaxb-xjc.jar com/sun/tools/xjc/reader/internalizer/DOMBuilder.class
Finding class com.sun.xml.bind.marshaller.SAX2DOMEx
Loaded from D:\bbw\build\Common_3.6\Packaged\appserver\lib\jaxb\jaxb-impl.jar com/sun/xml/bind/marshaller/SAX2DOMEx.class
Class org.xml.sax.ContentHandler loaded from parent loader (parentFirst)
Class com.sun.xml.bind.marshaller.SAX2DOMEx loaded from ant loader (parentFirst)
Class com.sun.tools.xjc.reader.internalizer.DOMBuilder loaded from ant loader (parentFirst)
Class java.util.Stack loaded from parent loader (parentFirst)
Class org.w3c.dom.Document loaded from parent loader (parentFirst)
Class org.xml.sax.XMLReader loaded from parent loader (parentFirst)
Class org.w3c.dom.Node loaded from parent loader (parentFirst)
Class org.w3c.dom.Element loaded from parent loader (parentFirst)
Class javax.xml.parsers.ParserConfigurationException loaded from parent loader (parentFirst)
Class org.xml.sax.SAXException loaded from parent loader (parentFirst)
Class java.io.IOException loaded from parent loader (parentFirst)
D:\bbw\build\Common_3.6\Packaged\appserver\build.xml:799: unable to parse the schema. Error messages should have been provided
at com.sun.tools.xjc.XJCTask._doXJC(XJCTask.java:334)
at com.sun.tools.xjc.XJCTask.doXJC(XJCTask.java:283)
at com.sun.tools.xjc.XJCTask.execute(XJCTask.java:227)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
at org.apache.tools.ant.Project.executeTargets(Project.java:1062)
at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:217)
at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:236)
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:125)
BUILD FAILED (total time: 1 second)
Any suggestions? BTW, I did not upgrade NetBeans to v5.5 due that my code is still JDK1.4 based. -
Compiling the Files generated by XJC
Hi, im wrote from Venezuela sorry for the english
Hi, i have try to compile and run a simple applicacion that binding a xml document in a java aplication using the api JAXB, but i cant do it
I downloaded the JWSDP 1.3, and put the jars of the JAXB in the /usr/java/jre/lib/ext..
Next i use the XJC to generate the clases needed to binding the XML, this steps works fine
Next i took this classes and try to compile, but the java compilar tell me that its no find the package javax.xml.namespace and the package org.relaxng.datatype
Im looking in the jars of the JAXB, and no find this packages,, where is located this packages???hi,
hope this reply answers all the queries posted regarding this.
first, the JWSDP1.x is perfectly fine. I have tried developing applications using JAXB and it works out to be aboslutely fine. no issues regarding jwsdp or JAXB.
second, please check that the following jars are available in the classpath
jaxb-apis.jar
jaxb-impl.jar
jaxb-libs.jar
jaxp-api.jar
jax-qname.jar
namespace.jar
relaxngDatatype.jar
sax.jar
xsdlib.jar
all these jars are available in JWSDP1.3 somewhere. try to find all these jars and run again. this will definitely work. I have some application that has been developed using JAXB in JWSDP1.3 and it is working fine.
hope this sovlves all the problems. -
Problems running xjc compiler for JAXB
I'm new to the web services pack and I am trying to run the xjc script to launch the binding compiler, but nothing is launched. I checked the env-vars and they look correct but maybe I am missing something. Below is the echoed output when I launch the script and pause it. There is an output regarding 'C:Programs' which I don't understand. Any ideas? Thanks
C:\Sun\jwsdp-1.6\jaxb\bin>rem Make sure that JAXB_HOME and JAVA_HOME are set
C:\Sun\jwsdp-1.6\jaxb\bin>rem
C:\Sun\jwsdp-1.6\jaxb\bin>if not "C:\Sun\jwsdp-1.6\jaxb" == "" goto CHECKJAVAHOM
E
C:\Sun\jwsdp-1.6\jaxb\bin>if not "C:\Program Files\Java\jdk1.5.0_05" == "" goto
USE_JAVA_HOME
C:\Sun\jwsdp-1.6\jaxb\bin>set JAVA=C:\Program Files\Java\jdk1.5.0_05\bin\java
C:\Sun\jwsdp-1.6\jaxb\bin>goto LAUNCHXJC
C:\Sun\jwsdp-1.6\jaxb\bin>set JAXP_HOME=C:\Sun\jwsdp-1.6\jaxb\..\jaxp
C:\Sun\jwsdp-1.6\jaxb\bin>C:\Program Files\Java\jdk1.5.0_05\bin\java -Djava.end
orsed.dirs=C:\Sun\jwsdp-1.6\jaxb\..\jaxp\lib;C:\Sun\jwsdp-1.6\jaxb\..\jaxp\lib\e
ndorsed -jar C:\Sun\jwsdp-1.6\jaxb\lib\jaxb-xjc.jar
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
C:\Sun\jwsdp-1.6\jaxb\bin>C:\WINNT\system32\cmd.exe /C exit 9009
C:\Sun\jwsdp-1.6\jaxb\bin>pause
Press any key to continue . . .I don't know whether this is the answer to your question. If all other things are right, please make sure that you don't have spaces in between the environment variables set.
-
Hi!
When i try to run the xjc ant task in my build file i get the error showed below Could some one help or give me an advice about this?
In my build file i have the next lines of xml:
<taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask"/>
and
<target name="xsdCompile">
<xjc target="${src}/java" package="com.getronics.cea.cie.mopab.documentos">
<schema dir="${schemas.home}" includes="*.xsd"/>
</xjc>
</target>
Thanks a lot!
Adolfo de Unanue
!xsdCompile Running target: xsdCompile
xsdCompile:
[xjc] Compiling file:/home/aunanue/mopab3/mopab/src/xml/schemas/administracionYCobranza.xsd and others
org.iso_relax.verifier.VerifierConfigurationException: no validation engine available for: http://relaxng.org/ns/structure/1.0
at org.iso_relax.verifier.VerifierFactory.newInstance(Unknown Source)
at com.sun.tools.xjc.reader.xmlschema.bindinfo.AnnotationParserImpl.getContentHandler(AnnotationParserImpl.java:61)
at com.sun.xml.xsom.impl.parser.state.annotation.action0(annotation.java:42)
at com.sun.xml.xsom.impl.parser.state.annotation.enterElement(annotation.java:59)
at com.sun.xml.xsom.impl.parser.state.NGCCRuntime.spawnChildFromEnterElement(NGCCRuntime.java:431)
at com.sun.xml.xsom.impl.parser.state.Schema.enterElement(Schema.java:222)
at com.sun.xml.xsom.impl.parser.state.NGCCRuntime.startElement(NGCCRuntime.java:210)
at org.xml.sax.helpers.XMLFilterImpl.startElement(Unknown Source)
at com.sun.tools.xjc.reader.xmlschema.IncorrectNamespaceURIChecker.startElement(IncorrectNamespaceURIChecker.java:85)
at org.xml.sax.helpers.XMLFilterImpl.startElement(Unknown Source)
at com.sun.tools.xjc.reader.xmlschema.ProhibitedFeaturesFilter.startElement(ProhibitedFeaturesFilter.java:123)
at org.xml.sax.helpers.XMLFilterImpl.startElement(Unknown Source)
at org.iso_relax.verifier.impl.VerifierFilterImpl.startElement(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:459)
at org.apache.xerces.impl.XMLNamespaceBinder.handleStartElement(XMLNamespaceBinder.java:877)
at org.apache.xerces.impl.XMLNamespaceBinder.startElement(XMLNamespaceBinder.java:569)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:759)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1477)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:329)
at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:525)
at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:581)
at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152)
at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1175)
at org.xml.sax.helpers.XMLFilterImpl.parse(Unknown Source)
at org.xml.sax.helpers.XMLFilterImpl.parse(Unknown Source)
at org.xml.sax.helpers.XMLFilterImpl.parse(Unknown Source)
at com.sun.xml.xsom.impl.parser.NGCCRuntimeEx.parseEntity(NGCCRuntimeEx.java:151)
at com.sun.xml.xsom.impl.parser.XSOMParser.parse(XSOMParser.java:116)
at com.sun.tools.xjc.Driver.loadXMLSchemaGrammar(Driver.java:511)
at com.sun.tools.xjc.Driver.loadGrammar(Driver.java:404)
at com.sun.tools.xjc.XJCTask.execute(XJCTask.java:149)
at org.apache.tools.ant.Task.perform(Task.java:317)
at org.apache.tools.ant.Target.execute(Target.java:309)
at org.apache.tools.ant.Target.performTasks(Target.java:334)
at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
at antfarm.TargetRunner.runAntTarget(Unknown Source)
at antfarm.TargetRunner.run(Unknown Source)
BUILD FAILED
java.lang.InternalError
at com.sun.tools.xjc.reader.xmlschema.bindinfo.AnnotationParserImpl.getContentHandler(AnnotationParserImpl.java:71)
at com.sun.xml.xsom.impl.parser.state.annotation.action0(annotation.java:42)
at com.sun.xml.xsom.impl.parser.state.annotation.enterElement(annotation.java:59)
at com.sun.xml.xsom.impl.parser.state.NGCCRuntime.spawnChildFromEnterElement(NGCCRuntime.java:431)
at com.sun.xml.xsom.impl.parser.state.Schema.enterElement(Schema.java:222)
at com.sun.xml.xsom.impl.parser.state.NGCCRuntime.startElement(NGCCRuntime.java:210)
at org.xml.sax.helpers.XMLFilterImpl.startElement(Unknown Source)
at com.sun.tools.xjc.reader.xmlschema.IncorrectNamespaceURIChecker.startElement(IncorrectNamespaceURIChecker.java:85)
at org.xml.sax.helpers.XMLFilterImpl.startElement(Unknown Source)
at com.sun.tools.xjc.reader.xmlschema.ProhibitedFeaturesFilter.startElement(ProhibitedFeaturesFilter.java:123)
at org.xml.sax.helpers.XMLFilterImpl.startElement(Unknown Source)
at org.iso_relax.verifier.impl.VerifierFilterImpl.startElement(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:459)
at org.apache.xerces.impl.XMLNamespaceBinder.handleStartElement(XMLNamespaceBinder.java:877)
at org.apache.xerces.impl.XMLNamespaceBinder.startElement(XMLNamespaceBinder.java:569)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:759)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1477)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:329)
at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:525)
at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:581)
at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152)
at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1175)
at org.xml.sax.helpers.XMLFilterImpl.parse(Unknown Source)
at org.xml.sax.helpers.XMLFilterImpl.parse(Unknown Source)
at org.xml.sax.helpers.XMLFilterImpl.parse(Unknown Source)
at com.sun.xml.xsom.impl.parser.NGCCRuntimeEx.parseEntity(NGCCRuntimeEx.java:151)
at com.sun.xml.xsom.impl.parser.XSOMParser.parse(XSOMParser.java:116)
at com.sun.tools.xjc.Driver.loadXMLSchemaGrammar(Driver.java:511)
at com.sun.tools.xjc.Driver.loadGrammar(Driver.java:404)
at com.sun.tools.xjc.XJCTask.execute(XJCTask.java:149)
at org.apache.tools.ant.Task.perform(Task.java:317)
at org.apache.tools.ant.Target.execute(Target.java:309)
at org.apache.tools.ant.Target.performTasks(Target.java:334)
at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
at antfarm.TargetRunner.runAntTarget(Unknown Source)
at antfarm.TargetRunner.run(Unknown Source)Hi
When you define the xjc task you will need to
include all the jaxb, jaxp jars in the classpath.
See the <JWSDP>/jaxb-1.0/examples/users-guide/SampleApp1/build.xml
for more information
Regards,
Bhakti
Hi!
When i try to run the xjc ant task in my build file i
get the error showed below Could some one help or give
me an advice about this?
In my build file i have the next lines of xml:
<taskdef name="xjc"
classname="com.sun.tools.xjc.XJCTask"/>
and
<target name="xsdCompile">
<xjc target="${src}/java"
va" package="com.getronics.cea.cie.mopab.documentos">
<schema dir="${schemas.home}"
.home}" includes="*.xsd"/>
</xjc>
</target>
Thanks a lot!
Adolfo de Unanue
!xsdCompile Running target: xsdCompile
xsdCompile:
[xjc] Compiling
iling
file:/home/aunanue/mopab3/mopab/src/xml/schemas/adminis
racionYCobranza.xsd and others
org.iso_relax.verifier.VerifierConfigurationException:
no validation engine available for:
http://relaxng.org/ns/structure/1.0
at
org.iso_relax.verifier.VerifierFactory.newInstance(Unk
own Source)
at
com.sun.tools.xjc.reader.xmlschema.bindinfo.Annotation
arserImpl.getContentHandler(AnnotationParserImpl.java:6
at
com.sun.xml.xsom.impl.parser.state.annotation.action0(
nnotation.java:42)
at
com.sun.xml.xsom.impl.parser.state.annotation.enterEle
ent(annotation.java:59)
at
com.sun.xml.xsom.impl.parser.state.NGCCRuntime.spawnCh
ldFromEnterElement(NGCCRuntime.java:431)
at
com.sun.xml.xsom.impl.parser.state.Schema.enterElement
Schema.java:222)
at
com.sun.xml.xsom.impl.parser.state.NGCCRuntime.startEl
ment(NGCCRuntime.java:210)
at
org.xml.sax.helpers.XMLFilterImpl.startElement(Unknown
Source)
at
com.sun.tools.xjc.reader.xmlschema.IncorrectNamespaceU
IChecker.startElement(IncorrectNamespaceURIChecker.java
85)
at
org.xml.sax.helpers.XMLFilterImpl.startElement(Unknown
Source)
at
com.sun.tools.xjc.reader.xmlschema.ProhibitedFeaturesF
lter.startElement(ProhibitedFeaturesFilter.java:123)
at
org.xml.sax.helpers.XMLFilterImpl.startElement(Unknown
Source)
at
org.iso_relax.verifier.impl.VerifierFilterImpl.startEl
ment(Unknown Source)
at
org.apache.xerces.parsers.AbstractSAXParser.startEleme
t(AbstractSAXParser.java:459)
at
org.apache.xerces.impl.XMLNamespaceBinder.handleStartE
ement(XMLNamespaceBinder.java:877)
at
org.apache.xerces.impl.XMLNamespaceBinder.startElement
XMLNamespaceBinder.java:569)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.
canStartElement(XMLDocumentFragmentScannerImpl.java:759
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$
ragmentContentDispatcher.dispatch(XMLDocumentFragmentSc
nnerImpl.java:1477)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.
canDocument(XMLDocumentFragmentScannerImpl.java:329)
at
org.apache.xerces.parsers.DTDConfiguration.parse(DTDCo
figuration.java:525)
at
org.apache.xerces.parsers.DTDConfiguration.parse(DTDCo
figuration.java:581)
at
org.apache.xerces.parsers.XMLParser.parse(XMLParser.ja
a:152)
at
org.apache.xerces.parsers.AbstractSAXParser.parse(Abst
actSAXParser.java:1175)
at org.xml.sax.helpers.XMLFilterImpl.parse(Unknown
Source)
at org.xml.sax.helpers.XMLFilterImpl.parse(Unknown
Source)
at org.xml.sax.helpers.XMLFilterImpl.parse(Unknown
Source)
at
com.sun.xml.xsom.impl.parser.NGCCRuntimeEx.parseEntity
NGCCRuntimeEx.java:151)
at
com.sun.xml.xsom.impl.parser.XSOMParser.parse(XSOMPars
r.java:116)
at
com.sun.tools.xjc.Driver.loadXMLSchemaGrammar(Driver.j
va:511)
at
com.sun.tools.xjc.Driver.loadGrammar(Driver.java:404)
at
com.sun.tools.xjc.XJCTask.execute(XJCTask.java:149)
at org.apache.tools.ant.Task.perform(Task.java:317)
at
org.apache.tools.ant.Target.execute(Target.java:309)
at
org.apache.tools.ant.Target.performTasks(Target.java:3
4)
at
org.apache.tools.ant.Project.executeTarget(Project.jav
:1306)
at antfarm.TargetRunner.runAntTarget(Unknown Source)
at antfarm.TargetRunner.run(Unknown Source)
BUILD FAILED
java.lang.InternalError
at
com.sun.tools.xjc.reader.xmlschema.bindinfo.Annotation
arserImpl.getContentHandler(AnnotationParserImpl.java:7
at
com.sun.xml.xsom.impl.parser.state.annotation.action0(
nnotation.java:42)
at
com.sun.xml.xsom.impl.parser.state.annotation.enterEle
ent(annotation.java:59)
at
com.sun.xml.xsom.impl.parser.state.NGCCRuntime.spawnCh
ldFromEnterElement(NGCCRuntime.java:431)
at
com.sun.xml.xsom.impl.parser.state.Schema.enterElement
Schema.java:222)
at
com.sun.xml.xsom.impl.parser.state.NGCCRuntime.startEl
ment(NGCCRuntime.java:210)
at
org.xml.sax.helpers.XMLFilterImpl.startElement(Unknown
Source)
at
com.sun.tools.xjc.reader.xmlschema.IncorrectNamespaceU
IChecker.startElement(IncorrectNamespaceURIChecker.java
85)
at
org.xml.sax.helpers.XMLFilterImpl.startElement(Unknown
Source)
at
com.sun.tools.xjc.reader.xmlschema.ProhibitedFeaturesF
lter.startElement(ProhibitedFeaturesFilter.java:123)
at
org.xml.sax.helpers.XMLFilterImpl.startElement(Unknown
Source)
at
org.iso_relax.verifier.impl.VerifierFilterImpl.startEl
ment(Unknown Source)
at
org.apache.xerces.parsers.AbstractSAXParser.startEleme
t(AbstractSAXParser.java:459)
at
org.apache.xerces.impl.XMLNamespaceBinder.handleStartE
ement(XMLNamespaceBinder.java:877)
at
org.apache.xerces.impl.XMLNamespaceBinder.startElement
XMLNamespaceBinder.java:569)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.
canStartElement(XMLDocumentFragmentScannerImpl.java:759
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$
ragmentContentDispatcher.dispatch(XMLDocumentFragmentSc
nnerImpl.java:1477)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.
canDocument(XMLDocumentFragmentScannerImpl.java:329)
at
org.apache.xerces.parsers.DTDConfiguration.parse(DTDCo
figuration.java:525)
at
org.apache.xerces.parsers.DTDConfiguration.parse(DTDCo
figuration.java:581)
at
org.apache.xerces.parsers.XMLParser.parse(XMLParser.ja
a:152)
at
org.apache.xerces.parsers.AbstractSAXParser.parse(Abst
actSAXParser.java:1175)
at org.xml.sax.helpers.XMLFilterImpl.parse(Unknown
Source)
at org.xml.sax.helpers.XMLFilterImpl.parse(Unknown
Source)
at org.xml.sax.helpers.XMLFilterImpl.parse(Unknown
Source)
at
com.sun.xml.xsom.impl.parser.NGCCRuntimeEx.parseEntity
NGCCRuntimeEx.java:151)
at
com.sun.xml.xsom.impl.parser.XSOMParser.parse(XSOMPars
r.java:116)
at
com.sun.tools.xjc.Driver.loadXMLSchemaGrammar(Driver.j
va:511)
at
com.sun.tools.xjc.Driver.loadGrammar(Driver.java:404)
at
com.sun.tools.xjc.XJCTask.execute(XJCTask.java:149)
at org.apache.tools.ant.Task.perform(Task.java:317)
at
org.apache.tools.ant.Target.execute(Target.java:309)
at
org.apache.tools.ant.Target.performTasks(Target.java:3
4)
at
org.apache.tools.ant.Project.executeTarget(Project.jav
:1306)
at antfarm.TargetRunner.runAntTarget(Unknown Source)
at antfarm.TargetRunner.run(Unknown Source) -
hello,
i'm forced to develop in jdk 1.5 and need to use package javax.xml.stream (StAX), which is not included in jaxp1.3 (in jdk 5), so there is a need to somehow integrate jaxp 1.4 to jdk5.
first thing i've tried was getting jaxp 1.4 src and include a buildpath to my project to it. problem is, that javax.xml.stream.XMLOutputFactory.newInstance() throws exception javax.xml.stream.FactoryFinder$ConfigurationError: Provider com.sun.xml.internal.stream.XMLOutputFactoryImpl not found
thanks in advanceproblem solved
-
Exception when parsing schema with XJC
Using the command "xjc -d C:\Temp -p sbxml C:\Temp\sb2.xsd" in attempt to generate java classes for my schema I get the error below. The schema is well-formed and valid according to XMLSpy. The schema in question is found below the error. Thanks.
Mark
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException
at com.sun.msv.verifier.identity.IDConstraintChecker.feedAttribute(IDConstraintChecker.java:218)
at com.sun.msv.verifier.Verifier.startElement(Verifier.java:204)
at org.iso_relax.verifier.impl.VerifierFilterImpl.startElement(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:459)
at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:221)
at org.apache.xerces.impl.XMLNamespaceBinder.handleStartElement(XMLNamespaceBinder.java:874)
at org.apache.xerces.impl.XMLNamespaceBinder.emptyElement(XMLNamespaceBinder.java:591)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:747)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScanner
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:329)
at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:525)
at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:581)
at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152)
at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1175)
at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:371)
at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:371)
at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:371)
at com.sun.xml.xsom.impl.parser.NGCCRuntimeEx.parseEntity(NGCCRuntimeEx.java:151)
at com.sun.xml.xsom.impl.parser.XSOMParser.parse(XSOMParser.java:116)
at com.sun.tools.xjc.Driver.loadXMLSchemaGrammar(Driver.java:511)
at com.sun.tools.xjc.Driver.loadGrammar(Driver.java:404)
at com.sun.tools.xjc.Driver.run(Driver.java:268)
at com.sun.tools.xjc.Driver.main(Driver.java:88)
<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSPY v5 U (http://www.xmlspy.com) by Mark (CMH) -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="INFO_EX">
<xs:annotation>
<xs:documentation>Collection of data for any number of days</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="DAILY_INFO" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>Collection of data for all areas for a single day</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="AREA_INFO" type="AREA_INFO_TYPE" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="DATE_TODAY" type="xs:date" use="required"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="AREA_INFO_TYPE">
<xs:annotation>
<xs:documentation>Collection of data for a single area for a single day</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="FIELD_OBS" type="FIELD_OBS_TYPE" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="AVALANCHE" type="AV_TYPE" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="NOTABLE" type="NOTABLE_TYPE" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="AREA_ABBREV" type="AREA_ABBREV_TYPE" use="required"/>
</xs:complexType>
<xs:complexType name="FIELD_OBS_TYPE">
<xs:annotation>
<xs:documentation>Collection of a day's field observations</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="GEO_ID" type="SB_ID_TYPE"/>
<xs:element name="SKY_PM" type="SKY_TYPE"/>
<xs:element name="SKY_AM" type="SKY_TYPE"/>
<xs:element name="SKI_ELEV_MAX" type="xs:unsignedShort"/>
<xs:element name="SKI_ELEV_MIN" type="xs:unsignedShort"/>
<xs:element name="SKI_METERS" type="xs:unsignedShort"/>
<xs:element name="SKI_QUALITY">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="P"/>
<xs:enumeration value="F"/>
<xs:enumeration value="G"/>
<xs:enumeration value="E"/>
<xs:enumeration value=""/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="HI_TEMP" type="xs:decimal"/>
<xs:element name="LO_TEMP" type="xs:decimal"/>
<xs:element name="XPORT_AM" type="TRANSPORT_TYPE"/>
<xs:element name="XPORT_PM" type="TRANSPORT_TYPE"/>
<xs:element name="HN24" type="xs:int"/>
<xs:element name="FO_DATE" type="xs:date" minOccurs="0"/>
<xs:element name="W_SPD_AM" type="WIND_SPEED_TYPE"/>
<xs:element name="W_SPD_PM" type="WIND_SPEED_TYPE"/>
<xs:element name="DTMOD" type="xs:dateTime"/>
<xs:element name="AV_ACTIVITY" type="xs:string"/>
<xs:element name="PRECIP_AM" type="PRECIP_TYPE"/>
<xs:element name="PRECIP_PM" type="PRECIP_TYPE"/>
<xs:element name="FO_REMARK" type="xs:string"/>
<xs:element name="NIL_NEW" type="xs:boolean"/>
<xs:element name="PERCENT_OBS" type="xs:unsignedShort"/>
<xs:element name="HS" type="xs:integer"/>
<xs:element name="W_DIR_AM" type="WIND_DIRECTION_TYPE"/>
<xs:element name="W_DIR_PM" type="WIND_DIRECTION_TYPE"/>
<xs:element name="SFC2" type="SURFACE_TYPE"/>
<xs:element name="SFC1" type="SURFACE_TYPE"/>
<xs:element name="XPORT_DIR_AM" type="TRANSPORT_DIRECTION_TYPE"/>
<xs:element name="XPORT_DIR_PM" type="TRANSPORT_DIRECTION_TYPE"/>
</xs:sequence>
<xs:attribute name="FO_ID" type="SB_ID_TYPE" use="required"/>
</xs:complexType>
<xs:complexType name="NOTABLE_TYPE">
<xs:annotation>
<xs:documentation>Data concerning a notable event</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="AV_ID" type="SB_ID_TYPE" minOccurs="0"/>
<xs:element name="PARTY_SIZE" type="xs:unsignedShort"/>
<xs:element name="CAUGHT" type="xs:unsignedShort"/>
<xs:element name="PARTLY_BURIED" type="xs:unsignedShort"/>
<xs:element name="BURIED" type="xs:unsignedShort"/>
<xs:element name="INJURED" type="xs:unsignedShort"/>
<xs:element name="FATALITIES" type="xs:unsignedShort"/>
<xs:element name="REMARK" type="xs:string"/>
<xs:element name="DTMOD" type="xs:dateTime"/>
<xs:element name="NTBL_IMG" type="xs:hexBinary" minOccurs="0"/>
<xs:element name="NTBL_TIME" type="xs:time"/>
<xs:element name="NTBL_DATE" type="xs:date"/>
<xs:element name="MAIN_IMGLINK_ID" type="SB_ID_TYPE" minOccurs="0"/>
<xs:element name="NTBL_GEO_ID" type="SB_ID_TYPE" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="NOTABLE_ID" type="SB_ID_TYPE" use="required"/>
</xs:complexType>
<xs:complexType name="AV_TYPE">
<xs:annotation>
<xs:documentation>Data concerning a single avalanche</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="LENGTH_MIN" type="xs:unsignedInt"/>
<xs:element name="LENGTH_MAX" type="xs:unsignedInt"/>
<xs:element name="REMARK" type="xs:string"/>
<xs:element name="LWC">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Dry"/>
<xs:enumeration value="Moist"/>
<xs:enumeration value="Wet"/>
<xs:enumeration value=""/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="AV_SIZE">
<xs:simpleType>
<xs:restriction base="xs:float">
<xs:minInclusive value="1"/>
<xs:maxInclusive value="5"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="SKIABLE">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Y"/>
<xs:enumeration value="N"/>
<xs:enumeration value="N-Y"/>
<xs:enumeration value=""/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="GEO_ID" type="SB_ID_TYPE" minOccurs="0"/>
<xs:element name="THICK_MIN" type="xs:unsignedInt"/>
<xs:element name="NUM">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="[0-9]*"/>
<xs:pattern value="Sev"/>
<xs:pattern value="Num"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="WIDTH_MIN" type="xs:unsignedInt"/>
<xs:element name="WIDTH_MAX" type="xs:unsignedInt"/>
<xs:element name="MAIN_IMGLINK_ID" type="SB_ID_TYPE" minOccurs="0"/>
<xs:element name="THICK_MAX" type="xs:unsignedInt"/>
<xs:element name="THICK_MIN" type="xs:unsignedInt"/>
<xs:element name="DTMOD" type="xs:dateTime"/>
<xs:element name="TYPE">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Slab"/>
<xs:enumeration value="Loose"/>
<xs:enumeration value=""/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="AV_DATE" type="xs:date"/>
<xs:element name="AV_TIME" type="xs:time"/>
<xs:element name="AV_TRIGGER">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="15"/>
<xs:pattern value="N[aci].*|S[acry].*|H[acry].*|X[hcryer].*"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="BEDSFC_FORMANDSIZE">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="RG"/>
<xs:enumeration value="DF"/>
<xs:enumeration value="CR"/>
<xs:enumeration value="IM"/>
<xs:enumeration value="WG"/>
<xs:enumeration value="FC"/>
<xs:enumeration value=""/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="AV_LEVEL">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Old"/>
<xs:enumeration value="Storm"/>
<xs:enumeration value="Ground"/>
<xs:enumeration value="Glacier"/>
<xs:enumeration value=""/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="ASPECT">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="N"/>
<xs:enumeration value="NE"/>
<xs:enumeration value="E"/>
<xs:enumeration value="SE"/>
<xs:enumeration value="S"/>
<xs:enumeration value="SW"/>
<xs:enumeration value="W"/>
<xs:enumeration value="NW"/>
<xs:enumeration value="All"/>
<xs:enumeration value=""/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="WKLYR_DATE"/>
<xs:element name="TIMERANGE" type="xs:unsignedInt"/>
<xs:element name="INCLINE">
<xs:simpleType>
<xs:restriction base="xs:unsignedInt">
<xs:minInclusive value="0"/>
<xs:maxInclusive value="180"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="ELEV_MIN" type="xs:unsignedInt"/>
<xs:element name="ELEV_MAX" type="xs:unsignedInt"/>
<xs:element name="AV_CUTBLOCK">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="1"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="LOC_DESCRIPTION">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="30"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="WKLYR_FORMANDSIZE">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="PP"/>
<xs:enumeration value="SH"/>
<xs:enumeration value="FC"/>
<xs:enumeration value="DF"/>
<xs:enumeration value="WG"/>
<xs:enumeration value="DH"/>
<xs:enumeration value=""/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="NTBL" type="xs:boolean"/>
</xs:sequence>
<xs:attribute name="AV_ID" type="SB_ID_TYPE" use="required"/>
</xs:complexType>
<xs:simpleType name="SB_ID_TYPE">
<xs:annotation>
<xs:documentation>Reference type</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:maxLength value="10"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="AREA_ABBREV_TYPE">
<xs:restriction base="xs:string">
<xs:enumeration value="AD"/>
<xs:enumeration value="BB"/>
<xs:enumeration value="BU"/>
<xs:enumeration value="BA"/>
<xs:enumeration value="CA"/>
<xs:enumeration value="GL"/>
<xs:enumeration value="GO"/>
<xs:enumeration value="MO"/>
<xs:enumeration value="MB"/>
<xs:enumeration value="RE"/>
<xs:enumeration value="KO"/>
<xs:enumeration value="VA"/>
<xs:enumeration value="ST"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="SKY_TYPE">
<xs:annotation>
<xs:documentation>Restricts choices of sky observations</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="CLR"/>
<xs:enumeration value="OVC"/>
<xs:enumeration value="BKN"/>
<xs:enumeration value="SCT"/>
<xs:enumeration value="X"/>
<xs:enumeration value=""/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="PRECIP_TYPE">
<xs:annotation>
<xs:documentation>Restricts choices of precipation observations</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="NIL"/>
<xs:enumeration value="S-1"/>
<xs:enumeration value="S1"/>
<xs:enumeration value="S2"/>
<xs:enumeration value="S3"/>
<xs:enumeration value="S4"/>
<xs:enumeration value="RV"/>
<xs:enumeration value="RL"/>
<xs:enumeration value="RH"/>
<xs:enumeration value="RS"/>
<xs:enumeration value="G"/>
<xs:enumeration value="ZR"/>
<xs:enumeration value=""/>
<xs:enumeration value="RM"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="WIND_SPEED_TYPE">
<xs:annotation>
<xs:documentation>Restricts the choices of wind speed observations</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="C"/>
<xs:enumeration value="L"/>
<xs:enumeration value="M"/>
<xs:enumeration value="S"/>
<xs:enumeration value="X"/>
<xs:enumeration value=""/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="TRANSPORT_DIRECTION_TYPE">
<xs:annotation>
<xs:documentation>Enumeration of directions</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="N"/>
<xs:enumeration value="NE"/>
<xs:enumeration value="E"/>
<xs:enumeration value="SE"/>
<xs:enumeration value="S"/>
<xs:enumeration value="SW"/>
<xs:enumeration value="W"/>
<xs:enumeration value="NW"/>
<xs:enumeration value=""/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="TRANSPORT_TYPE">
<xs:annotation>
<xs:documentation>Restricts the choices of transport observations</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="Nil"/>
<xs:enumeration value="Prv"/>
<xs:enumeration value="M"/>
<xs:enumeration value="I"/>
<xs:enumeration value="U"/>
<xs:enumeration value=""/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="SURFACE_TYPE">
<xs:annotation>
<xs:documentation>Restricts the choices of the surface descriptions</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="PP"/>
<xs:enumeration value="DF"/>
<xs:enumeration value="RG"/>
<xs:enumeration value="FC"/>
<xs:enumeration value="DH"/>
<xs:enumeration value="WG"/>
<xs:enumeration value="SH"/>
<xs:enumeration value="IM"/>
<xs:enumeration value="CR"/>
<xs:enumeration value=""/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="WIND_DIRECTION_TYPE">
<xs:annotation>
<xs:documentation>Restricts possible observed wind directions</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="N"/>
<xs:enumeration value="NE"/>
<xs:enumeration value="E"/>
<xs:enumeration value="SE"/>
<xs:enumeration value="S"/>
<xs:enumeration value="SW"/>
<xs:enumeration value="W"/>
<xs:enumeration value="NW"/>
<xs:enumeration value="V"/>
<xs:enumeration value=""/>
</xs:restriction>
</xs:simpleType>
</xs:schema>myhrem, I've just come across exactly the same problem after amemding my schema. Fortunatley I hadn't changed much so it was possible to find out what caused the error. It is the empty enumeration element where value is equal to "" that causes xjc to throw the error.
I don't know if its right or wrong, in my case I was able to remove the empty element from the xsd. -
JAXB Problem: xjc gives an error
Hello everyone,
I would like to use JAXB to extract various information from a class of XML documents that conform to a schema. After tweaking the schema so that I avoid namespace conflicts with xjc, I settled the namespace conflicts, but I got the following error. Even if you don't have an answer, could you give me some pointers so that I can at least begin tackling the problem?
Thank you very much!
Here is the output of the command I ran:
C:\Documents and Settings\Berk Kapicioglu\Desktop>xjc -p test.jaxb ownership4ADocument.xsd.xml -d work
parsing a schema...
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
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.util.MissingResourceException: Can't find resource for bundle ja
va.util.PropertyResourceBundle, key parser.cc.8
at java.util.ResourceBundle.getObject(ResourceBundle.java:314)
at java.util.ResourceBundle.getString(ResourceBundle.java:274)
at com.sun.msv.datatype.xsd.regex.RegexParser.ex(RegexParser.java:138)
at com.sun.msv.datatype.xsd.regex.ParserForXMLSchema.parseCharacterClass
(ParserForXMLSchema.java:291)
at com.sun.msv.datatype.xsd.regex.RegexParser.parseAtom(RegexParser.java
:736)
at com.sun.msv.datatype.xsd.regex.RegexParser.parseFactor(RegexParser.ja
va:638)
at com.sun.msv.datatype.xsd.regex.RegexParser.parseTerm(RegexParser.java
:342)
at com.sun.msv.datatype.xsd.regex.RegexParser.parseRegex(RegexParser.jav
a:320)
at com.sun.msv.datatype.xsd.regex.RegexParser.parse(RegexParser.java:158
at com.sun.msv.datatype.xsd.regex.RegularExpression.setPattern(RegularEx
pression.java:3040)
at com.sun.msv.datatype.xsd.regex.RegularExpression.setPattern(RegularEx
pression.java:3051)
at com.sun.msv.datatype.xsd.regex.RegularExpression.<init>(RegularExpres
sion.java:3017)
at com.sun.msv.datatype.xsd.PatternFacet.compileRegExps(PatternFacet.jav
a:79)
at com.sun.msv.datatype.xsd.PatternFacet.<init>(PatternFacet.java:67)
at com.sun.msv.datatype.xsd.TypeIncubator.derive(TypeIncubator.java:261)
at com.sun.tools.xjc.reader.xmlschema.DatatypeBuilder.restrictionSimpleT
ype(DatatypeBuilder.java:82)
at com.sun.xml.xsom.impl.RestrictionSimpleTypeImpl.apply(RestrictionSimp
leTypeImpl.java:66)
at com.sun.tools.xjc.reader.xmlschema.DatatypeBuilder.build(DatatypeBuil
der.java:65)
at com.sun.tools.xjc.reader.xmlschema.SimpleTypeBuilder.buildPrimitiveTy
pe(SimpleTypeBuilder.java:161)
at com.sun.tools.xjc.reader.xmlschema.SimpleTypeBuilder.access$100(Simpl
eTypeBuilder.java:50)
at com.sun.tools.xjc.reader.xmlschema.SimpleTypeBuilder$Functor.checkCon
version(SimpleTypeBuilder.java:201)
at com.sun.tools.xjc.reader.xmlschema.SimpleTypeBuilder$Functor.restrict
ionSimpleType(SimpleTypeBuilder.java:276)
at com.sun.xml.xsom.impl.RestrictionSimpleTypeImpl.apply(RestrictionSimp
leTypeImpl.java:66)
at com.sun.tools.xjc.reader.xmlschema.SimpleTypeBuilder.build(SimpleType
Builder.java:93)
at com.sun.tools.xjc.reader.xmlschema.cs.DefaultClassBinder.simpleType(D
efaultClassBinder.java:130)
at com.sun.xml.xsom.impl.SimpleTypeImpl.apply(SimpleTypeImpl.java:89)
at com.sun.tools.xjc.reader.xmlschema.cs.ClassSelector._bindToClass(Clas
sSelector.java:212)
at com.sun.tools.xjc.reader.xmlschema.cs.ClassSelector.bindToType(ClassS
elector.java:177)
at com.sun.tools.xjc.reader.xmlschema.TypeBuilder.elementDeclFlat(TypeBu
ilder.java:213)
at com.sun.tools.xjc.reader.xmlschema.FieldBuilder.elementDecl(FieldBuil
der.java:384)
at com.sun.xml.xsom.impl.ElementDecl.apply(ElementDecl.java:174)
at com.sun.tools.xjc.reader.xmlschema.FieldBuilder.build(FieldBuilder.ja
va:76)
at com.sun.tools.xjc.reader.xmlschema.DefaultParticleBinder$Builder.part
icle(DefaultParticleBinder.java:399)
at com.sun.tools.xjc.reader.xmlschema.BGMBuilder.applyRecursively(BGMBui
lder.java:490)
at com.sun.tools.xjc.reader.xmlschema.DefaultParticleBinder$Builder.mode
lGroup(DefaultParticleBinder.java:462)
at com.sun.xml.xsom.impl.ModelGroupImpl.apply(ModelGroupImpl.java:80)
at com.sun.tools.xjc.reader.xmlschema.DefaultParticleBinder$Builder.buil
d(DefaultParticleBinder.java:368)
at com.sun.tools.xjc.reader.xmlschema.DefaultParticleBinder$Builder.part
icle(DefaultParticleBinder.java:433)
at com.sun.tools.xjc.reader.xmlschema.DefaultParticleBinder$Builder.buil
d(DefaultParticleBinder.java:371)
at com.sun.tools.xjc.reader.xmlschema.DefaultParticleBinder.build(Defaul
tParticleBinder.java:70)
at com.sun.tools.xjc.reader.xmlschema.ct.FreshComplexTypeBuilder$1.parti
cle(FreshComplexTypeBuilder.java:48)
at com.sun.xml.xsom.impl.ParticleImpl.apply(ParticleImpl.java:68)
at com.sun.tools.xjc.reader.xmlschema.ct.FreshComplexTypeBuilder.build(F
reshComplexTypeBuilder.java:35)
at com.sun.tools.xjc.reader.xmlschema.ct.ComplexTypeFieldBuilder.build(C
omplexTypeFieldBuilder.java:56)
at com.sun.tools.xjc.reader.xmlschema.FieldBuilder.complexType(FieldBuil
der.java:228)
at com.sun.xml.xsom.impl.ComplexTypeImpl.apply(ComplexTypeImpl.java:194)
at com.sun.tools.xjc.reader.xmlschema.FieldBuilder.build(FieldBuilder.ja
va:76)
at com.sun.tools.xjc.reader.xmlschema.cs.ClassSelector.build(ClassSelect
or.java:340)
at com.sun.tools.xjc.reader.xmlschema.cs.ClassSelector.access$000(ClassS
elector.java:54)
at com.sun.tools.xjc.reader.xmlschema.cs.ClassSelector$Binding.build(Cla
ssSelector.java:107)
at com.sun.tools.xjc.reader.xmlschema.cs.ClassSelector.executeTasks(Clas
sSelector.java:240)
at com.sun.tools.xjc.reader.xmlschema.BGMBuilder._build(BGMBuilder.java:
118)
at com.sun.tools.xjc.reader.xmlschema.BGMBuilder.build(BGMBuilder.java:8
0)
at com.sun.tools.xjc.GrammarLoader.annotateXMLSchema(GrammarLoader.java:
424)
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)Hi,
A similar error occur to me twice.
One because pattern specification error (The pattern was incorrectly written)
The other one was because I had in the directory JAVA_HOME\jre\lib\endorsed the files that come from JWSDP_HOME\jaxb\lib.
This files (jaxb-api.jar, jaxb-impl.jar, jaxb-libs.jar, jaxb-xjc.jar) should only be in the directory where they come from JWSDP_HOME\jaxb\lib
If you have them in the JAVA_HOME\jre\lib\endorsed directory try removing them from there.
Hope I help you. -
Error while Validating xml against a schema using jaxp
Hi All,
Following code validates xml against a schema using JAXP .It gives SAXNotRecognizedException error when you run the program.
static final String JAXP_SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
static final String W3C_XML_SCHEMA = "http://www.w3.org/2001/XMLSchema";
SAXParserFactory myFactory = SAXParserFactory.newInstance();
myFactory.setNamespaceAware(true);
myFactory.setValidating(true);
javax.xml.parsers.SAXParser parser;
String filename = "C:/Note.xml";
File xmlFile = new File(filename);
try
DefaultHandler handler = new DefaultHandler();
parser = myFactory.newSAXParser();
parser.setProperty(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
parser.parse(xmlFile, handler);
catch (ParserConfigurationException e)
// TODO Auto-generated catch block
e.printStackTrace();
catch (SAXException e)
// TODO Auto-generated catch block
e.printStackTrace();
catch (IOException e)
// TODO Auto-generated catch block
e.printStackTrace();
Error Details :
org.xml.sax.SAXNotRecognizedException: http://java.sun.com/xml/jaxp/properties/schemaLanguage
at org.apache.xerces.framework.XMLParser.setProperty(XMLParser.java:1682)
at org.apache.xerces.parsers.SAXParser.setProperty(SAXParser.java:770)
at org.apache.xerces.jaxp.SAXParserImpl.setProperty(SAXParserImpl.java:183)
How do i fix the above mentioned problem ?
Thanks in Advance.
AnshValidate with the JAXP DOMParser instead of the JAXP SAXParser.
To validate with a SAXParser use the xerces SAXParser.
thanks,
Deepak -
Error: The Java Runtime in use does not contain a suitable JAXP feature
Hi,
I'm trying to get Eclipse TPTP to work. One of the steps I need to execute is to run a setConfig.bat file. When I ran it, I got the following error:
ERROR: The Java Runtime in use does not contain a suitable JAXP feature
RESOLUTION: Use a JRE which supports the JAXP featureI use Eclipse Europa, and it is using my JDK (actually JRE) 1.6.0_05. That should mean I have JAXP in my JRE (which is confirmed when I search on JAXP from the directory C:\Program Files\Java containing jdk1.6.5_05 and jre1.6.5_05 directories).
Is there something extra I need to do to let Eclipse and TPTP find my JAXP classes?
TIA,
AbelHi,
Even i am getting the same error but i use JRE 1.5.0_14. please let me know if you happen to resolve this.
Thanks in Advance,
Sai -
Error parsing XML file from a HttpServletRequest using JAXP
Hi,
I am trying to generate an XML file from an HttpServletRequest. I am actually using file uploading method in JSP to send the XML file. I think the parser isnt able to correctly identify the XML file from the message body and hence it is giving some strange error messages. Has anyone of u managed to solve this problem ?
Code snippet:
//now build an XML document from the requested input stream
InputStream in = myRequest.getInputStream();
try {
myDocRequest = myParser.parse(in);
} catch (Throwable t) {
throw new Exception("Could not build document",t);
Error message is:
[Fatal Error] :1:1: Content is not allowed in prolog.
java.lang.Exception: Could not build document
at XMLUtil.<init>(XMLUtil.java:91)
at WCS.doPost(WCS.java:44)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:738)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:534)
Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
at XMLUtil.<init>(XMLUtil.java:89)
... 20 more
Actually if i just print out the message, it gives something like this:
-----------------------------7d63dc71b06b2
Content-Disposition: form-data; name="W"; filename="C:\work_projects\Capas.xml"
Content-Type: text/xml
<?xml version="1.0" encoding="UTF-8"?>
<GetCapabilities version="1.0.0" service="wcs">
<section>/WCS_Capabilities/Capability</section>
</GetCapabilities>
-----------------------------7d63dc71b06b2--
Cheers.The ServletInput stream contains this:
-----------------------------7d63dc71b06b2
Content-Disposition: form-data; name="W"; filename="C:\work_projects\Capas.xml"
Content-Type: text/xml
<?xml version="1.0" encoding="UTF-8"?>
i.e., its the HTTP File Upload MIME stuff, followed by the XML. You need to wrap around the input stream something that can decode the HTTP MIME stuff and let you get at the XML itself, i.e., something like: com.orielly.servlet.multipart.MultipartParser (Apache has a similar 'file upload servlet).
Jeremy -
Can't create a JAXB binding for ejb-jar.xml using xjc
Hi all,
I have been trying to build a JAXB binding for EJB deployment descriptors, mainly because I have to update a hand-cranked ejb-jar.xml file on the fly with some additions that have come from a code generator.
I have tried to use
xjc ejb-jar_2_1.xsd j2ee_1_4.xsd ejb-jar_2_1.xsd
xjc on the schema definitions I found at http://java.sun.com/xml/ns/j2ee/ but I can't get it to work. It produces reams of errors, see below for a short extract.
Of course, someone could put me out of my misery and tell me where to find a binding that someone else has done. I can't be the first chimp on the planet that has wanted to do this!
Any help much appreciated.
errors:
[WARNING] warning: "blockDefault" attribute of <schema> is not supported
line 3 of xml.xsd
[WARNING] warning: "finalDefault" attribute of <schema> is not supported
line 3 of xml.xsd
[WARNING] warning: <key> identity constraint will be ignored by JAXB validation
line 117 of j2ee_web_services_client_1_1.xsd
[WARNING] warning: <key> identity constraint will be ignored by JAXB validation
line 115 of ejb-jar_2_1.xsd
[WARNING] warning: <keyref> identity constraint will be ignored by JAXB validation
line 129 of ejb-jar_2_1.xsd
[WARNING] warning: <key> identity constraint will be ignored by JAXB validation
line 145 of ejb-jar_2_1.xsd
[WARNING] warning: <keyref> identity constraint will be ignored by JAXB validation
line 159 of ejb-jar_2_1.xsdException initializing 'oracle.dbtools.raptor.MonitorJDBCAddin' in extension 'Oracle SQL Developer': oracle.classloader.
util.AnnotatedNoClassDefFoundError:
Missing class: oracle.jdbc.OracleDriverThe Oracle driver is not on the classpath. -
I realized recently that my complex type issues might be due to the fact that I was using version 1.6 of JAXB so I switched over to 2.0. I downloaded version 1.5 of the jdsk/jre as well since the documentation seemed to imply version 1.4.2 wont work with JAXB 2.0. I ran the xjc compiler and it didnt raise any errors. However, the resulting packages look very bizarre and every single one of them are flagged in error. In almost every case each package has an import statement that is trying to import itself. And I have all these Syntax error on tokens error message revolving around some @XmlEnumValue function (at least i think its a function).
Am I missing something?Can be very hard to impossible to track down auto sleep issues. Just get PleaseSleep.
http://www.dragonone.com/products/macosx/pleasesleep/
Maybe you are looking for
-
File Sharing With the BEFW11S4 in Vista....
I have two computer connect to my router on a network, Both computers are running Windows Vista. I am able to see each computer on the network map in the network and sharing center. But when I go to the network folder the computers do not apper at al
-
How start, stop and access BAM?
Hi, I have installed BAM and now I do not know how to start and stop the application. Also I am not able to access to the home page. I installed BAM by double clicking the setup.exe file. After following all the installation steps, a new folder has b
-
What I need to do is to use 1 XML file to feed different content to 2 different TextArea fields. I know how to use an XML file to feed text content to a TextArea field. I figured out how to use 1 XML file to feed the same text to 2 different TextArea
-
OEM 9i features, distributed environments, managed regions
after having studied the documentation regarding OEM 9 i'm still wondering if it neccessary to setup one central repository or a repository for each location, which oracle names as managed region. the configuration i'm working on consists of 2 distri
-
Header condition disabled in RFQ
Hi all, 1. In RFQ document header and item condition are not in active. When i go to RFQ header --> Conditions ( it is disabled ) Similarly RFQ item --> conditions ( it is disabled ) 2. In Quotation i cannot enter the header conditions , i can enter