Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error while parsing schema

 
aneesh veetile
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi,

I am using maven for build. while running the maven build i am getting the following error

[ERROR] Error while parsing schema(s).Location [ file:/C:/aneesh/test/test-schemas-jar/src/main/resources/Domain/XML_V0100.xsd{19,88}].
org.xml.sax.SAXParseException: src-resolve: Cannot resolve the name 'u:Service_Request' to a(n) 'element declaration' component.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.xs.traversers.XSDHandler.reportSchemaError(Unknown Source)
at org.apache.xerces.impl.xs.traversers.XSDHandler.getGlobalDecl(Unknown Source)
at org.apache.xerces.impl.xs.traversers.XSDElementTraverser.traverseLocal(Unknown Source)
at org.apache.xerces.impl.xs.traversers.XSDHandler.traverseLocalElements(Unknown Source)
at org.apache.xerces.impl.xs.traversers.XSDHandler.parseSchema(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaLoader.loadGrammar(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaLoader.loadGrammar(Unknown Source)
at org.apache.xerces.jaxp.validation.XMLSchemaFactory.newSchema(Unknown Source)
at com.sun.tools.xjc.reader.xmlschema.parser.SchemaConstraintChecker.check(SchemaConstraintChecker.java:106)
at com.sun.tools.xjc.ModelLoader.loadXMLSchema(ModelLoader.java:358)
at com.sun.tools.xjc.ModelLoader.load(ModelLoader.java:172)
at com.sun.tools.xjc.ModelLoader.load(ModelLoader.java:118)
at org.jvnet.mjiip.v_2_2.XJC22Mojo.loadModel(XJC22Mojo.java:45)
at org.jvnet.mjiip.v_2_2.XJC22Mojo.doExecute(XJC22Mojo.java:35)
at org.jvnet.mjiip.v_2_2.XJC22Mojo.doExecute(XJC22Mojo.java:22)
at org.jvnet.jaxb2.maven2.RawXJC2Mojo.doExecute(RawXJC2Mojo.java:282)
at org.jvnet.jaxb2.maven2.RawXJC2Mojo.execute(RawXJC2Mojo.java:147)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:105)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:577)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:324)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:247)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:104)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:427)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:157)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:121)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
xsd snapshot as follows:
<xs:choice>
<xs:element ref="u:Service_Request" minOccurs="0"/>
<xs:element ref="u:Service_Response" minOccurs="0"/>
</xs:choice>

and the namespace is correctly defined. i have validated the same using xml spy. validation was successfuly. I am not sure why it is failing when running the maven build. Could you please help meout.

Regards,
Aneesh
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which plugin are you using? Is it this one: http://jaxb.java.net/jaxb-maven2-plugin/
Are you sure you are using the correct plugin for your configuration file version?

By the way, telling some details on what you are doing and what technologies you are employing, including their versions, would help.
 
aneesh veetile
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Peter Johnson wrote:Which plugin are you using? Is it this one: http://jaxb.java.net/jaxb-maven2-plugin/
Are you sure you are using the correct plugin for your configuration file version?

By the way, telling some details on what you are doing and what technologies you are employing, including their versions, would help.


Thanks for your reply!

I am using the following plugin and version

<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.8.0</version>

Actually i am developing a part of webservice using RAD, websphere application server 7.0, java 1.6 and jaxb.
I would be getting an xml request and i would be converting it into java objects using jaxb for preedit and post the request on to a server.
I am using maven for building it. i am trying to create the jaxb objects from the xsds. inside one of the xsds my script is failing.

following are the jaxb dependencies in my pom



please let me know if you need any other information.

Regards,
Aneesh
 
aneesh veetile
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
aneesh veetile wrote:
Peter Johnson wrote:Which plugin are you using? Is it this one: http://jaxb.java.net/jaxb-maven2-plugin/
Are you sure you are using the correct plugin for your configuration file version?

By the way, telling some details on what you are doing and what technologies you are employing, including their versions, would help.


Thanks for your reply!

I am using the following plugin and version

<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.8.0</version>

Actually i am developing a part of webservice using RAD, websphere application server 7.0, java 1.6 and jaxb.
I would be getting an xml request and i would be converting it into java objects using jaxb for preedit and post the request on to a server.
I am using maven for building it. i am trying to create the jaxb objects from the xsds. inside one of the xsds my script is failing.

following are the jaxb dependencies in my pom



please let me know if you need any other information.

Regards,
Aneesh


Hi,

The issue is resolved.

The actual problem was with the way i were giving the xsd's in <includeSchema> tag. I were giving all the xsds explicitly in <includeSchema> tag.(either explicitly mentioning all xsds or giving *.xsds).
The xsd which was showing the error while building is interally refering 6 other xsds. So i dont need to give those 6 xsds explicitly in <includeschema>tag. I have to explicitly give only the xsd which is referring those 6 xsd's and also the order matters.

Thank you for you help!

Regards,
Aneesh
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic