Axis2 embedded in my web app is not working

☆樱花仙子☆ 提交于 2019-12-23 03:20:23

问题


OKay I lost alsmost the whole day on this. I have a webapp where I would like to add AXIS2 and start working. I added AxisServlets in the web.xml file like -

   <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>2</load-on-startup>
    </servlet>

  <servlet-mapping>
    <servlet-name>AxisServlet</servlet-name>
    <url-pattern>/services/*</url-pattern>
  </servlet-mapping>

I also added Services.xml file like

<service name="ReportViewerService">
    <description>
        This is a sample Web Service for illustrating Attachments API of Axis2
    </description>
    <parameter name="ServiceClass">myclass</parameter>
    <operation name="getReport">
        <actionMapping>urn:getReport</actionMapping>
        <messageReceiver class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
    </operation>
</service>

The directory structure is as mentioned here

WEB-ING
  | - conf
  |     |- axis2.xml
  |-lib
  |  |- all libs
  |-services
       |-ReportViewerService
               | - META-INF
                     |-services.xml
  |- web.xml

The problem is - after all of these, the service endpoint will not come, I can not see the WSDL file http://localhost:8080/BOReportingServer/services/ReportViewerService?wsdl -- this gives an exception like -

Throwable occurred: javax.servlet.ServletException: File &quot;/axis2-web/listSingleService.jsp&quot; not found

回答1:


Finally I am able to embed AXIS2 in my webapp.

It is as simple as mentioned in the tutorial , only thing is:

  • I never got the jars properly placed under WEB-INF/lib directory. Once I started from the very beginning and removed all the unwanted jars and duplicate jars from the WEB-INF/lib directory, so started working.



回答2:


I had this same symptom when trying to deploy an axis2 service with a packed (unexploded) .war file on a tomcat server.

"Throwable occurred: javax.servlet.ServletException: File &quot;/axis2-web/listSingleService.jsp&quot; not found"  

The solution was to add the 'services.list' file to the /WEB-INF/services/ folder. (There is also a modules.list file for the /WEB-INF/modules/ folder.)

These are just a text files listing out the service archive files in the folder.

/WEB-INF
 |-modules
   |-addressing-1.6.1.mar
   |-...
   |-modules.list
   |-...
   |-soapmonitor-1.6.1.mar
 |-services
   |-ReportViewerService.aar
   |-services.list

In the .list files, contain just the names of the archive files, one entry per line.

Reference: http://axis.apache.org/axis2/java/core/docs/app_server.html




回答3:


You also deployed axis2.war in your servlet container, right?

In order for Axis2 to work properly, you need to deploy it to a servlet container. A tutorial can be found here. You'll know you've done it properly when the Axis2 "Happy" page can be shown.

Once you've done that, you should be able to bundle up your service (in the structure you've described above in your question) into an .aar file and deploy it using the axis2 servlet.



来源:https://stackoverflow.com/questions/2428837/axis2-embedded-in-my-web-app-is-not-working

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!