Go Premium for a chance to win a PS4. Enter to Win

x
?
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
Medium Priority
?
767 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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 1000 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 1000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
The viewer will learn how to implement Singleton Design Pattern in Java.
This video teaches viewers about errors in exception handling.
Suggested Courses
Course of the Month7 days, 17 hours left to enroll

824 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