2

I am getting the following error on the annox plugin for jaxb generation

[ERROR] file:/Users/dhiller/Space/ifp-core/framework/src/main/resources/schemas/common_2012_04.xsd[5,136]
org.xml.sax.SAXParseException: Unsupported binding namespace "http://annox.dev.java.net". Perhaps you meant "http://java.sun.com/xml/ns/jaxb/xjc"?

Here is the code I have. The versions must be screwed up somehow? Anyone have some working example with all the version numbers

            <plugin>
            <groupId>org.jvnet.jaxb2.maven2</groupId>
            <artifactId>maven-jaxb21-plugin</artifactId>
            <version>0.8.1</version>
            <executions>
                <execution>
                    <goals>
                        <goal>generate</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <args>
                    <arg>-XtoString</arg>
                    <arg>-Xequals</arg>
                    <arg>-XhashCode</arg>
                    <arg>-Xcopyable</arg>
                </args>
                <plugins>
                    <plugin>
                        <groupId>org.jvnet.jaxb2_commons</groupId>
                        <artifactId>jaxb2-basics</artifactId>
                        <version>0.6.3</version>
                    </plugin>
                </plugins>
            </configuration>
        </plugin>       
        <plugin>
           <groupId>org.codehaus.mojo</groupId>
           <artifactId>jaxb2-maven-plugin</artifactId>
           <version>1.3.1</version>
           <executions>
              <execution>
                 <goals>
                    <goal>xjc</goal>
                 </goals>
              </execution>
           </executions>
           <configuration>
              <clearOutputDir>false</clearOutputDir>
              <schemaDirectory>${basedir}/src/main/resources/schemas</schemaDirectory>
              <schemaFiles>externalaction_2012_03.xsd,common_2012_04.xsd,utilities_2012_03.xsd</schemaFiles>
              <outputDirectory>${project.build.directory}/generated-sources</outputDirectory>
              <bindingDirectory>${basedir}/src/main/xjb</bindingDirectory>
              <bindingFiles>bindings.xjb.xml</bindingFiles>
              <extension>true</extension>
           </configuration>
        </plugin>
Dean Hiller
  • 19,235
  • 25
  • 129
  • 212
  • found the way to do this, and posted it here http://stackoverflow.com/questions/4785454/jaxb-external-custom-binding-xjc-issue-parsing-results-in-empty-node/10565944#10565944 – Dean Hiller May 12 '12 at 17:51
  • found the way to do this and posted it here http://stackoverflow.com/questions/4785454/jaxb-external-custom-binding-xjc-issue-parsing-results-in-empty-node/10565944#10565944 – Dean Hiller May 12 '12 at 17:51

2 Answers2

4

I think you are missing some dependencies from <plugin>. Try this code:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>jaxb2-maven-plugin</artifactId>
    <version>1.5</version>
    <executions>
        <execution>
            <id>xjc</id>
            <goals>
                <goal>xjc</goal>
            </goals>
            <configuration>
                <extension>true</extension>
                <arguments>-Xannotate</arguments>
            </configuration>
        </execution>
    </executions>
    <dependencies>
        <dependency>
            <groupId>org.jvnet.jaxb2_commons</groupId>
            <artifactId>jaxb2-basics-annotate</artifactId>
            <version>0.6.4</version>
        </dependency>
        <dependency>
            <groupId>com.sun.codemodel</groupId>
            <artifactId>codemodel</artifactId>
            <version>2.6</version>
        </dependency>
    </dependencies>
</plugin>
kavai77
  • 6,282
  • 7
  • 33
  • 48
0

why is this posting as a comment. Trying to post the answer which I posted here

JAXB External Custom Binding XJC Issue - Parsing results in empty node

Community
  • 1
  • 1
Dean Hiller
  • 19,235
  • 25
  • 129
  • 212
  • that was very weird, it kept posting my answers as comments, I had to reset the url of the page to get the add answer button to work properly...very weird. – Dean Hiller May 12 '12 at 17:52