线程“main”中的异常java.lang.UnsupportedClassVersionError:org / apache / axis2 / transport / SimpleAxis2Server(不支持的major.minor版本49.0

时间:2010-11-23 02:18:07

标签: solaris axis2

我在64位Solaris 9操作系统上部署Axis2 v1.5.3时遇到问题,我想知道如何使用JDK 6成功运行此Axis2实例?

在这个操作系统中安装了多个Java JDK版本,但我已经设置了env。 var指向1.6二进制文件。

突然我意识到我可以随时打开 setenv.sh 文件,然后手动硬编码以获得更安全的选项,

export AXIS2_HOME="/opt/local/sys/axis2-1.5.3"
export JAVA_HOME="/usr/java1.6/bin/java"
export AXIS2_CLASSPATH="$AXIS2_CLASSPATH"
你怎么看?请参阅下面附带的代码?

任何形式的评论和建议将不胜感激。

谢谢,

AWT

这是历史记录:

npapsg# uname -a
SunOS npapsg.domain.com 5.9 Generic_117171-17 sun4u sparc SUNW,Sun-Fire-280R

npapsg# pwd
/opt/local/sys/axis2-1.5.3/bin

npapsg# ls
axis2.bat        axis2server.sh   setenv.sh
axis2.sh         java2wsdl.bat    wsdl2java.bat
axis2server.bat  java2wsdl.sh     wsdl2java.sh

npapsg# env
TERM=xterm
HOME=/
SHELL=/bin/zsh
USER=root
LOGNAME=root
PATH=/usr/bin:/usr/sbin:/opt/local/bin:/usr/local/bin:/opt/oracle/product/9.2.0/bin:/usr/ucb:/bin:/usr/bin:/etc:/usr/sbin:/usr/bin:/opt/SUNWspro-4.0.1/bin:/usr/ucb:/etc:/usr/ccs/bin:/opt/local/bin:/opt/local/etc:/opt/local/licenses:/usr/local/bin:/usr/local/etc::/usr/cssc/bin::/opt/gnu/bin:/usr/gnu/bin:::/opt/X11R5/bin:/usr/local/X11/R5/bin:/home/products/openwin-3.2/bin:/home/products/openwin-3.2/demo::/opt/SUNWmotif/bin:/opt/java/bin:::/opt/local/cap/bin:/home/products/ddts/sol2x_bin:::.:/usr/openwin/bin
PWD=/opt/local/sys/axis2-1.5.3/bin
SHLVL=1
ORACLE_HOME=/opt/oracle/product/9.2.0
HISTSIZE=1000
_=/usr/bin/env

npapsg# ./setenv.sh
 Using AXIS2_HOME:   /opt/local/sys/axis2-1.5.3
 Using JAVA_HOME:       /usr/java1.6/bin/java

npapsg# ./axis2server.sh
 Using AXIS2_HOME:   /opt/local/sys/axis2-1.5.3
 Using JAVA_HOME:       /usr/java1.6/bin/java
**Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/axis2/transport/SimpleAxis2Server (Unsupported major.minor version 49.0)**
        at java.lang.ClassLoader.defineClass0(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)

npapsg#  /usr/java1.6/bin/java -version
java version "1.6.0_06"
Java(TM) SE Runtime Environment (build 1.6.0_06-b02)
Java HotSpot(TM) Server VM (build 10.0-b22, mixed mode)

1 个答案:

答案 0 :(得分:2)

尝试在~/.profile~/.bashrc中为要运行此功能的用户添加此位。

export JAVA_HOME=/usr/java1.6
export PATH=$PATH:$JAVA_HOME/bin 

重新启动控制台会话,并确保在运行java -showversion命令

时获得java 6版本