在使用codegen1.3外掛程式來從WSDL產生代碼,到了最後一步竟然出然 了"An error occurred while completing process -java.lang.reflect.InvocationTargetException"的錯誤
產生這種錯誤的原因一般有2種:首先關閉eclipse。
注意有可能是兩種錯誤同時出現
1.jar包缺失
從AXIS2的LIB庫中複製"geronimo-stax-api_1.0_spec-1.0.1.jar"和"backport-util-concurrent-3.1.jar"檔案到Codegen的lib目錄中,同時修改plugin.xml檔案,添加
<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>
2.版本問題
F:\Program Files\MyEclipse 6.0\eclipse\plugins\Axis2_Codegen_Wizard_1.3.0\plugin.xml中
<plugin
id="Axis2_Codegen_Wizard"
name="Axis2 Codegen Wizard Plug-in"
version="1.3.0"
provider-name="Apache Software Foundation"
class="org.apache.axis2.tool.codegen.eclipse.plugin.CodegenWizardPlugin"& gt;看看自己下載的axis2版本是否和這個配置一致,像我的是axis2-1.5.1則需修改上面的配置為<plugin
id="Axis2_Codegen_Wizard"
name="Axis2 Codegen Wizard Plug-in"
version="1.5.1" //對應的版本號碼
provider-name="Apache Software Foundation"
class="org.apache.axis2.tool.codegen.eclipse.plugin.CodegenWizardPlugin">
然後再將檔案夾的名字Axis2_Codegen_Wizard_1.3.0改為Axis2_Codegen_Wizard_1.5.1
修改完以上2步重新啟動eclipse即可。