java部署webService

來源:互聯網
上載者:User
部署webService的詳細步驟(開發工具為myEclipse 7.0 M2)

1.目前,在使用在使用codegen外掛程式來從WSDL產生JAVA代碼檔案時,到了最後一步竟然出然了"An error occurred while completing process -java.lang.reflect.InvocationTargetException"的錯誤。解決方案如下:
過程如下:
1.1、從AXIS2的LIB庫中複製"geronimo-stax-api_1.0_spec-1.0.1.jar"和"backport-util-concurrent-3.1.jar"檔案到Axis2_Codegen_Wizard_1.3.0的lib目錄中,
1.2、修改Axis2_Codegen_Wizard_1.3.0下的plugin.xml檔案,在<runtime>中添加
<library name="lib/geronimo-stax-api_1.0_spec-1.0.1.jar">
         <export name="*"/>
</library>
<library name="lib/backport-util-concurrent-3.1.jar">
        <export name="*"/>
</library>
到plugin.xml檔案中,儲存後重新啟動EC即可!
    (ps:目前這些修改已經修正,若需要使用直接解壓Axis2_Codegen_Wizard_1.3.0.rar和Axis2_Service_Archiver_1.3.0.rar到
myeclipse(\myeclipse\eclipse\plugins)中即可使用代碼產生和服務打包功能)。

2.webService中服務端代碼、用戶端代碼及其測試代碼的產生,詳細請參見(http://www.blogjava.net/mlzry0612/articles/185209.html)
3.服務打包完成後(產生filename.aar的檔案)。部署的詳細步驟:
   3.1. Apache Software Foundation\Tomcat 6.0\webapps   目錄下放 axis2.war 。
   3.2.把壓縮包解壓到 Apache Software Foundation\Tomcat 6.0\webapps 下
   3.3.在瀏覽器輸入: http://192.168.11.141:8090/axis2/services(具體的地址和連接埠由具體的 tomcat的conf檔案夾下的server.xml決定)

4.常見問題:
   4.1在Tomcat中,如果想使用Servlet調用器(org.apache.catalina.servlets.InvokerServlet),要在conf/web.xml中,把調用器這個servlet的註冊和映射開啟來。但對於Tomcat 6.X 而言,會出現下面錯誤:
java.lang.SecurityException: Servlet of class org.apache.catalina.servlets.InvokerServlet is privileged and cannot be loaded by this web application
解決方案:
修改conf/context.xml檔案,新加兩個屬性.
<Context  reloadable="true" privileged="true">
    <!-- Default set of monitored resources -->
    <WatchedResource>WEB-INF/web.xml</WatchedResource>
</Context>

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.