Axis2 error : Unable to add the following facets
Asked Answered
A

5

9

I am trying to generate an axis2 webservice from a wsdl file in eclipse. I am hitting this error message :

 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

Indeed, there is no webapp folder/file in C:DEV\axis2-1.4.1-war why am I hitting this issue ? Thanks a lot for your answers.

EDIT : Other error now :

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
Amicable answered 7/6, 2013 at 12:28 Comment(0)
F
23

I had the same problem today and I could solve it doing the following:

  1. Download the Axis 2 binary distribution (link at the bottom)
  2. Extract it
  3. Enter Eclipse and go to Window > Preferences > Web Services > Axis2 Preferences
  4. In the Axis2 runtime location field, points to your Axis2 installation directory (the one you created in step 2)
  5. Click Apply
  6. Close Preferences and try again

This worked for me. Remember that it is also necessary to install Axis2 war file in your Tomcat installation. Link to all Axis2 packages.

Farlie answered 17/3, 2014 at 14:44 Comment(2)
link on step 2 brokenWellmannered
Removed the link. It was associated with the version of the package, so it was bound to break. Use the link at the bottom of the page to find the binary distribution.Farlie
S
1

Try checking in your project properties -> Project Facets page. When I manually try to add the facet 'Axis2 Web Services' I get a more descriptive error

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
Stylist answered 31/8, 2013 at 1:53 Comment(0)
H
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).

Hearken answered 12/5, 2014 at 8:29 Comment(1)
This is important! However, one then bumps into the next error: Exception occurred during code generation for WSDL : java.lang.NoClassDefFoundError: org/apache/ws/commons/schema/XmlSchema Caused by: java.lang.ClassNotFoundException: org.apache.ws.commons.schema.XmlSchema cannot be found by org.apache.ant_1.9.4.v201504302020 - any ideas or workaround anyone?Dibrin
H
0

Eclipse expects your project to be web type. By this I mean if you use maven, it needs to be of <type>war</type>. If not, please add the details of eclipse project

Husted answered 7/6, 2013 at 12:36 Comment(0)
A
0

Issue : This is important! However, one then bumps into the next error: Exception occurred during code generation for WSDL : java.lang.NoClassDefFoundError: org/apache/ws/commons/schema/XmlSchema Caused by: java.lang.ClassNotFoundException: org.apache.ws.commons.schema.XmlSchema cannot be found by org.apache.ant_1.9.4.v201504302020 - any ideas or workaround anyone?

Solution : I faced the same issue, seems like the issue got introduced from Axis2 1.7.0. Issue got resolved after i reverted to Axis2 1.6.0

Make sure you have done the below steps mentioned by marcelocra :

  1. Download the Axis 2 war distribution (https://archive.apache.org/dist/axis/axis2/java/core/1.6.0/)
  2. Enter Eclipse and go to Window > Preferences > Web Services > Axis2 Preferences
  3. In the Axis2 runtime location field, points to your Axis2 installation directory (the one you created in step 2), Click Apply and Close Preferences.
  4. Remember that it is also necessary to install Axis2 war file in your Tomcat installation. Link to all Axis2 packages.

Try now, This worked for us.

Apian answered 26/2, 2016 at 11:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.