日期:2014-05-20  浏览次数:20844 次

AIX 系统下JDK1.4环境 运行JAVA进程,log4j-1.2.8 版本出错,求解决
操作系统 AIX
jdk1.4 

LIB :
commons-codec-1.3.jar jdom-1.0.jar
commons-httpclient-2.0.2.jar jdom.jar
commons-logging-1.0.4.jar log4j-1.2.8.jar
commons-logging-api-1.0.jar ojdbc14.jar
jcrontab.jar

启动脚本
CLASSPATH_TEMP=""
HOME=/gboss/webapp/ppp/agent
for i in $HOME/lib/*.jar; do
 CLASSPATH_TEMP=$CLASSPATH_TEMP:$i
done

JAVA_HOME=/opt/java6
export JAVA_HOME
PATH=$JAVA_HOME/bin:/usr/local/bin:$PATH
export PATH
export LANG=Zh_CN.GB18030
CLASSPATH=$JAVA_HOME/lib:$JAVA_HOME/jre/lib:$HOME/bin
AGENT_HOME=$HOME
export AGENT_HOME
CLASSPATH=.:$CLASSPATH_TEMP:$HOME/src:$CLASSPATH

export CLASSPATH
echo $CLASSPATH

nohup java -Xms128m -Xmx513m -DAGENT_HOME=${AGENT_HOME} com.linkage.agent.main.AgentEntry >../log/start.log 2>&1 &


执行,生成日志内容
/gboss/webapp/domains/intfibssdomain/agent/config
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/PropertyConfigurator
  at java.lang.ClassLoader.defineClass0(Native Method)
  at java.lang.ClassLoader.defineClass(ClassLoader.java:808)
  at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:147)
  at java.net.URLClassLoader.defineClass(URLClassLoader.java:475)
  at java.net.URLClassLoader.access$500(URLClassLoader.java:109)
  at java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:848)
  at java.security.AccessController.doPrivileged1(Native Method)
  at java.security.AccessController.doPrivileged(AccessController.java:389)
  at java.net.URLClassLoader.findClass(URLClassLoader.java:371)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:570)
  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:442)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:502)
  at com.linkage.util.logger.CoreLogger.init(CoreLogger.java:271)
  at com.linkage.util.logger.CoreLogger.<init>(CoreLogger.java:263)
  at com.linkage.util.logger.CoreLogger.<clinit>(CoreLogger.java:22)
  at com.linkage.util.configmanager.ConfigManager.parseConfigFile(ConfigManager.java:227)
  at com.linkage.util.configmanager.ConfigManager.parseConfigFiles(ConfigManager.java:198)
  at com.linkage.util.configmanager.ConfigManager.init(ConfigManager.java:187)
  at com.linkage.util.configmanager.ConfigManager.<init>(ConfigManager.java:164)
  at com.linkage.util.configmanager.ConfigManager.<clinit>(ConfigManager.java:53)
  at com.linkage.agent.main.AgentEntry.main(AgentEntry.java:18)

请各位大侠帮忙,非常急!

------解决方案--------------------
java就是这样,换低版本的log4j吧,..........
------解决方案--------------------
你这个应该是web程序吧?看看其他地方是不是还有log4j的jar包,可能是版本冲突了。
------解决方案--------------------
你看下$HOME/lib/、$JAVA_HOME/lib和$JAVA_HOME/jre/lib下面除了你放的jar包外是不是还有log4j的jar包?