Axis 1.xを使用してWebサービスプロジェクトを実行していますが、Mavenビルドを機能させるのに問題があります。
私は
mvn clean generate-sources
これがaxistools-maven-pluginのwsdl2java
目標をトリガーします。最終的には中止されます
[INFO] [axistools:wsdl2java {execution: generate-project}]
[INFO] about to add compile source root
[INFO] Processing wsdl: C:\Project\src\main\webapp\WEB-INF\wsdl\project.wsdl
Jan 24, 2011 11:24:58 AM org.apache.axis.utils.JavaUtils isAttachmentSupported
WARNING: Unable to find required classes (javax.activation.DataHandler and javax.mail.internet.MimeMultipart). Attachment support is disabled.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error generating Java code from WSDL.
Embedded error: Error running Axis
C:\Project\src\main\webapp\WEB-INF\project.xsd (The system cannot find the file specified)
正解です。そのファイルは存在しません。(そして、-eは追加の有用な情報を生成しません-それは、FileNotFoundExceptionによって引き起こされたAxisPluginExceptionによって引き起こされたMojoExecutionExceptionによって引き起こされたLifecycleExecutionExceptionです。)
重要なのは、検索するのではなくWEB-INF\project.xsd
、にアクセスする必要があるということですWEB-INF\wsdl\project.xsd
。
WSDLの内容は次のとおりです。
<wsdl:types>
<xsd:schema targetNamespace="http://domain/project/">
<xsd:import namespace="http://domain/schema/" schemaLocation="project.xsd"/>
</xsd:schema>
</wsdl:types>
これは私のすべての同僚にとってうまくいくようです。私たちはすべてMaven2.2.1を使用しており、axistools-maven-pluginは次の構成で1.4に固定されています。
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>axistools-maven-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<id>generate-project</id>
<goals>
<goal>wsdl2java</goal>
</goals>
<configuration>
<sourceDirectory>${basedir}/src/main/webapp/WEB-INF/wsdl/</sourceDirectory>
<outputDirectory>target/generated-sources</outputDirectory>
<serverSide>true</serverSide>
<testCases>false</testCases>
<wrapArrays>false</wrapArrays>
</configuration>
</execution>
</executions>
</plugin>
不正な依存関係であることを期待して、ローカルのMavenリポジトリーをすでに完全にクリアしましたが、それでも何も変わりませんでした。何が私だけのためにこれを引き起こしている可能性がありますが、私の同僚のためではありませんか?
編集1:schemaLocationをwsdl/project.xsd
(テスト目的で、WSDLに永続的な変更を加えることはできません)に変更しようとしましたが、この面白い結果が得られました:
Embedded error: Error running Axis
WSDLException (at /wsdl:definitions/wsdl:types/xsd:schema):
faultCode=OTHER_ERROR: An error occurred trying to resolve
schema referenced at 'wsdl\project.xsd', relative to
'file:/C:/Project/src/main/webapp/WEB-INF/wsdl/project.wsdl'.:
This file was not found:
file:/C:/Project/src/main/webapp/WEB-INF/wsdl/wsdl/project.xsd
あなたが私のように、今./project.xsd
はうまくいくかもしれないと思っているなら...いいえ、申し訳ありませんが、それはWEB-INF/project.xsd
再び直接検索することになります。
編集2:さて、今axistoolsはちょうど私をからかっています...
../project.xsd
-> src/main/webapp/project.xsd
(間違っている)
../wsdl/project.xsd
-> src/main/webapp/wsdl/project.xsd
(間違っている)
../WEB-INF/wsdl/project.xsd
-> src/main/webapp/WEB-INF/WEB-INF/wsdl/project.xsd
(間違っている)
念のため、正しいパスはですsrc/main/webapp/WEB-INF/wsdl/project.xsd
。