Axis2错误:无法添加以下方面

时间:2013-06-07 12:28:29

标签: java eclipse axis2 jboss5.x

我正在尝试从eclipse中的wsdl文件生成axis2 webservice。 我正在点击此错误消息:

 Unable to add the following facetsto project AnnuaireAAAAAAAA: Axis2 Web Services Extensions, Axis2 Web Services Core.
    org.eclipse.wst.common.project.facet.core.FacetedProjectFrameworkException: Failed while installing Axis2 Web Services Core 1.1.
    at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.callDelegate(FacetedProject.java:1507)
    at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.modifyInternal(FacetedProject.java:441)
    at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.mergeChangesInternal(FacetedProject.java:1181)
    at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.access$2(FacetedProject.java:1117)
    at org.eclipse.wst.common.project.facet.core.internal.FacetedProject$1.run(FacetedProject.java:324)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
    at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.modify(FacetedProject.java:339)
    at org.eclipse.jst.ws.internal.consumption.ui.common.FacetOperationDelegate$1.run(FacetOperationDelegate.java:62)
    at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
    Caused by: org.eclipse.core.runtime.CoreException: The Axis2 facets cannot be installed since the Axis2 runtime location has not been set.
    Go to the Web Services preference page and set the Axis2 runtime location under Axis2 Preferences.
    at org.eclipse.jst.ws.axis2.facet.deligate.Axis2CoreFacetInstallDelegate.execute(Axis2CoreFacetInstallDelegate.java:50)
    at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.callDelegate(FacetedProject.java:1477)
    ... 8 more
    Caused by: java.io.FileNotFoundException: C:\DEV\axis2-1.4.1-war\webapp (Le fichier spécifié est introuvable)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(Unknown Source)
    at org.eclipse.jst.ws.axis2.core.utils.FileUtils.copy(FileUtils.java:158)
    at org.eclipse.jst.ws.axis2.core.utils.FileUtils.copyDirectory(FileUtils.java:151)
    at org.eclipse.jst.ws.axis2.facet.utils.Axis2WebappUtils.copyAxis2War(Axis2WebappUtils.java:94)
    at org.eclipse.jst.ws.axis2.facet.commands.Axis2WebservicesServerCommand.executeOverride(Axis2WebservicesServerCommand.java:85)
    at org.eclipse.jst.ws.axis2.facet.deligate.Axis2CoreFacetInstallDelegate.execute(Axis2CoreFacetInstallDelegate.java:43)
    ... 9 more

实际上,C:DEV \ axis2-1.4.1-war中没有webapp文件夹/文件 为什么我会遇到这个问题? 非常感谢您的回答。

编辑: 现在出现其他错误:

Unable to add the follwing facets to project AnnuaireAAAAAAA: Axis2 Web Services Extensions, Axis2 Web Services Core.
    org.eclipse.wst.common.project.facet.core.FacetedProjectFrameworkException: Failed while installing Axis2 Web Services Core 1.1.
    at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.callDelegate(FacetedProject.java:1507)
    at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.modifyInternal(FacetedProject.java:441)
    at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.mergeChangesInternal(FacetedProject.java:1181)
    at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.access$2(FacetedProject.java:1117)
    at org.eclipse.wst.common.project.facet.core.internal.FacetedProject$1.run(FacetedProject.java:324)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
    at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.modify(FacetedProject.java:339)
    at org.eclipse.jst.ws.internal.consumption.ui.common.FacetOperationDelegate$1.run(FacetOperationDelegate.java:62)
    at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
    Caused by: java.lang.NullPointerException
    at org.eclipse.wst.validation.internal.DisabledResourceManager.save(DisabledResourceManager.java:67)
    at org.eclipse.wst.validation.internal.DisabledResourceManager.disableValidation(DisabledResourceManager.java:49)
    at org.eclipse.wst.validation.ValidationFramework.disableValidation(ValidationFramework.java:129)
    at org.eclipse.jst.ws.axis2.facet.commands.Axis2WebservicesServerCommand.executeOverride(Axis2WebservicesServerCommand.java:110)
    at org.eclipse.jst.ws.axis2.facet.deligate.Axis2CoreFacetInstallDelegate.execute(Axis2CoreFacetInstallDelegate.java:43)
    at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.callDelegate(FacetedProject.java:1477)
    ... 8 more

5 个答案:

答案 0 :(得分:17)

我今天遇到了同样的问题,我可以通过以下方式解决问题:

  1. 下载Axis 2二进制分发版(底部链接)
  2. 提取
  3. 输入 Eclipse 并转到窗口&gt;偏好&gt; Web服务&gt; Axis2首选项
  4. Axis2运行时位置字段中,指向Axis2安装目录(您在步骤2中创建的目录)
  5. 点击应用
  6. 关闭偏好设置,然后重试
  7. 这对我有用。请记住,还必须在Tomcat安装中安装Axis2 war 文件。 Link to all Axis2 packages

答案 1 :(得分:1)

尝试检入项目属性 - &gt; Project Facets页面。当我手动尝试添加方面'Axis2 Web Services'时,我得到一个更具描述性的错误

The Axis2 facets cannot be installed since the Axis2 runtime location has not been set.

Go to the Web Services preference page and set the Axis2 runtime location under Axis2 Preferences

答案 2 :(得分:1)

您必须在“Eclipse Axis2偏好设置”中下载并使用axis2的二进制分布。 (Eclipse - &gt; Window - &gt; Preferences - &gt; Web Services - &gt; Axis2 Preferences - &gt; Axis2运行时位置。 如果使用war分发,则Eclipse首选项页面不会显示错误。但是,如果您尝试使用wsdl创建客户端,则会出现显示的错误(我使用Eclipse 3.7,我不知道新版本的行为方式)。

答案 3 :(得分:0)

Eclipse期望您的项目为web类型。我的意思是,如果你使用maven,它必须是<type>war</type>。如果没有,请添加eclipse项目的详细信息

答案 4 :(得分:0)

问题:这很重要!然而,有人会遇到下一个错误:在WSDL的代码生成期间发生异常:java.lang.NoClassDefFoundError:org / apache / ws / commons / schema / XmlSchema引起:java.lang.ClassNotFoundException:org.apache.ws。 org.apache.ant_1.9.4.v201504302020找不到commons.schema.XmlSchema - 任何想法或解决方法吗?

解决方案:我遇到了同样的问题,似乎问题是从Axis2 1.7.0引入的。在我恢复到Axis2 1.6.0之后问题得到了解决

确保您已完成marcelocra提及的以下步骤:

  1. 下载Axis 2战争分发(https://archive.apache.org/dist/axis/axis2/java/core/1.6.0/
  2. 输入Eclipse并转到Window&gt;偏好&gt; Web服务&gt; Axis2首选项
  3. 在Axis2运行时位置字段中,指向Axis2安装目录(您在步骤2中创建的目录),单击“应用”并“关闭首选项”。
  4. 请记住,还需要在Tomcat安装中安装Axis2 war文件。链接到所有Axis2软件包。
  5. 立即尝试,这对我们有用。