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

发布于 2024-10-04 01:42:23 字数 2799 浏览 12 评论 0原文

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

在这个操作系统中安装了多个Java JDK版本,但我已经设置了环境。 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"

这是历史日志:

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)

I'm having problem deploying Axis2 v1.5.3 on my 64 bit Solaris 9 OS, I wonder what should I do in order to successfully run this Axis2 instance with JDK 6 ?

In this OS there are multiple Java JDK version installed but I have already set the env. var to point to the 1.6 binary.

Suddenly I realize that I can always open up the setenv.sh file and then hard code it manually for safer option,

export AXIS2_HOME="/opt/local/sys/axis2-1.5.3"
export JAVA_HOME="/usr/java1.6/bin/java"
export AXIS2_CLASSPATH="$AXIS2_CLASSPATH"

Here's the history log:

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)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

活泼老夫 2024-10-11 01:42:23

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

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

重新启动控制台会话并确保在运行 java -showversion 命令时获得 java 6 版本

Try to add this bit inside ~/.profile and ~/.bashrc for the user that is going to run this.

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

Restart the console session and make sure you get java 6 version when you run java -showversion command

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文