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
722 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
 
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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

747 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

11 Experts available now in Live!

Get 1:1 Help Now