9

我正在尝试从 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
4

5 回答 5

23

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

  1. 下载 Axis 2 二进制发行版(链接在底部)
  2. 提取它
  3. 进入Eclipse并转到Window > Preferences > Web Services > Axis2 Preferences
  4. Axis2 运行时位置字段中,指向您的 Axis2 安装目录(您在步骤 2 中创建的那个)
  5. 单击应用
  6. 关闭首选项并重

这对我有用。请记住,还需要在 Tomcat 安装中安装 Axis2 war文件。链接到所有 Axis2 包

于 2014-03-17T14:44:21.660 回答
1

You have to download and use the binary distribution of axis2 in your 'Eclipse Axis2 Preferences' (Eclipse -> Window -> Preferences -> Web Services -> Axis2 Preferences -> Axis2 runtime location. If you use the war distribution the Eclipse preference page won't show an error. But if you try do create a client out of a wsdl you get the shown error (I'm using Eclipse 3.7, I don't know how newer versions will behave).

于 2014-05-12T08:29:16.677 回答
1

尝试检查您的项目属性 -> Project Facets 页面。当我手动尝试添加方面“Axis2 Web 服务”时,我得到一个更具描述性的错误

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
于 2013-08-31T01:53:33.690 回答
0

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

于 2013-06-07T12:36:01.417 回答
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 > Preferences > Web Services > Axis2 Preferences
  3. 在 Axis2 运行时位置字段中,指向您的 Axis2 安装目录(您在步骤 2 中创建的目录),单击应用并关闭首选项。
  4. 请记住,还需要在 Tomcat 安装中安装 Axis2 war 文件。链接到所有 Axis2 包。

现在试试,这对我们有用。

于 2016-02-26T11:44:29.920 回答