I have a working web application and want to add an axis2 service to it.
The aar file I have been testing with is a simple java class with a public
method which echos a string.
The service is tested and worked in axis2 standalone server and when axis2 is a
web application in Tomcat (axis2.war).
But I cannot get it to work when trying to add the service only through my web
application.
I have added the aar file to the folder "myApp.war"/WEB-INF/services/
It contains:
net/
HelloEcho.class
META-INF/
MANIFEST
services.xml
zzz.wsdl
The wsdl is auto-made by java2wsdl and the aar file is made by the service
archiver codegen in eclipse.
I read in an article
(http://www.developer.com/open/article.php/10930_3777111_2) that it could be
done by adding the text written at the bottom to the web.xml file in my war
which I did. I also added a dependency for axis2 (see below).
It deploys without error and the original web application works, but I cannot
get the service to work. I get the error mentioned at the bottom when trying to
type in http://localhost:8080/myAppl/services/zzz?wsdl . Actually I get this
not matter what I write behind the services/ . But zzz is the name of the
service and what I wrote in the axis2 servers so I guess the error has to do
with axis2 not being properly configured? The article in the link above
mentions axis2.xml in a conf/ folder in the WEB-INF, but doesn't say where it
is from or what it contains.. Do I have to add more dependencies to maven or
more in the web.xml file?
Anything I have forgotten or is there an easier way to do what I want?
-Az.
Web.xml:
<servlet>
<servlet-name>AxisServlet</servlet-name>
<display-name>Apache-Axis Servlet</display-name>
<servlet-class>
org.apache.axis2.transport.http.AxisServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>AxisServlet</servlet-name>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>--------------Pom.xml:<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2</artifactId>
<version>1.4.1</version>
</dependency>-------------Error when trying to check if service is
deployed/working:javax.servlet.ServletException: Servlet.init() for servlet
AxisServlet threw exception
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
java.lang.Thread.run(Thread.java:619)
root cause java.lang.NoClassDefFoundError: javax/wsdl/xml/WSDLLocator
org.apache.axis2.transport.http.AxisServlet.initConfigContext(AxisServlet.java:516)
org.apache.axis2.transport.http.AxisServlet.init(AxisServlet.java:436)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
java.lang.Thread.run(Thread.java:619)
root cause java.lang.ClassNotFoundException: javax.wsdl.xml.WSDLLocator
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
org.apache.axis2.transport.http.AxisServlet.initConfigContext(AxisServlet.java:516)
org.apache.axis2.transport.http.AxisServlet.init(AxisServlet.java:436)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
java.lang.Thread.run(Thread.java:619)
_________________________________________________________________
Ditt liv. Dine ting. Alt på ett sted med Windows Live™.
http://windowslive.no