Hi I am using JAXB annox with ant xjc and getting the following error
C:_Dev\build\abcSupplierDomain.xml:479: java.lang.NoSuchMethodError:

com.sun.codemodel.JAnnotatable.annotations()Ljava/util/Collection;
        at org.jvnet.jaxb2`enter code here`_commons.plugin.annotate.Annotator.annotate(Annotator.java:62)
        at org.jvnet.jaxb2_commons.plugin.annotate.AnnotatePlugin.annotate

Can some one pelase tell me what is the cause of this error? I have downloaded all the JAXB 2.* jars for doing this as org.jvnet.jaxb2_commons.xjc.XJC2Task is supported in jaxb2-basics-annotate-0.6.4.

Below is my xjb file and build.xml

build.xml

<xjc schema="serviceDescription/atlantis/v2/com.abc.e3.ss.lodging.lodginginterface.messages.availsummary.v2.xsd" 
            destdir="${src.gen.dir}" extension="true" removeoldoutput="true"
            binding="build/annoxBindings.xjb">
          <arg value="-Xannotate" />
          <arg value="-episode" />
          <arg value="${src.gen.dir}/LodgingInterface-AvailSummary_v2.episode" />
          <produces dir="${src.gen.dir}/com/abc/e3/ss/lodging/lodginginterface/messages/availsummary/defn/v2" includes="**/*.java" />
             <binding dir="${src.gen.dir}">
                            <include name="BaseTypes.episode"/>
                            <include name="TimeTypes.episode"/>
                            <include name="PlaceTypes.episode"/>
                            <include name="PersonTypes.episode"/>
                            <include name="FinanceTypes.episode"/>
                            <include name="MessageTypes.episode"/>
                            <include name="ErrorTypes.episode"/>
                            <include name="LodgingInterface-CommonTypes_3.episode"/>
                            <include name="LodgingInterface-AvailSummaryTypes_v2.episode"/>
                        </binding>
        </xjc>

my xjb file

<?xml version="1.0" encoding="UTF-8"?> 
<jaxb:bindings
  xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:annox="http://annox.dev.java.net"
  xsi:schemaLocation="http://java.sun.com/xml/ns/jaxb http://java.sun.com/xml/ns/jaxb/bindingschema_2_0.xsd"
  jaxb:version="2.1"
  jaxb:extensionBindingPrefixes="annox">

  <jaxb:bindings schemaLocation="file:/C:/SubversionProjects/sharedComponents/abcSupplierDomain_Dev/serviceDescription/atlantis/v2/com.expedia.e3.ss.lodging.lodginginterface.messages.availsummary.v2.xsd">
    <jaxb:bindings node="//xs:complexType[@name='AvailSummaryRequestType']">
      <annox:annotate>
        <annox:annotate
           annox:class="javax.xml.bind.annotation.XmlRootElement"
           name="AvailSummaryRequest" />
    </annox:annotate>
    </jaxb:bindings>
  </jaxb:bindings>

</jaxb:bindings>
1

There are 1 answers

0
Arnoud On

jaxb2-basics-annotate 0.6.4 requires JAXB 2.2.x, looks like you are using an older version of JAXB 2.