Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to parse input schema(s).Error messages should have been provided. #157

Closed
edtshuma opened this issue Sep 10, 2018 · 5 comments
Closed
Assignees
Labels
Milestone

Comments

@edtshuma
Copy link

When i attempt Maven Update Project the generate goal is not succeeding. In my disburse.xsd i have:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.onewallet.org/webservices/disburse"
           targetNamespace="http://www.onewallet.org/webservices/disburse" elementFormDefault="qualified">     
     <xs:element name="getAllDisbursementsRequest">
        <xs:complexType/>
    </xs:element>    
    <xs:element name="getAllDisbursementsResponse">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="disburseInfo" type="tns:disburseInfo" maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>   
    <xs:complexType name="serviceStatus">
        <xs:sequence>
            <xs:element name="statusCode" type="xs:string"/>
            <xs:element name="message" type="xs:string"/>
        </xs:sequence>
    </xs:complexType>     
</xs:schema>

And in my pom.xml i have:

 <build>
        <plugins>
	  	  <plugin>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-maven-plugin</artifactId>
	      	  </plugin>
		 <plugin>
				<groupId>org.jvnet.jaxb2.maven2</groupId>
				<artifactId>maven-jaxb2-plugin</artifactId>
				<version>0.14.0</version>
				<executions>
                    <execution>
                        <id>jaxb2-generate</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                </executions>
				  <configuration>
		        <!-- Generate classes from XSD (XML Schema) using JAXB -->
                    <schemaDirectory>${project.basedir}/src/main/resources</schemaDirectory>
                    <schemaIncludes>
                        <include>**/*.xsd</include>
                    </schemaIncludes>
                    <strict>false</strict>
                    <extension>true</extension>
		    </configuration>
			<plugin>
			<groupId>org.jvnet.jaxb2_commons</groupId>
			<artifactId>jaxb2-basics</artifactId>
			<version>0.12.0</version>
	      	  </plugin>
	      	  <plugin>
			<groupId>org.jvnet.jaxb2_commons</groupId>
			<artifactId>jaxb2-basics-annotate</artifactId>
			<version>1.0.3</version>
	      	  </plugin>
	  </plugins>
         </build>

In disbursebinding.xjb i have:

<?xml version="1.0" encoding="UTF-8"?>
<jaxb:bindings
	version="2.1"
	xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
	xmlns:xs="http://www.w3.org/2001/XMLSchema">

	<jaxb:bindings schemaLocation="disburse.xsd" node="//xs:schema">
		<jaxb:schemaBindings>
			<jaxb:package name="org.webservices.disburse"/>
		</jaxb:schemaBindings>
	</jaxb:bindings>
</jaxb:bindings>
@highsource
Copy link
Owner

Please include your Maven log.

@edtshuma
Copy link
Author

--- maven-jaxb2-plugin:0.14.0:generate (jaxb2-generate) @ onewallet ---
[INFO] Sources are not up-to-date, XJC will be executed.
[ERROR] Error while parsing schema(s).Location [ file:/C:/Users/SYSDEV/Documents/PROJECTS/EclipseGit/GIT/onewallet/src/main/resources/xsds/disburse.xsd{10,96}].
org.xml.sax.SAXParseException; systemId: file:/C:/Users/SYSDEV/Documents/PROJECTS/EclipseGit/GIT/onewallet/src/main/resources/xsds/disburse.xsd; lineNumber: 10; columnNumber: 96; undefined simple or complex type 'tns:disburseInfo'
	at com.sun.xml.xsom.impl.parser.ParserContext$1.reportError(ParserContext.java:180)
	at com.sun.xml.xsom.impl.parser.NGCCRuntimeEx.reportError(NGCCRuntimeEx.java:179)
	at com.sun.xml.xsom.impl.parser.DelayedRef.resolve(DelayedRef.java:110)
	at com.sun.xml.xsom.impl.parser.DelayedRef.run(DelayedRef.java:85)
	at com.sun.xml.xsom.impl.parser.ParserContext.getResult(ParserContext.java:135)
	at com.sun.xml.xsom.parser.XSOMParser.getResult(XSOMParser.java:214)
	at com.sun.tools.xjc.ModelLoader.createXSOMSpeculative(ModelLoader.java:498)
	at com.sun.tools.xjc.ModelLoader.loadXMLSchema(ModelLoader.java:351)
	at com.sun.tools.xjc.ModelLoader.load(ModelLoader.java:162)
	at com.sun.tools.xjc.ModelLoader.load(ModelLoader.java:117)
	at org.jvnet.mjiip.v_2_3.XJC23Mojo.loadModel(XJC23Mojo.java:50)
	at org.jvnet.mjiip.v_2_3.XJC23Mojo.doExecute(XJC23Mojo.java:40)
	at org.jvnet.mjiip.v_2_3.XJC23Mojo.doExecute(XJC23Mojo.java:28)
	at org.jvnet.jaxb2.maven2.RawXJC2Mojo.doExecute(RawXJC2Mojo.java:478)
	at org.jvnet.jaxb2.maven2.RawXJC2Mojo.execute(RawXJC2Mojo.java:320)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)

@edtshuma
Copy link
Author

Seems an issue with how well formed my XSD is.

@highsource
Copy link
Owner

The disburseInfo type is missing in your schema.

@highsource highsource self-assigned this Sep 11, 2018
@highsource highsource added this to the 0.14.x milestone Sep 11, 2018
@edtshuma
Copy link
Author

thanks @highsource .I had skipped response payload as defined in database:

 <xs:complexType name="disburseInfo">
        <xs:sequence>
            <xs:element name="currency" type="xs:string"/>
            <xs:element name="reasonType" type="xs:string"/>
            <xs:element name="receiverParty" type="xs:string"/>
              <xs:element name="amount" type="xs:decimal"/>
        </xs:sequence>  
         </xs:complexType>

laurentschoelens pushed a commit to laurentschoelens/jaxb-tools that referenced this issue May 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants