XJC Problems
Hello,
when I try to compile my schema with xjc I get the following:
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.commons.launcher.ChildMain.run(ChildMain.java:269)
Caused by: java.io.IOException: .\test\CON.java: Can't delete previous version
at com.sun.codemodel.writer.FileCodeWriter.getFile(FileCodeWriter.java:64)
at com.sun.codemodel.writer.FileCodeWriter.open(FileCodeWriter.java:48)
at com.sun.codemodel.writer.PrologCodeWriter.open(PrologCodeWriter.java:47)
at com.sun.codemodel.writer.ProgressCodeWriter.open(ProgressCodeWriter.java:40)
at com.sun.codemodel.JPackage.build(JPackage.java:343)
at com.sun.codemodel.JCodeModel.build(JCodeModel.java:157)
at com.sun.tools.xjc.Driver.run(Driver.java:235)
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)
Does anybody know to avoid that?
ThX
Scimm
Hello,
it's not a matter of the build.xml. I solved that with custom-bindings. But I have another problem now: http://forum.java.sun.com/thread.jspa?threadID=593419
ThX
Similar Messages
-
JAXB (XJC) problem with Java 1.4.2_02
Hi,
I am trying to migrate our system to Java version 1.4.2_02 (currently using 1.4.1_02). We use XJC from JAXB to compile XML schema files into java classes. JAXB is packaged in JWSDP (we are using version 1.3). I am currently experiencing a problem whereby if I use java version 1.4.2_02 and run XJC on the xml schema file its not generating any of the inner classes. All classes including inner are generated properly if I am pointing 1.4.1_02.
Just wondering if you came across this problem before and would know of a possible solution.
thanks for your help
ManishI was having this problem as well. I extracted the MSI from the InstallShield and found that it's looking for a property called "SystemFilesLocked" to equal 1. If you pass it as a parameter and give it a value of 0, this error message doesn't appear. I've installed now to 15 W2K desktops without any issues.
The 'silent installation' documentation for this product is sorely lacking. The install string I'm using is below:
j2re-1_4_2_03-windows-i586-p.exe /S /v/qn"ADDLOCAL=jrecore SYSTEMFILESLOCKED=0 CONTROLPANELLOCKED=1 SKDSILENT=1 IEXPLORER=0 SYSTRAY=0 REBOOT=Suppress JAVAUPDATE=0 JAVAJAVAWLOCKED=0 WEBSTARTICON=0 /L C:\TEMP\LogFiles\JRE_JWS_142_03.log"
Hope this helps... -
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. -
Problem fixing XJC Errors ("already defined" in groups)
Hello,
I am using JAXB to generate code for some schemas created by a different group in my project, but I get an error that I kind of understand but don't know exactly how to resolve.
This is a pared-down version of the schema holding only the offending pieces:
MainSchema.xsd
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ns_a="DATASET_A"
xmlns:ns_b="DATASET_B"
xmlns:ns_c="DATASET_C"
xmlns:ns_d="DATASET_D"
xmlns:ns_e="DATASET_E"
xmlns:ns_f="DATASET_F">
<xs:include schemaLocation="BASIC_TYPES.XSD" />
<!-- -->
<xs:import namespace="DATASET_A" schemaLocation="DATASET_A.xsd"/>
<xs:import namespace="DATASET_B" schemaLocation="DATASET_B.xsd"/>
<xs:import namespace="DATASET_C" schemaLocation="DATASET_C.xsd"/>
<xs:import namespace="DATASET_D" schemaLocation="DATASET_D.xsd"/>
<xs:import namespace="DATASET_E" schemaLocation="DATASET_E.xsd"/>
<xs:import namespace="DATASET_F" schemaLocation="DATASET_F.xsd"/>
<xs:complexType name="ReturnGetDataStatusType">
<xs:sequence>
<xs:element name="DATA_LIST">
<xs:complexType>
<xs:sequence maxOccurs="unbounded">
<xs:choice>
<xs:group ref="ns_a:ReturnGetDataItemType" minOccurs="0" maxOccurs="unbounded"/>
<xs:group ref="ns_b:ReturnGetDataItemType" minOccurs="0" maxOccurs="unbounded"/>
<xs:group ref="ns_c:ReturnGetDataItemType" minOccurs="0" maxOccurs="unbounded"/>
<xs:group ref="ns_d:ReturnGetDataItemType" minOccurs="0" maxOccurs="unbounded"/>
<xs:group ref="ns_e:ReturnGetDataItemType" minOccurs="0" maxOccurs="unbounded"/>
<xs:group ref="ns_f:ReturnGetDataItemType" minOccurs="0" maxOccurs="unbounded"/>
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<!-- -->
<xs:complexType name="FileDataType">
<xs:sequence>
<xs:element name="DATA_LIST">
<xs:complexType>
<xs:choice>
<xs:group ref="ns_a:ReturnGetDataItemType" minOccurs="0" maxOccurs="unbounded"/>
<xs:group ref="ns_b:ReturnGetDataItemType" minOccurs="0" maxOccurs="unbounded"/>
<xs:group ref="ns_c:ReturnGetDataItemType" minOccurs="0" maxOccurs="unbounded"/>
<xs:group ref="ns_d:ReturnGetDataItemType" minOccurs="0" maxOccurs="unbounded"/>
<xs:group ref="ns_e:ReturnGetDataItemType" minOccurs="0" maxOccurs="unbounded"/>
<xs:group ref="ns_f:ReturnGetDataItemType" minOccurs="0" maxOccurs="unbounded"/>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:element name="RETURN_GET_DATA" type="ReturnGetDataStatusType"/>
<xs:element name="FILE_DATA" type="FileDataType"/>
</xs:schema>---
When I try to compile this schema and their underlying schemas, I get this error repeated for each "group" attribute of the FileDataType:
C:\dir\temp\fake_DataStore>xjc -d output -p com.company.stuff *.xsd *.XSD | more
parsing a schema...
[ERROR] Property "ReturnGetDataItemType" is already defined. Use <jaxb:property> to resolve this conflict.
line 49 of file:/C:/dir/temp/fake_DataStore/MainSchema.xsd
[ERROR] The following location is relevant to the above error
line 50 of file:/C:/dir/temp/fake_DataStore/MainSchema.xsd
[ERROR] Property "ReturnGetDataItemType" is already defined. Use <jaxb:property> to resolve this conflict.
line 50 of file:/C:/dir/temp/fake_DataStore/MainSchema.xsd
[ERROR] The following location is relevant to the above error
line 51 of file:/C:/dir/temp/fake_DataStore/MainSchema.xsd
[ERROR] Property "ReturnGetDataItemType" is already defined. Use <jaxb:property> to resolve this conflict.
line 51 of file:/C:/dir/temp/fake_DataStore/MainSchema.xsd
[ERROR] The following location is relevant to the above error
line 52 of file:/C:/dir/temp/fake_DataStore/MainSchema.xsd
[ERROR] Property "ReturnGetDataItemType" is already defined. Use <jaxb:property> to resolve this conflict.
line 52 of file:/C:/dir/temp/fake_DataStore/MainSchema.xsd
[ERROR] The following location is relevant to the above error
line 53 of file:/C:/dir/temp/fake_DataStore/MainSchema.xsd
[ERROR] Property "ReturnGetDataItemType" is already defined. Use <jaxb:property> to resolve this conflict.
line 53 of file:/C:/dir/temp/fake_DataStore/MainSchema.xsd
[ERROR] The following location is relevant to the above error
line 54 of file:/C:/dir/temp/fake_DataStore/MainSchema.xsd
Failed to parse a schema.---
It clearly has a problem with using the same group references in two different complexTypes, but I don't know how to use jaxb:property to resolve it.
Do I rename this ReturnGetDataItemType differently in the FileDataType complexType? If so, how?
Thank you for reading. Please let me know if you have any questions.
Edited by: jaylogan on Mar 18, 2010 6:49 PMyou need to pass a bindings file using the -b switch as explained here: http://java.sun.com/webservices/docs/1.5/tutorial/doc/JAXBUsing4.html
-
Hi,
I try to use xjc with my schema, with this command
D:\Travail\WEGinst\CrossSection>C:\jwsdp-1.1\jaxb-1.0\bin\xjc.bat CrossSection.xsd -p CrossSection
I obtain
parsing a schema...
[ERROR] s4s-elt-schema-ns: The namespace of element 'schema' must be from the schema namespace.
line 7 of feature.xsd
the CrossSection.xsd is as follow:
<?xml version="1.0" encoding="UTF-8"?>
<!-- created by Antonio Guillen 22/03/2003 Version 0.0-->
<xs:schema targetNamespace="http://www.opengis.net/gml/cross" xmlns:cross="http://www.opengis.net/gml/cross" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:jxb="http://java.sun.com/xml/ns/jaxb" xmlns:gml="http://www.opengis.net/gml" elementFormDefault="qualified" version="2.05">
<xs:import namespace="http://www.opengis.net/gml" shemaLocation="feature.xsd"/>
and feature.xsd is as follow:
<?xml version="1.0" encoding="UTF-8"?>
<!-- File: feature.xsd -->
<schema targetNamespace="http://www.opengis.net/gml"
xmlns:gml="http://www.opengis.net/gml"
xmlns="http://www.w3.org/2000/10/XMLSchema"
elementFormDefault="qualified"
version="2.05">
<!-- include constructs from the GML Geometry schema -->
<include schemaLocation="geometry.xsd"/>
I don't understand why i have this problem can any body help me.
Thanks very much
AntonioAdd a 'xs' prefix to the schema element in feature.xsd & include a xmlns:xs namespace in the xs:schema element.
<xs:schema targetNamespace="http://www.opengis.net/gml"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:gml="http://www.opengis.net/gml"
xmlns="http://www.w3.org/2000/10/XMLSchema"
elementFormDefault="qualified"
version="2.05"> -
JAXB XJC class generation problem
Hi!, I�m trying to generate the classes for the IMS-LearningDesign schema:
xjc -d src_temp -p edu.eci.ims.ld IMS_LD_Level_A.xsd
parsing a schema...
[ERROR] Attempt to create a property having the same name as the reserved word "Class".
line 177 of IMS_LD_Level_A.xsd
The problem is that schema has a 'class' attribute, and that`s a reserved word for JAXB.
When the schema is modified (add a character to the attribute name - oclass) it works fine, but I need to keep the standard specification (to parse standard XML - LD files). What can I do to solve this problem without modifying the schema?I'd suggest you repost this to the JAXB users mailing list at Java.Net. That list is monitored by the JAXB implementation team.
Check http://jaxb.dev.java.net/ -
Xjc ,dtd, xjs giving problem "document not well formed"
I have started the thread again.
Anyway.
I have an item.dtd file (same as in sample tutorial).. I have reduced some components to simplify..when it was not working
item.dtd file:
<!ELEMENT ITEM (NAME)>
<!ELEMENT NAME (#PCDATA)>
item.xjs file:
<xml-java-binding-schema>
<element name="ITEM" type="class" root="true"/>
</xml-java-binding-schema>
when i run from command prompt:
C:\RBML\xjc item.dtd item.xjs
It throws up an error
The markup in the document preceding the root element must be well-formed. line 1 of item.dtd
I am not able to understand the error..how it can be rectified.
PLEASE HELP..!
I have tried adding the following line to item.dtd but doesnot work
<?xml version="1.0" encoding ="utf-8"?>
I had also tried removing redundant spaces and blank lines.
PLEASE HELP
Thanks
GaganI'm have done the same for schemas.But giving the error as
"[ERROR] Unexpected <xml-java-binding-schema> appears at line 1 column 26
line 1 of item.xjs"
my xjs file is
"<xml-java-binding-schema>
<element name="item_list" type="class" root="true"/>
<element name="item_info" type="class"/>
</xml-java-binding-schema>"
andmy schema is
"<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="item_list">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="item_info" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="name" type="xsd:string"/>
<xsd:element name="price" type="xsd:decimal"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>".
Pls help me -
I have downloaded JAXB from java.sun.com through FTP and HTTP. When i tried to extract the zip file, i found the xjc compiler is existing as a file instead of an .exe file.Becoz of which i couldn't able to work with it.Pls help me out asap.
regards
MeenaExtract the following Jar files from jaxb-1.0-ea\lib to dircetroy where you want to keep your xml and generated java classes.
jxb-rt-1.0-ea
jaxb-xjc-1.0-ea
and then use the following commnad to run it:
java com.sun.tools.xjc.Main abc.dtd dcf.xjc
iam able generate the Java class with this commanad. -
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 am having a strange problem with Tomcat and axis. I have a webservice that uses axis2 for wsdl2java class generation. When I compile my project in maven a Test is performed. During the test a glassfish server is established and the project is deployed -everything work great with the expected results. However when I try to deploy the webservice on tomcat it has some problems.
At first I tried to call axis code in a POST method that takes a MultiPart message. The code is as below:
*@Path("identifyWavestream")*
*@POST*
*@Consumes(MediaType.MULTIPART_FORM_DATA)*
*@Produces(MediaType.APPLICATION_XML)*
*public String multipartTest(com.sun.jersey.multipart.MultiPart multiPart) throws Exception {*
*// get first body part (index 0)*
*//tomcat shows that the first error is here (line 122 is the nest one with bodypart)*
BodyPart bp = multiPart.getBodyParts().get(0);
BodyPartEntity bodyPartEntity = (BodyPartEntity) bp.getEntity();
InputStream stream = bodyPartEntity.getInputStream();
*//the rest of the code either saves the incoming file or implements the wsdl2java axis interface - neither works.*
And the tomcat error is:
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
java.util.ArrayList.RangeCheck(Unknown Source)
java.util.ArrayList.get(Unknown Source)
com.webserv.rest.resources.SearchResource.test.multipartTest(SearchResource.java:122)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
com.sun.jersey.server.impl.model.method.dispatch.EntityParamDispatchProvider$TypeOutInvoker._dispatch(EntityParamDispatchProvider.java:138)
com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:67)
com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:124)
com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:111)
com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:71)
com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:111)
com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:63)
com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:555)
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:514)
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:505)
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:359)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
It was strange to me since this simple approach of handling a Multipart method worked for me earlier. Then I decided skip the handling of multipart method and just call the axis code. But the results also caused an error. I then tried to call the axis code in a simple @GET method (to cross out any issues regarding the multipart) and the result where the same. Again everything works on the maven- glassfish test. In this case the tomcat error is the following:
javax.servlet.ServletException: java.lang.NoSuchMethodError: org.apache.commons.httpclient.HttpConnectionManager.getParams()Lorg/apache/commons/httpclient/params/HttpConnectionManagerParams;
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:361)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
root cause
com.sun.jersey.api.container.MappableContainerException: java.lang.NoSuchMethodError: org.apache.commons.httpclient.HttpConnectionManager.getParams()Lorg/apache/commons/httpclient/params/HttpConnectionManagerParams;
com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:74)
com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:124)
com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:111)
com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:71)
com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:111)
com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:63)
com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:555)
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:514)
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:505)
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:359)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
root cause
java.lang.NoSuchMethodError: org.apache.commons.httpclient.HttpConnectionManager.getParams()Lorg/apache/commons/httpclient/params/HttpConnectionManagerParams;
org.apache.axis2.transport.http.AbstractHTTPSender.initializeTimeouts(AbstractHTTPSender.java:454)
org.apache.axis2.transport.http.AbstractHTTPSender.getHttpClient(AbstractHTTPSender.java:514)
org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:156)
org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75)
org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:371)
org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:209)
org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:448)
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:401)
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228)
org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
com.webserv.rest.webapp.IntSoapServiceStub.getServerData(IntSoapServiceStub.java:2447)
com.webserv..rest.resources.AIntSoapImpl.getServerData(AIntSoapImpl.java:112)
com.webserv..rest.resources.SearchResource.test.pingTest(SearchResource.java:167)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
com.sun.jersey.server.impl.model.method.dispatch.EntityParamDispatchProvider$TypeOutInvoker._dispatch(EntityParamDispatchProvider.java:138)
com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:67)
com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:124)
com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:111)
com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:71)
com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:111)
com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:63)
com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:555)
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:514)
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:505)
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:359)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
I think it is also a good ide to post the pom.xml file :
Edited by: 803864 on 2010-10-21 00:30I think it is also a good ide to post the pom.xml file:
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<modelVersion>4.0.0</modelVersion>+
+<groupId>com.myProjects</groupId>+
+<artifactId>audioid-rest-interface</artifactId>+
+<packaging>war</packaging>+
+<name>AudioID Rest Interface</name>+
+<version>0.1</version>+
+<dependencies>+
+<!--+
+<dependency>+
+<groupId>com.sun.tools.xjc.maven2</groupId>+
+<artifactId>maven-jaxb-plugin</artifactId>+
+<version>1.1</version>+
+<scope>test</scope>+
+</dependency>+
+<dependency>+
+<groupId>com.sun.jersey</groupId>+
+<artifactId>jersey-client</artifactId>+
+<version>1.0.1</version>+
+</dependency>+
+<dependency>+
+<groupId>com.sun.jersey.contribs</groupId>+
+<artifactId>jersey-multipart</artifactId>+
+<version>1.0.1</version>+
+</dependency>+
+<dependency>+
+<groupId>com.sun.grizzly</groupId>+
+<artifactId>grizzly-servlet-webserver</artifactId>+
+<version>1.9.0</version>+
+<scope>test</scope>+
+</dependency>-->+
+<dependency>+
+<groupId>com.sun.jersey.contribs</groupId>+
+<artifactId>jersey-multipart</artifactId>+
+<version>1.0.1</version>+
+</dependency>+
+<dependency>+
+<groupId>com.sun.jersey</groupId>+
+<artifactId>jersey-client</artifactId>+
+<version>1.0.1</version>+
+</dependency>+
+<dependency>+
+<groupId>com.sun.jersey</groupId>+
+<artifactId>jersey-bundle</artifactId>+
+<version>1.0.1</version>+
+</dependency>+
+<dependency>+
+<groupId>commons-logging</groupId>+
+<artifactId>commons-logging</artifactId>+
+<version>1.0.4</version>+
+</dependency>+
+<dependency>+
+<groupId>commons-collections</groupId>+
+<artifactId>commons-collections</artifactId>+
+<version>3.1</version>+
+</dependency>+
+<dependency>+
+<groupId>org.slf4j</groupId>+
+<artifactId>slf4j-log4j12</artifactId>+
+<version>1.5.6</version>+
+</dependency>+
+<dependency>+
+<groupId>junit</groupId>+
+<artifactId>junit</artifactId>+
+<version>3.8.2</version>+
+<scope>test</scope>+
+</dependency>+
+<dependency>+
+<groupId>org.glassfish.distributions</groupId>+
+<artifactId>web-all</artifactId>+
+<version>10.0-build-20080430</version>+
+<scope>test</scope>+
+</dependency>+
+<dependency>+
+<groupId>org.glassfish.embedded</groupId>+
+<artifactId>gf-embedded-api</artifactId>+
+<version>1.0-alpha-4</version>+
+<scope>test</scope>+
+</dependency>+
+<dependency>+
+<groupId>com.sun.jersey</groupId>+
+<artifactId>jersey-server</artifactId>+
+<version>1.0.3.1</version>+
+<scope>test</scope>+
+</dependency>+
+<dependency>+
+<groupId>com.sun.jersey.contribs</groupId>+
+<artifactId>maven-wadl-plugin</artifactId>+
+<version>1.0.3.1</version>+
+</dependency>+
+<dependency>+
+<groupId>org.hibernate</groupId>+
+<artifactId>hibernate</artifactId>+
+<version>3.2.5.ga</version>+
+<exclusions>+
+<exclusion>+
+<groupId>javax.transaction</groupId>+
+<artifactId>jta</artifactId>+
+</exclusion>+
+<exclusion>+
+<groupId>cglib</groupId>+
+<artifactId>cglib</artifactId>+
+</exclusion>+
+</exclusions>+
+</dependency>+
+<dependency>+
+<groupId>org.apache.axis2</groupId>+
+<artifactId>axis2</artifactId>+
+<version>1.4.1</version>+
+</dependency>+
+<!-- <dependency> -->+
+<dependency>+
+<groupId>org.apache.axis2</groupId>+
+<artifactId>axis2-aar-maven-plugin</artifactId>+
+<version>1.4.1</version>+
+<scope>test</scope>+
+</dependency>+
+<dependency>+
+<groupId>org.apache.axis2</groupId>+
+<artifactId>axis2-java2wsdl</artifactId>+
+<version>1.4.1</version>+
+<scope>test</scope>+
+</dependency>+
+<dependency>+
+<groupId>org.apache.axis2</groupId>+
+<artifactId>axis2-xmlbeans</artifactId>+
+<version>1.4.1</version>+
+</dependency>+
+<!-- <dependency> -->+
+<dependency>+
+<groupId>com.sun.xml.bind</groupId>+
+<artifactId>jaxb-impl</artifactId>+
+<version>2.1.12</version>+
+</dependency>+
+<dependency>+
+<groupId>cglib</groupId>+
+<artifactId>cglib-nodep</artifactId>+
+<version>2.1_3</version>+
+</dependency>+
+</dependencies>+
+<build>+
+<finalName>audioid-rest-interface</finalName>+
+<plugins>+
+<plugin>+
+<!-- This class is just generated for wadl support!!! -->+
+<!-- Take care that folder ../music-dna-core is existing -->+
+<groupId>com.sun.tools.xjc.maven2</groupId>+
+<artifactId>maven-jaxb-plugin</artifactId>+
+<version>1.1</version>+
+<executions>+
+<execution>+
+<phase>generate-sources</phase>+
+<goals>+
+<goal>generate</goal>+
+</goals>+
+</execution>+
+</executions>+
+<configuration>+
+<generatePackage> com.webserv.wsparameters</generatePackage>+
+<schemaDirectory>../audioid-rest-interface/src/main/resources+
+</schemaDirectory>+
+<includeSchemas>+
+<includeSchema>**/*.xsd</includeSchema>+
+</includeSchemas>+
+<extension>true</extension>+
+<strict>false</strict>+
+<verbose>false</verbose>+
+</configuration>+
+</plugin>+
+<plugin>+
+<groupId>org.apache.maven.plugins</groupId>+
+<artifactId>maven-javadoc-plugin</artifactId>+
+<!-- <version>2.6</version> -->+
+<executions>+
+<execution>+
+<goals>+
+<goal>javadoc</goal>+
+</goals>+
+<phase>compile</phase>+
+</execution>+
+</executions>+
+<configuration>+
+<encoding>UTF-8</encoding>+
+<verbose>false</verbose>+
+<show>public</show>+
+<subpackages> com.webserv.rest.rest.resources: com.webserv.rest.rest.commons: com.webserv.wsparameters+
+</subpackages>+
+<doclet>com.sun.jersey.wadl.resourcedoc.ResourceDoclet</doclet>+
+<docletPath>${path.separator}${project.build.outputDirectory}+
+</docletPath>+
+<docletArtifacts>+
+<docletArtifact>+
+<groupId>com.sun.jersey.contribs</groupId>+
+<artifactId>wadl-resourcedoc-doclet</artifactId>+
+<version>1.0.3.1</version>+
+</docletArtifact>+
+<docletArtifact>+
+<groupId>com.sun.jersey</groupId>+
+<artifactId>jersey-server</artifactId>+
+<version>1.0.3.1</version>+
+</docletArtifact>+
+<docletArtifact>+
+<groupId>xerces</groupId>+
+<artifactId>xercesImpl</artifactId>+
+<version>2.6.1</version>+
+</docletArtifact>+
+</docletArtifacts>+
+<additionalparam>-output+
+${project.build.outputDirectory}/resourcedoc.xml</additionalparam>+
+<useStandardDocletOptions>false</useStandardDocletOptions>+
+</configuration>+
+</plugin>+
+<plugin>+
+<groupId>com.sun.jersey.contribs</groupId>+
+<artifactId>maven-wadl-plugin</artifactId>+
+<version>1.0.3.1</version>+
+<executions>+
+<execution>+
+<id>generate</id>+
+<goals>+
+<goal>generate</goal>+
+</goals>+
+<phase>compile</phase>+
+</execution>+
+</executions>+
+<configuration>+
+<wadlFile>${project.build.outputDirectory}/application.wadl+
+</wadlFile>+
+<formatWadlFile>true</formatWadlFile>+
+<baseUri>http://192.168.2.149:8080/${project.build.finalName}+
+</baseUri>+
+<packagesResourceConfig>+
+<param> com.webserv.rest.resources</param>+
+</packagesResourceConfig>+
+<wadlGenerators>+
+<wadlGeneratorDescription>+
+<className>com.sun.jersey.server.wadl.generators.WadlGeneratorApplicationDoc+
+</className>+
+<properties>+
+<property>+
+<name>applicationDocsFile</name>+
+<value>${basedir}/src/main/doc/application-doc.xml</value>+
+</property>+
+</properties>+
+</wadlGeneratorDescription>+
+<wadlGeneratorDescription>+
+<className>com.sun.jersey.server.wadl.generators.WadlGeneratorGrammarsSupport+
+</className>+
+<properties>+
+<property>+
+<name>grammarsFile</name>+
+<value>${basedir}/src/main/doc/application-grammars.xml</value>+
+</property>+
+</properties>+
+</wadlGeneratorDescription>+
+<wadlGeneratorDescription>+
+<className>com.sun.jersey.server.wadl.generators.resourcedoc.WadlGeneratorResourceDocSupport+
+</className>+
+<properties>+
+<property>+
+<name>resourceDocFile</name>+
+<value>${project.build.outputDirectory}/resourcedoc.xml</value>+
+</property>+
+</properties>+
+</wadlGeneratorDescription>+
+</wadlGenerators>+
+</configuration>+
+</plugin>+
+<plugin>+
+<groupId>org.codehaus.mojo</groupId>+
+<artifactId>exec-maven-plugin</artifactId>+
+<version>1.1</version>+
+<executions>+
+<execution>+
+<goals>+
+<goal>java</goal>+
+</goals>+
+</execution>+
+</executions>+
+<configuration>+
+<mainClass>com.sun.jersey.samples.generatewadl.Main</mainClass>+
+</configuration>+
+</plugin>+
+<plugin>+
+<groupId>org.apache.maven.plugins</groupId>+
+<artifactId>maven-compiler-plugin</artifactId>+
+<inherited>true</inherited>+
+<configuration>+
+<source>1.5</source>+
+<target>1.5</target>+
+<!--+
exclude temporary types that are only needed for wadl and doc
generation
-->
+<!--+
+<excludes> <exclude>com/webserv/types/temporary/**</exclude>+
+<exclude>com/webserv/rest/commons/Examples.java</exclude>+
+</excludes>+
-->
+</configuration>+
+</plugin>+
+<plugin>+
+<groupId>org.jvnet.jaxb2.maven2</groupId>+
+<artifactId>maven-jaxb2-plugin</artifactId>+
+<executions>+
+<execution>+
+<goals>+
+<goal>generate</goal>+
+</goals>+
+</execution>+
+</executions>+
+</plugin>+
+<plugin>+
+<groupId>org.apache.axis2</groupId>+
+<artifactId>axis2-wsdl2code-maven-plugin</artifactId>+
+<version>1.4.1</version>+
+<executions>+
+<execution>+
+<id>generate reco core</id>+
+<goals>+
+<goal>wsdl2code</goal>+
+</goals>+
+<configuration>+
+<packageName>com.webserv.rest.webapp</packageName>+
+<wsdlFile>src/main/java/com/webserv/wsdl/web.wsdl</wsdlFile>+
+<databindingName>adb</databindingName>+
+</configuration>+
+</execution>+
+</executions>+
+</plugin>+
+<plugin>+
+<groupId>com.sun.tools.xjc.maven2</groupId>+
+<artifactId>maven-jaxb-plugin</artifactId>+
+<version>1.1</version>+
+<executions>+
+<execution>+
+<goals>+
+<goal>generate</goal>+
+</goals>+
+</execution>+
+</executions>+
+<configuration>+
+<generatePackage>com.webserv.wsparameters</generatePackage>+
+<schemaDirectory>src/main/xsd</schemaDirectory> <includeSchemas>+
+<includeSchema>**/*.xsd</includeSchema> </includeSchemas>+
+<extension>true</extension>+
+<strict>false</strict>+
+<verbose>true</verbose>+
+</configuration>+
+</plugin>+
+</plugins>+
+</build>+
+<profiles>+
+<profile>+
+<id>jdk-1.5</id>+
+<activation>+
+<jdk>1.5</jdk>+
+</activation>+
+<dependencies>+
+<dependency>+
+<groupId>com.sun.xml.bind</groupId>+
+<artifactId>jaxb-impl</artifactId>+
+<version>2.1.10</version>+
+</dependency>+
+</dependencies>+
+<build>+
+<plugins>+
+<plugin>+
+<groupId>org.apache.maven.plugins</groupId>+
+<artifactId>maven-javadoc-plugin</artifactId>+
+<configuration>+
+<docletArtifacts>+
+<docletArtifact>+
+<groupId>com.sun.jersey.contribs</groupId>+
+<artifactId>maven-wadl-plugin</artifactId>+
+<version>1.0.3.1</version>+
+</docletArtifact>+
+<docletArtifact>+
+<groupId>com.sun.jersey.contribs</groupId>+
+<artifactId>wadl-resourcedoc-doclet</artifactId>+
+<version>1.0.3.1</version>+
+</docletArtifact>+
+<docletArtifact>+
+<groupId>com.sun.jersey</groupId>+
+<artifactId>jersey-server</artifactId>+
+<version>1.0.3.1</version>+
+</docletArtifact>+
+<docletArtifact>+
+<groupId>xerces</groupId>+
+<artifactId>xercesImpl</artifactId>+
+<version>2.6.1</version>+
+</docletArtifact>+
+<docletArtifact>+
+<groupId>javax.xml.bind</groupId>+
+<artifactId>jaxb-api</artifactId>+
+<version>2.1</version>+
+</docletArtifact>+
+<docletArtifact>+
+<groupId>javax.xml</groupId>+
+<artifactId>jaxb-impl</artifactId>+
+<version>2.1</version>+
+</docletArtifact>+
+<docletArtifact>+
+<groupId>javax.activation</groupId>+
+<artifactId>activation</artifactId>+
+<version>1.1</version>+
+</docletArtifact>+
+<docletArtifact>+
+<groupId>javax.xml.stream</groupId>+
+<artifactId>stax-api</artifactId>+
+<version>1.0</version>+
+</docletArtifact>+
+</docletArtifacts>+
+</configuration>+
+</plugin>+
+</plugins>+
+</build>+
+</profile>+
+<profile>+
+<id>xsltproc</id>+
+<activation>+
+<file>+
+<exists>../xsltproc_win32/xsltproc.exe</exists>+
+</file>+
+</activation>+
+<build>+
+<plugins>+
+<!-- Create/generate the application.html using xsltproc -->+
+<!-- Create/generate the application.html using xsltproc -->+
+<plugin>+
+<groupId>org.codehaus.mojo</groupId>+
+<artifactId>exec-maven-plugin</artifactId>+
+<version>1.1</version>+
+<executions>+
+<execution>+
+<id>copy-docs-to-builddir</id>+
+<goals>+
+<goal>exec</goal>+
+</goals>+
+<phase>compile</phase>+
+<configuration>+
+<executable>copy</executable>+
+<commandlineArgs>src\\main\\doc\\*.* target\\classes+
+</commandlineArgs>+
+</configuration>+
+</execution>+
+<execution>+
+<id>prepare-xsltproc</id>+
+<goals>+
+<goal>exec</goal>+
+</goals>+
+<phase>package</phase>+
+<configuration>+
+<executable>copy</executable>+
+<commandlineArgs>..\\audioid-rest-interface\\src\\main\\resources\\*.xsd+
target\\classes</commandlineArgs>
+</configuration>+
+</execution>+
+<execution>+
+<id>exec-xsltproc: target/application.html</id>+
+<goals>+
+<goal>exec</goal>+
+</goals>+
+<phase>package</phase>+
+<configuration>+
+<!--<executable>xsltproc</executable>-->+
+<executable>../xsltproc_win32/xsltproc.exe</executable>+
+<commandlineArgs>-o target/application.html+
src/main/doc/wadl_documentation.xsl
target/classes/application.wadl</commandlineArgs>
+</configuration>+
+</execution>+
+</executions>+
+</plugin>+
+</plugins>+
+</build>+
+</profile>+
+</profiles>+
+<pluginRepositories>+
+<pluginRepository>+
+<id>maven2-repository.dev.java.net</id>+
+<name>Java.net Repository for Maven</name>+
+<url>http://download.java.net/maven/2/</url>+
+<layout>default</layout>+
+</pluginRepository>+
+<pluginRepository>+
+<id>maven-repository.dev.java.net</id>+
+<name>Java.net Maven 1 Repository (legacy)</name>+
+<url>http://download.java.net/maven/1</url>+
+<layout>legacy</layout>+
+</pluginRepository>+
+</pluginRepositories>+
+<repositories>+
+<repository>+
+<id>maven2-repository.dev.java.net</id>+
+<name>Java.net Repository for Maven</name>+
+<url>http://download.java.net/maven/2/</url>+
+<layout>default</layout>+
+</repository>+
+<repository>+
+<id>maven-repository.dev.java.net</id>+
+<name>Java.net Maven 1 Repository (legacy)</name>+
+<url>http://download.java.net/maven/1</url>+
+<layout>legacy</layout>+
+</repository>+
+<repository>+
+<id>glassfish-repository</id>+
+<name>Java.net Repository for Glassfish</name>+
+<url>http://download.java.net/maven/glassfish</url>+
+</repository>+
+</repositories>+
+</project>+
Can anyonr contribute? -
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. -
Upgrading to JAXB/JWSDP1.3 from JAXB/JWSDP 1.2 -- problems
I am seeing 2 problems after upgrading to the JAXB found in WSDP 1.3 (from 1.2)
We are using JAXB in a client/server style app where the server is accessed via a web interface and the client is delivered via Java Web Start (JWS). Both the server and client use JAXB-generated classes.
We have an ant build.xml file that invokes xjc and this was working for us as expected.
For the JWS piece, we need to sign the jars we use and for testing purposes we were self-signing them, including the jar files needed for JAXB also self-signed. This is also coordinated through an ant task.
After replacing the jar files in our lib area with the ones from my recent download of the 1.3 version of JAXB the following happens.
1. I am seeing compiler deprecation warnings for the generated code -- this did not happen in our use of JAXB from 1.2. For example:
[javac] /Users/jjs/Projects/SGS-Install-Fixed/sgs/src/com/gestalt/sgs/uobdif/impl/runtime/SAXMarshaller.java:259: warning: ERR_MISSING_OBJECT in com.sun.xml.bind.marshaller.Messages has been deprecated
[javac] Messages.format(Messages.ERR_MISSING_OBJECT), null,
[javac] ^
I am using Java 1.4.1 on Max OS X (I know... not supported but this doesn't seem like a platform dependency) and these warnings go away if I revert back to the JAXB jars from the 1.2 release of WSDP.
2. These are only warnings, so my build proceeds with ant. But, when I get to the jar signing step I see:
[signjar] Signing Jar : /Users/jjs/Projects/SGS-Install-Fixed/sgs/lib/jaxb-libs.jar
[signjar] jarsigner: unable to sign jar: java.util.zip.ZipException: invalid entry compressed size (expected 63854 but got 19845 bytes)
I looked at the jar file using the jar command and there are entries there:
4038 Wed Dec 03 22:16:20 EST 2003 META-INF/MANIFEST.MF
3303 Wed Dec 03 22:16:20 EST 2003 META-INF/SUN_MICR.RSA
3780 Wed Dec 03 22:16:20 EST 2003 META-INF/SUN_MICR.SF
0 Wed Dec 03 22:16:20 EST 2003 META-INF/pack.properties
that suggest to me that perhaps the jar is now sigend by Sun and therefore can't be signed again. If I look at the corresponding jar from the JAXB/1.2, these SUN_MICR entries do not appear.
Is this assumption correct? Can I deliver my app through web start with my apps own jars self-signed and the JAXB jars signed by Sun? I suppose I can un-jar the JAXB jars, remove the manifest material and then re-jar the files and sign those. I expect this might work.
I am looking to share migration experiences (1.2 to 1.3) and to see what work-arounds there might be.
Thanks
JimReplying to my own post.
It seems that with the JWSDP 1.3 release, most (if not all) of the included jars are signed by Sun. You can NOT include jars with different signatures in the same web start application -- that's the error I get when I tried to do this.
This means that if I want to package my jars using a self-signed certificate, I have to first un-jar all of the JAXB lib jars I want to include, get rid of the parts of the manifest that deal with signing, re-jar them and then sign all of the jars in my web start app using my own cert. More work for me, but not a show-stopper.
I still am not sure why I am getting deprecated warnings from javac though.
Jim -
Problem validating an XML document with a schema containing xs:include
I have a problem using an include statement in xsd. I try to include another
schema by using the include statement:
<xsd:include schemaLocation="../../XXX.xsd"/>
and get the xjc error:
s4s-att-invalid-value: Invalid attribute value for 'schemaLocation' in element 'include': cvc-datatype-valid.1.2.1.
Can anybody give me a hint what goes wrong here? THANKS!!!!
ayacheYour schemaLocation value is not a URI? To me, it looks like the value should conform to this:
http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/datatypes.html#anyURI
I will let you read all those specs to see whether that is your problem. -
How to marshal List Source using JAXB and xjc?
Hi all,
I'm having problems to marshal objects of xjc generated java classes to xml output. In detail I am facing problems to use a list of sources (List<javax.xml.transform.Source>) that's been generated.
The schema I am using is:
<xs:complexType name="tTestAttachment">
<xs:sequence>
<xs:element name="textXML" type="xs:base64Binary" xmime:expectedContentTypes="text/xml" maxOccurs="unbounded" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:element name="TestAttachment" type="tTestAttachment" />
...By using xjc the java classes are generated without problems. The expectedContentTypes="text/xml" results the generation of a List<Source> parameter for the class.
public class TTestAttachment {
@XmlMimeType("text/xml")
protected List<Source> textXML;
...Now I want to test the generated classes and marshal an object I created by the following code
StreamSource ssrc = new StreamSource("file:D:/temp/test.xml");
attachment.getTextXML().add(ssrc);
attachment.getTextXML().add(ssrc);
ObjectFactory objFactory = new ObjectFactory();
JAXBContext jc = JAXBContext.newInstance(TTestAttachment.class);
Marshaller marshaller = jc.createMarshaller();
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,Boolean.TRUE);
JAXBElement<TTestAttachment> jaxbelem = objFactory.createTestAttachment(attachment);
marshaller.marshal(jaxbelem, new PrintWriter(System.out));
...But as return I just receive an error message, that StreamSource is not known to the context:
javax.xml.bind.MarshalException
- with linked exception:
[javax.xml.bind.JAXBException: class javax.xml.transform.stream.StreamSource nor any of its super class is known to this context.]
...So now I made it known to the JAXBContext by adding it as parameter:
JAXBContext jc = JAXBContext.newInstance(TTestAttachment.class);With the result, that I get an output but not as expected with content of the source inline but with the link to it.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:TestAttachment xmlns:ns2="http://www.example.com/schema01">
<ns2:textXML xsi:type="streamSource" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<systemId>file:D:/temp/test.xml</systemId>
</ns2:textXML>
<ns2:textXML xsi:type="streamSource" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<systemId>file:D:/temp/test.xml</systemId>
</ns2:textXML>
</ns2:TestAttachment>A second idea was to leave the JAXBContext as it is and add the annotation @XmlList to the attribute of the generated java class. But that also does not lead to the expected result. It included the content of the source now but whitespace separated and not as single objects. The expected result should look some like this:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TestAttachment xmlns="http://www.example.com/schema01">
<textXML>PD94...sbzwvbWVzc2FnZT4=</textXML>
<textXML>PD94...sbzwvbWVzc2FnZT4=</textXML>
</TestAttachment>By the way - when I'm using a single "text/xml" mime type element (maxOccurs="1") in the based schema everything works fine. xjc generates a single attribute of type javax.transform.Source and the marshalling works out the expected way.
Any suggestions on how to marshal the objects correctly?
- Thanks in advanceHope this link help you -
http://chakkaradeep.com/index.php/autohosted-sharepoint-apps-deep-dive-part-2/
Also check this link, About Autohosted Apps Preview program
http://blogs.msdn.com/b/calvarro/archive/2014/05/20/about-autohosted-apps-preview-program.aspx
For production, it is recommended to convert Auto Hosted to Provider Hosted App, so better prepared for it now.
http://msdn.microsoft.com/EN-US/library/office/dn722449(v=office.15).aspx
Hope this helps!
Ram - SharePoint Architect
Blog - SharePointDeveloper.in
Please vote or mark your question answered, if my reply helps you
Maybe you are looking for
-
Function Module to find the Diff bt Two Times : O/p : Hours:Minutes only
Hi All, Wud you plz let me know the Function Module to find the Difference between two times. Input Time1( Hours:Minutes:Seconds) Time2 ( Hours:Minutes:Seconds) Need Output in Hours:Minutes only . ( No seconds Needed ) Thanks, N.L.Narayana
-
Problem with AD Synchronisation - Any Ideas
We are in the process of migrating from our 4.5WS portal to G6 and thought we were doing OK until we tried to run our AD Authentication source. Although all the users & groups appear in our G6 portal and we can log on to the portal using our AD crede
-
MBP Won't sleep when the screen/lid closes...
I have had my MBP for almost a year now and my AppleCare is about to expire... Recently when I close the screen the computer will continue to run and operate as if it was never closed and will not sleep. I took it to the Apple store and they did an S
-
Multimedia audio controller driver for windows 7 on compaq presario r3000
I installed Windows 7 on Laptop Compaq Presario R3000. Everything is fine, however, multi media controller driver was not installed. I would appreciate if you let me know where I can get it. I have Driver CD for Windows XP that came with my computer.
-
No more Data to read from socket from SQL Developer
Hi, When I run the below query from SQL Developer, I get "No more data to be read from socket" error. The Oracle trace shows "Address not mapped". select LDateDayPrec, LDateMonPrec, LDateOrder, LDateOrder_cd, LDateSep, LDateYearPrec, LanguageCode, La