Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

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
?
759 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
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…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
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.
Suggested Courses

715 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