Search code examples
javajaxbweblogicjax-wswsdlc

Error using jaxb external bindings customization


I use the wsdlc tool (weblogic 10.3.1) to generate classes from wsdl. I have the following external jaxb bindings customization file:

<jaxb:bindings
    xmlns="http://java.sun.com/xml/ns/jaxb"
    xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
    schemaLocation="web/WEB-INF/....xsd"
    version="2.1">

    <jaxb:bindings  node="/xs:schema">
        <jaxb:globalBindings>
            <xjc:superClass name="my.MySuperClass" />
        </jaxb:globalBindings>
    </jaxb:bindings>
</jaxb:bindings>

The error message on complilation is: cannot find symbol my.MySuperClass. And from javac: "package my does not exist". The classpath = everything I include via <pathelement location= etc. and 60 lines from eclipse plugins. The problem lies in the javac command that wsdlc initiates. The classpath of this command is correct (hard coded paths e.g.) but still "package ... does not exist".

The usage of wsdlc from ant is like so:

<path id="class.path">
  <pathelement path="${java.class.path}" />
  <pathelement location="... hard coded path on disk to a jar" />
</path>

<target name="generate-ws-from-wsdl">
<wsdlc failOnError="true"
       srcWsdl="${basedir}/web/WEB-INF/ps.wsdl"
       destImplDir="${basedir}/src"
       destJwsDir="${basedir}/web/WEB-INF/lib"
       srcPortName="PsPort"
       type="JAXWS">
    <binding file="jaxb-bindings.xml" />
    <classpath refid="class.path" />
</wsdlc>
</target>

Solution

  • I didn't jar my classes properly, I thought I could use WinZip to quickly add some classes to a jar, but the 'path' in WinZip was not equal to the package name in java. It took me a while but I learned something about classpaths.