Solved

Always error in setting up Axis2 on Solaris 9 - java.lang.UnsupportedClassVersionError: org/apache/axis2/transport/SimpleAxis2Server (Unsupported major.minor version 49.0)

Posted on 2010-11-22
10
730 Views
Last Modified: 2012-05-10
Hi All,

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.

any kind of comments and suggestion would be greatly appreciated.

Thanks,

JJ
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)

Open in new window

0
Comment
Question by:jjoz
  • 5
  • 3
  • 2
10 Comments
 
LVL 92

Expert Comment

by:objects
ID: 34193535
looks like you're not running java 6
check your PATH is pointing at java6 and not an earlier version
0
 
LVL 1

Author Comment

by:jjoz
ID: 34193556
no I did install java 1.6, see the difference when i type full absolute path into the java 1.6 binary:

[b]npapsg#  /usr/java1.6/bin/java -version[/b]
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)

Open in new window


but see below when i type java it shows the old Java 1.4.2 path ?

npapsg# whereis java
java: /usr/bin/java

npapsg# java -version
java version "1.4.2_11"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_11-b06)
Java HotSpot(TM) Client VM (build 1.4.2_11-b06, mixed mode)

npapsg# echo $JAVA_HOME
/usr/java1.6/bin/java
npapsg#

Open in new window


is there anything that i can / should do ?
0
 
LVL 92

Expert Comment

by:objects
ID: 34193589
i realise you have it installed, but it does not look like you are using it

> is there anything that i can / should do ?

fix your PATH eg. add /usr/java1.6/bin to the end of it

0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 16

Expert Comment

by:Joseph Gan
ID: 34193656
To set java parameters correctly:

# which java
this will show the path for current java, eg. /usr/bin/java, normally this is a symbolic link.

To cleanup old java, just remove this link.

Then, create a symbolic link to your new java command where ever is:

# ln -s {new java path} /usr/bin/java (example only, depend on "which java" command output).
0
 
LVL 1

Author Comment

by:jjoz
ID: 34193776
thakns for the help man, however my PATH is currently setup with so many items, how do i APPNED one line to th proper Java 1.6 ?

eg. adding /usr/java1.6/bin/java the java object is actually binary not directory (the last word after /bin)

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

Open in new window

0
 
LVL 16

Assisted Solution

by:Joseph Gan
Joseph Gan earned 250 total points
ID: 34193812
PATH=$PATH:/usr/java1.6/bin/java
0
 
LVL 1

Author Comment

by:jjoz
ID: 34193851
ok, suddenly i realizethat i can always open up the setenv.sh file and then hard code it manually for safer option,

what do you think ? see the attached code below?
export AXIS2_HOME="/opt/local/sys/axis2-1.5.3"
export JAVA_HOME="/usr/java1.6/bin/java"
export AXIS2_CLASSPATH="$AXIS2_CLASSPATH"

Open in new window

0
 
LVL 92

Accepted Solution

by:
objects earned 250 total points
ID: 34194019
> eg. adding /usr/java1.6/bin/java the java object is actually binary not directory (the last word after /bin)

you should be adding: /usr/java1.6/bin

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

> what do you think ? see the attached code below?

none of that affects the version of java that is run.
your PATH handles that
0
 
LVL 1

Author Comment

by:jjoz
ID: 34194083
ah... thanks man for your suggestion.

here's what I did to make it happens.
export JAVA_HOME=/usr/java1.6/
export PATH=$JAVA_HOME/bin:$PATH

Open in new window

0
 
LVL 1

Author Closing Comment

by:jjoz
ID: 34194087
very cool !
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

816 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now