xsd - jaxb2 simplify plugin binding issue -
i tried use jaxb2 simplify plugin using xjc 2.2.4.
d:\>xjc -d . -extension -p org.my.space sample.xsd parsing schema... [error] unsupported binding namespace "http://jaxb2-commons.dev.java.net/basic/simplify". perhaps meant "http://jaxb.dev.java.net/plugin/code-injector"? line 7 of file:/d:/sample.xsd failed parse schema.
sample.xsd has declared simplify
<xs:schema xmlns:xs="http://www.w3.org/2001/xmlschema" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="2.1" xmlns:simplify="http://jaxb2-commons.dev.java.net/basic/simplify" jaxb:extensionbindingprefixes="simplify" xmlns="http://www.example.org/samplexml" targetnamespace="http://www.example.org/samplexml" elementformdefault="qualified">
any thoughts?
edit: tried other way around bindings file xjb , still same error. mean xjc version(2.2) not support jaxb2 simplify ?
xjc -d . -extension -b bindings.xjb sample.xsd
<bindings version="2.1" xmlns="http://java.sun.com/xml/ns/jaxb" xmlns:xs="http://www.w3.org/2001/xmlschema" xmlns:simplify="http://jaxb2-commons.dev.java.net/basic/simplify" extensionbindingprefixes="simplify"> <bindings schemalocation="sample.xsd" node="/xs:schema"> <bindings node="/xs:schema/xs:complextype[@name='dlist']/xs:choice/xs:element[1]"> <simplify:as-element-property /> </bindings> </bindings> </bindings>
i switched maven jaxb2 plugin
, more efforts worked fine. people have trouble in future. setup works fine in jdk 1.6 (for still cant migrate).
pom.xml
<build> <plugins> <plugin> <artifactid>maven-compiler-plugin</artifactid> <version>3.1</version> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> <!-- plugin compile schemas jaxb classes --> <plugin> <groupid>org.jvnet.jaxb2.maven2</groupid> <artifactid>maven-jaxb21-plugin</artifactid> <version>0.13.1</version> <executions> <execution> <id>generate-jaxb</id> <phase>generate-sources</phase> <goals> <goal>generate</goal> </goals> <configuration> <forceregenerate>true</forceregenerate> <schemadirectory>src/main/resources</schemadirectory> <schemaincludes> <include>sample.xsd</include> </schemaincludes> <cleanpackagedirectories>true</cleanpackagedirectories> </configuration> </execution> </executions> <configuration> <extension>true</extension> <args> <arg>-xsimplify</arg> </args> <plugins> <plugin> <groupid>org.jvnet.jaxb2_commons</groupid> <artifactid>jaxb2-basics</artifactid> <version>0.11.0</version> </plugin> </plugins> </configuration> </plugin> </plugins> </build>
i did not use binding.xjb
have included simplify
directly in schema (as have access).
sample.xsd
<xs:complextype name="doclist"> <xs:sequence> <xs:choice minoccurs="0" maxoccurs="unbounded"> <xs:annotation> <xs:appinfo> <simplify:as-element-property /> </xs:appinfo> </xs:annotation> <xs:element name="document1" type="type1" /> <xs:element name="document2" type="type2" /> </xs:choice> </xs:sequence> <xs:attribute name="heading" type="xs:string" /> </xs:complextype>
Comments
Post a Comment