Java 为什么axistools maven插件试图访问此相对模式位置?

Java 为什么axistools maven插件试图访问此相对模式位置?,java,maven-2,axis,wsdl2java,Java,Maven 2,Axis,Wsdl2java,我们正在用Axis1.x做一个web服务项目,我在让Maven构建正常工作方面遇到了问题 我做一个 mvn clean generate-sources 这触发了axistools maven插件的wsdl2java目标。它最终会以失败告终 [INFO] [axistools:wsdl2java {execution: generate-project}] [INFO] about to add compile source root [INFO] Processing wsdl: C:\P

我们正在用Axis1.x做一个web服务项目,我在让Maven构建正常工作方面遇到了问题

我做一个

 mvn clean generate-sources
这触发了axistools maven插件的
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不产生任何其他有用信息——它是一个LifecycleExecutionException,由MojoExecutionException引起,由AxisPluginException引起,由FileNotFoundException引起。)

关键是,它不应该搜索
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>
如果你和我一样,现在认为
/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

尝试使用useEmitter标记,如:

    <plugins>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>axistools-maven-plugin</artifactId>
            <version>1.4</version>
            <configuration>
                <useEmitter>true</useEmitter>

org.codehaus.mojo
AxisToolsMaven插件
1.4
真的

…通过确保项目位置的路径不包含空格,我能够解决此问题。因此,Win XP上的默认位置将不起作用(“文档和设置”)

不幸的是,当启用
功能不再起作用

所以我不得不把这一代人分成两次“处决”

  • 首先,所有不带XSD且
    true
  • 然后是带有XSD的include(幸运的是我只有一个)和
    true
    (文件名显式添加到

我在使用maven进行构建时也遇到了同样的问题,我能够通过确保项目位置的路径不包含空格来解决这个问题。

您尝试过mvn clean generate sources吗?@Raghuram:是的,我实际上就是这么做的。我将把它编辑成问题。你是否为SO编辑了项目目录名?我认为如果路径中有空格,则会出现此问题。Win上的CommonXP@Martin项目名称绝对是经过修改的。我不记得原始路径中是否有空格,但我相当肯定我在一个简化的目录(读:接近根目录,没有空格)上显式地尝试了它。我还认为路径中的空格会导致不同的行为和其他错误消息。很难说使用此标志意味着什么。文档非常稀少——只有一个,没有提到发射器与命令行wsdl2java工具的不同之处。不过,它似乎确实解决了最初的问题。谢谢
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
    <plugins>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>axistools-maven-plugin</artifactId>
            <version>1.4</version>
            <configuration>
                <useEmitter>true</useEmitter>