java - Maven Jaxb2 plugin throwin error "undefined element declaration 's:schema' " -
i trying generate classes using maven jaxb2 plugin . receiving below exception :
org.xml.sax.saxparseexception; systemid: http://someip/dummywsdl.asmx?wsdl; linenumber: 32; columnnumber: 41; undefined element declaration 's:schema' @ com.sun.xml.xsom.impl.parser.parsercontext$1.reporterror(parsercontext.java:180) @ com.sun.xml.xsom.impl.parser.ngccruntimeex.reporterror(ngccruntimeex.java:175) @ com.sun.xml.xsom.impl.parser.delayedref.resolve(delayedref.java:110) @ com.sun.xml.xsom.impl.parser.delayedref.run(delayedref.java:85) @ com.sun.xml.xsom.impl.parser.parsercontext.getresult(parsercontext.java:135) @ com.sun.xml.xsom.parser.xsomparser.getresult(xsomparser.java:214) @ com.sun.tools.xjc.modelloader.loadwsdl(modelloader.java:412) @ com.sun.tools.xjc.modelloader.load(modelloader.java:170) @ com.sun.tools.xjc.modelloader.load(modelloader.java:119) @ org.jvnet.mjiip.v_2_2.xjc22mojo.loadmodel(xjc22mojo.java:50) @ org.jvnet.mjiip.v_2_2.xjc22mojo.doexecute(xjc22mojo.java:40) @ org.jvnet.mjiip.v_2_2.xjc22mojo.doexecute(xjc22mojo.java:28) @ org.jvnet.jaxb2.maven2.rawxjc2mojo.doexecute(rawxjc2mojo.java:488) @ org.jvnet.jaxb2.maven2.rawxjc2mojo.execute(rawxjc2mojo.java:311) @ org.apache.maven.plugin.defaultbuildpluginmanager.executemojo(defaultbuildpluginmanager.java:134) @ org.apache.maven.lifecycle.internal.mojoexecutor.execute(mojoexecutor.java:207) @ org.apache.maven.lifecycle.internal.mojoexecutor.execute(mojoexecutor.java:153) @ org.apache.maven.lifecycle.internal.mojoexecutor.execute(mojoexecutor.java:145) @ org.apache.maven.lifecycle.internal.mojoexecutor.executeforkedexecutions(mojoexecutor.java:352) @ org.apache.maven.lifecycle.internal.mojoexecutor.execute(mojoexecutor.java:197) @ org.apache.maven.lifecycle.internal.mojoexecutor.execute(mojoexecutor.java:153) @ org.apache.maven.lifecycle.internal.mojoexecutor.execute(mojoexecutor.java:145) @ org.apache.maven.lifecycle.internal.lifecyclemodulebuilder.buildproject(lifecyclemodulebuilder.java:116) @ org.apache.maven.lifecycle.internal.lifecyclemodulebuilder.buildproject(lifecyclemodulebuilder.java:80) @ org.apache.maven.lifecycle.internal.builder.singlethreaded.singlethreadedbuilder.build(singlethreadedbuilder.java:51) @ org.apache.maven.lifecycle.internal.lifecyclestarter.execute(lifecyclestarter.java:128) @ org.apache.maven.defaultmaven.doexecute(defaultmaven.java:307) @ org.apache.maven.defaultmaven.doexecute(defaultmaven.java:193) @ org.apache.maven.defaultmaven.execute(defaultmaven.java:106) @ org.apache.maven.cli.mavencli.execute(mavencli.java:863) @ org.apache.maven.cli.mavencli.domain(mavencli.java:288) @ org.apache.maven.cli.mavencli.main(mavencli.java:199) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:62) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:498) @ org.codehaus.plexus.classworlds.launcher.launcher.launchenhanced(launcher.java:289) @ org.codehaus.plexus.classworlds.launcher.launcher.launch(launcher.java:229) @ org.codehaus.plexus.classworlds.launcher.launcher.mainwithexitcode(launcher.java:415) @ org.codehaus.plexus.classworlds.launcher.launcher.main(launcher.java:356)
after searching , came know below 2 declaration in wsdl causing issue :
<s:element ref="s:schema"/> <s:any/>
in 1 of post , found if change above 2 lines below given line , plugin generating files without issue :
<s:any minoccurs="2" maxoccurs="2" />
below plugin configuration using :
<plugin> <groupid>org.jvnet.jaxb2.maven2</groupid> <artifactid>maven-jaxb2-plugin</artifactid> <version>0.12.3</version> <executions> <execution> <goals> <goal>generate</goal> </goals> </execution> </executions> <configuration> <schemalanguage>wsdl</schemalanguage> <generatepackage>com.abc</generatepackage> <schemas> <schema> <url>http://someip/dummywsdl.asmx?wsdl</url> </schema> </schemas> </configuration> </plugin>
is there other way resolve issue without changing wsdl , client wsdl , , don't want store @ local above changes.
your schema seems invalid. no, xjc won't compile unless fix error.
as workaround can create local copy of schema , fix copy. can create catalog file "rewrite" global url http://someip/dummywsdl.asmx?wsdl`` local
dummywsdl.asmx_wsdl`:
rewrite_system "http://someip/dummywsdl.asmx?wsdl" "dummywsdl.asmx_wsdl"
see using catalogs more info.
Comments
Post a Comment