wsdlc ツール (weblogic 10.3.1) を使用して、wsdl からクラスを生成します。次の外部 jaxb バインディング カスタマイズ ファイルがあります。
<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>
コンパイル時のエラー メッセージ: シンボル my.MySuperClass が見つかりません。そしてjavacから:「パッケージmyは存在しません」。クラスパス =<pathelement location=などを介して含めるすべてのものと、Eclipse プラグインからの 60 行。問題は、wsdlc が開始する javac コマンドにあります。このコマンドのクラスパスは正しいですが (ハードコードされたパスなど)、「パッケージ ... が存在しません」。
ant からの wsdlc の使用法は次のようになります。
<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>