开发者

Jsystem AutoITAgent does not work - java.lang.NoClassDefFoundError: org/apache/xmlrpc/WebServer

Even so the jar files exists and are in the correct folder, I get the NoClassDefFoundError. Why? What I am doing wrong?

The Classpath definition is .\thirdparty\lib\;C:\jsystem\runner\lib\ant-jsystem.jar;C:jsystem\runner\lib\cli.jar;C:\jsystem\runner\lib\commons-logging-1.1.jar;C:\jsystem\runner\lib\embeddedCatalina.jar;C:\jsystem\runner\lib\fileParser.jar;C:\jsystem\runner\lib\filetransfer.jar;C:\jsystem\runner\lib\j2autoit.jar;C:\jsystem\runner\lib\jsystem-launcher.jar;C:\jsystem\runner\lib\jsystemAgent.jar;C:\jsyste开发者_Python百科m\runner\lib\jsystemApp.jar;C:\jsystem\runner\lib\jsystemCommon.jar;C:\jsystem\runner\lib\jsystemCore.jar;C:\jsystem\runner\lib\snmp.jar;C:\jsystem\runner\lib\stations.jar;C:\jsystem\runner\lib\swing.jar;C:\jsystem\runner\lib\tcl.jar;C:\jsystem\runner\lib\vbshell.jar;C:\jsystem\runner\lib\web.jar;C:\jsystem\runner\lib\wget.jar;
C:\jsystem\runner\lib\xmlrpc-client-3.1.3.jar;
C:\jsystem\runner\lib\xmlrpc-common-3.1.3.jar;
C:\jsystem\runner\lib\xmlrpc-server-3.1.3.jar;
C:\jsystem\runner\lib\j2autoit\j2autoit.jar
C:\jsystem\runner
Setting J2AutoIt Agent to use the port: 8888
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/xmlrpc/WebServer
   at com.jsystem.j2autoit.AutoItAgent.startAutoItWebServer(AutoItAgent.java:665)
   at com.jsystem.j2autoit.AutoItAgent.main(AutoItAgent.java:348)
   Caused by: java.lang.ClassNotFoundException: org.apache.xmlrpc.WebServer
      at java.net.URLClassLoader$1.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClassInternal(Unknown Source)
      ... 2 more


The issue is the version of the XML-RPC you are using. The package was moved from version 2 to version 3. But to use it you should remove the XML-RPC for the thirdparty directory. And see you have the current version (I think that in you case is version 3).


I found out that .\thirdparty\lib\ and .\thridparty\commonLib have to be added to the classpath, to get rid of the error.

If you do not add .\thridparty\commonLib you will get the following error:

Exception in thread "Thread-5" java.lang.NoClassDefFoundError: org/apache/commons/codec/DecoderException

Currently I've modified the runAutoItAgent.bat as follows:

@echo OFF
rem Runs AutoIt agent

set current_dir=%~dp0
set current_drive=%~d0
%current_drive%
cd %current_dir%

setlocal ENABLEDELAYEDEXPANSION
set CLASSPATH=.\thirdparty\lib\
FOR /R .\lib %%G IN (*.jar) DO set CLASSPATH=!CLASSPATH!;%%G
FOR /R .\thirdparty\commonLib %%G IN (*.jar) DO set CLASSPATH=!CLASSPATH!;%%G
FOR /R .\thirdparty\lib %%G IN (*.jar) DO set CLASSPATH=!CLASSPATH!;%%G

echo The Classpath definition is %CLASSPATH%

java -classpath "%CLASSPATH%;." com.jsystem.j2autoit.AutoItAgent 8888

rem Make sure that we see the output
@echo ON

pause
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜