pls download wsdl4j.jar into WEB-INF/lib
http://www.java2s.com/Code/Jar/AXIS2/Downloadwsdl4j162jar.htm

Martin 
______________________________________________ 
Disclaimer and confidentiality note 
This message is confidential and may be privileged. If you are not the intended 
recipient, we kindly ask you to  please inform the sender. Any unauthorised 
dissemination or copying hereof is prohibited. This message serves for 
information purposes only and shall not have any legally binding effect. Given 
that e-mails can easily be subject to manipulation, we can not accept any 
liability for the content provided.






From: [email protected]
To: [email protected]
Subject: Adding Axis2 service to existing web application.
Date: Wed, 1 Apr 2009 21:13:24 +0000








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)


Få gratisprogrammene fra Windows Live™. Last ned her.
_________________________________________________________________
Windows Live™: Keep your life in sync.
http://windowslive.com/explore?ocid=TXT_TAGLM_WL_allup_1a_explore_042009

Reply via email to