1. 程式人生 > >安裝AXIS2的程式碼生成外掛出現錯誤

安裝AXIS2的程式碼生成外掛出現錯誤

 安裝AXIS2的程式碼生成外掛"axis2-eclipse-codegen-wizard",和服務打包外掛"axis2-eclipse-service-archiver-wizard"後。
   在使用codegen外掛來從WSDL生成JAVA程式碼檔案時,到了最後一步竟然出然了"An error occurred while completing process -java.lang.reflect.InvocationTargetException"的錯誤。解決方法如下:

   過程如下:從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目錄中,同時修改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即可!

我嘗試了以上還有錯誤,於是繼續找 發現了下面的解決辦法,搞定。。。。  哈哈

I tried all given hints. It still didnt work. I experimented a bit more and here is my solution:

1) Shutdown eclipse

2) Copying the "backport-util-concurrent-3.1.jar" from "$AXIS2_HOME/lib/" to "$ECLIPSE_HOME/plugins/Axis2_Codegen_Wizard_1.3.0/lib/"

3) Adding the following into the "runtime" element "$ECLIPSE_HOME/plugins/Axis2_Codegen_Wizard_1.3.0/plugin.xml" :

      <library name="lib/backport-util-concurrent-3.1.jar">
        <export name="*"/>
      </library>

4) In "$ECLIPSE_HOME/plugins/Axis2_Codegen_Wizard_1.3.0/plugin.xml" changing the version attribute of the "plugin" element from "1.3.0" to "1.4.0". This results still in the same exception. But leave it.

5) Now changing the version also in the plugin's folder name from "Axis2_Codegen_Wizard_1.3.0" to "Axis2_Codegen_Wizard_1.4.0".

6) Start eclipse and try the plugin