jaxb-ri
jaxb-ri copied to clipboard
Base complex type "AdditionalParametersBaseType" is derived by restriction, while this complex type "AdditionalParametersType" is derived by extension. OGC WCS 2.0.0 -
Trying to generate the bindings for http://schemas.opengis.net/wcs/2.0/wcsAll.xsd
E:\schemas\inspire\wcs\wcs-2_0_1\wcs\2.0.1>"E:\quaglan\software\jaxb-ri-2.2.7\ja xb-ri-2.2.7\bin\xjc" wcsAll.xsd -d "E:\quaglan\projects\subversion\sdi\Geoportal \Common\MavenProjects\INSPIREGeoportalBindings\src\main\java" -target 2.1 -b bin dings.xjb -extension -catalog catalog.xml parsing a schema... [ERROR] Base complex type "AdditionalParametersBaseType" is derived by restricti on, while this complex type "AdditionalParametersType" is derived by extension. This is not currently handled by XJC, but we are seeking input on this issue. Pl ease report this to the JAXB team. line 54 of http://schemas.opengis.net/ows/2.0/owsAdditionalParameters.xsd
Failed to parse a schema.
Environment
Windows 7 64bit Java 6
Affected Versions
[2.2.7]
- Issue Imported From: https://github.com/javaee/jaxb-v2/issues/1011
- Original Issue Raised By:@glassfishrobot
- Original Issue Assigned To: @glassfishrobot
@glassfishrobot Commented Reported by aquaglia
@glassfishrobot Commented jbaldo said: H Is there any activity on this issue?
@glassfishrobot Commented
tastle said:
Hit the same thing recently. This is going to be a problem with anything based on OWS 2.0 from the OGC.
@glassfishrobot Commented Was assigned to yaroska
@glassfishrobot Commented This issue was imported from java.net JIRA JAXB-1011
Hi, are there any updates on this? This is currently a major blocker for me, and since jaxb does not support xml schema 1.1 to use xs:override I have no real workaround for this issue.
Edit: Okay, found a workaround for this. But a status update would still be nice.
Hello, I currently can't move forward in my project due to this same exact issue. Are there any updates? @asab-se, would you be open to sharing your workaround?
I also have the exact same problem. @asab-se, that would be really helpful if you would be kind enough to share your workaround
+1 same probblem here for some GeoServer stuff. yes, it would be nice to share your workaround @asab-se
Could somebody provide a simple example (with minimum entries) to reproduce it?.
I believe I'm running into the same issue, but I'm not very familiar with XSD so can't be sure. The full schema that I'm using can be found here: https://www.worlddab.org/schemas/spi/spi_34.xsd
However, I'm able to reproduce it with just this:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://www.worlddab.org/schemas/spi"
xmlns="http://www.worlddab.org/schemas/spi"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xs:import namespace="http://www.w3.org/XML/1998/namespace"
schemaLocation="http://www.w3.org/2001/xml.xsd" />
<!-- ##################################################################### -->
<!-- Common data types, groups and elements (clause 5) -->
<!-- ##################################################################### -->
<!-- Definition of textType -->
<xs:complexType name="textType" abstract="true">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute ref="xml:lang" use="optional" />
<xs:anyAttribute namespace="##other" processContents="lax" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<!-- Definition of aliasType -->
<xs:complexType name="aliasType">
<xs:simpleContent>
<xs:extension base="baseAliasType" >
<xs:attribute name="prefer" type="xs:boolean" use="optional" default="false" />
<xs:anyAttribute namespace="##other" processContents="lax" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<!-- Definition of baseAliasType -->
<xs:complexType name="baseAliasType">
<xs:simpleContent>
<xs:restriction base="textType" >
<xs:maxLength value="128" />
</xs:restriction>
</xs:simpleContent>
</xs:complexType>
</xs:schema>
The error:
com.sun.istack.SAXParseException2: Base complex type "baseAliasType" is derived by restriction, while this complex type "aliasType" is derived by extension. This is not currently handled by XJC, but we are seeking input on this issue. Please report this to the JAXB team.
at com.sun.tools.xjc.ErrorReceiver.error (ErrorReceiver.java:56)
at com.sun.tools.xjc.reader.xmlschema.ct.ExtendedComplexTypeBuilder.build (ExtendedComplexTypeBuilder.java:51)
at com.sun.tools.xjc.reader.xmlschema.ct.ComplexTypeFieldBuilder.build (ComplexTypeFieldBuilder.java:56)
at com.sun.tools.xjc.reader.xmlschema.BindRed.complexType (BindRed.java:38)
at com.sun.xml.xsom.impl.ComplexTypeImpl.visit (ComplexTypeImpl.java:250)
at com.sun.tools.xjc.reader.xmlschema.ClassSelector$Binding.build (ClassSelector.java:168)
at com.sun.tools.xjc.reader.xmlschema.ClassSelector.executeTasks (ClassSelector.java:330)
at com.sun.tools.xjc.reader.xmlschema.BGMBuilder._build (BGMBuilder.java:147)
at com.sun.tools.xjc.reader.xmlschema.BGMBuilder.build (BGMBuilder.java:89)
at com.sun.tools.xjc.ModelLoader.annotateXMLSchema (ModelLoader.java:366)
at com.sun.tools.xjc.ModelLoader.load (ModelLoader.java:121)
at com.sun.tools.xjc.ModelLoader.load (ModelLoader.java:76)
at com.sun.tools.xjc.Driver.run (Driver.java:324)
at org.codehaus.mojo.jaxb2.javageneration.AbstractJavaGeneratorMojo.performExecution (AbstractJavaGeneratorMojo.java:476)
at org.codehaus.mojo.jaxb2.AbstractJaxbMojo.execute (AbstractJaxbMojo.java:337)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:190)
at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:186)
at java.util.concurrent.FutureTask.run (FutureTask.java:264)
at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:539)
at java.util.concurrent.FutureTask.run (FutureTask.java:264)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1136)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:635)
at java.lang.Thread.run (Thread.java:833)
Any help would be greatly appreciated. Thanks!