Class loading issues with Jersey 1.11 or 1.8 and Spring 3.05 or 3.1.0 (SpringServlet and javax/ws/rs/Path, get, etc)

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Class loading issues with Jersey 1.11 or 1.8 and Spring 3.05 or 3.1.0 (SpringServlet and javax/ws/rs/Path, get, etc)

Kumarasamy Ramasamy
Hi,

I need your help to resolve couple of classloader issues. Currently I'm developing the Jersey+Spring based application from scratch.

Here are the version details,

Jersey 1.11
Spring 3.1.0
Websphere 6.1
java 1.5
RAD


Following jars are used.

jersey-core-1.11
jersey-json-1.11
jersey-server-1.11
jersey-servlet-1.11
jettison-1.1
jsr311-api-1.1.1
jersey-client-1.11
jackson-core-asl-1.9.2 and related jars
asm-3.1
jaxb-api-2.2.3
org.springframework.core-3.0.5.RELEASE, web, beans, context, context-support ... jars


I tried following combinations,

Jersey 1.8 with Spring 3.0.5
Jersey 1.8 with Spring 3.1.0
Jersey 1.11 with Spring 3.0.5
Jersey 1.11 with Spring 3.1.0

Getting following issues,

[2/10/12 17:40:40:372 EST] 000000ba WebExtensionP E   Error occured while preparing the servlet for initialization.
java.lang.Exception: java.lang.LinkageError: LinkageError while defining class: com.sun.jersey.spi.spring.container.servlet.SpringServlet
Could not be defined due to: (com/sun/jersey/spi/spring/container/servlet/SpringServlet) bad major version at offset=6
This is often caused by having a class defined at multiple
locations within the classloader hierarchy.  Other potential causes
include compiling against an older or newer version of the class
that has an incompatible method signature.
Dumping the current context classloader hierarchy:
    ==> indicates defining classloader
==>[0]
com.ibm.ws.classloader.CompoundClassLoader@1be01be0
   Local ClassPath: ...
   Delegation Mode: PARENT_FIRST
   [1] com.ibm.ws.classloader.JarClassLoader@1986426470 Local Classpath:  Delegation mode: PARENT_FIRST
   [2] com.ibm.ws.classloader.ProtectionClassLoader@22422242
   [3] com.ibm.ws.bootstrap.ExtClassLoader@db60db6
   [4] org.eclipse.osgi.framework.adaptor.core.CDSBundleClassLoader@d7c0d7c
   [5] sun.misc.Launcher$AppClassLoader@6f4a6f4a
   [6] sun.misc.Launcher$ExtClassLoader@4340434
---Original exception---
java.lang.UnsupportedClassVersionError: (com/sun/jersey/spi/spring/container/servlet/SpringServlet) bad major version at offset=6



also getting
Could not be defined due to: (javax/ws/rs/Path) bad major version at offset=6
This is often caused by having a class defined at multiple
locations within the classloader hierarchy.  Other potential causes
include compiling against an older or newer version of the class
that has an incompatible method signature.
Dumping the current context classloader hierarchy:
    ==> indicates defining classloader
==>[0]
com.ibm.ws.classloader.CompoundClassLoader@25442544
   Local ClassPath: ......
   Delegation Mode: PARENT_FIRST
   [1] com.ibm.ws.classloader.JarClassLoader@146933954 Local Classpath:  Delegation mode: PARENT_FIRST
   [2] com.ibm.ws.classloader.ProtectionClassLoader@22422242
   [3] com.ibm.ws.bootstrap.ExtClassLoader@db60db6
   [4] org.eclipse.osgi.framework.adaptor.core.CDSBundleClassLoader@d7c0d7c
   [5] sun.misc.Launcher$AppClassLoader@6f4a6f4a
   [6] sun.misc.Launcher$ExtClassLoader@4340434
---Original exception---
java.lang.UnsupportedClassVersionError: (javax/ws/rs/Path) bad major version at offset=6


Thanks
Kumar



Reply | Threaded
Open this post in threaded view
|

Re: Class loading issues with Jersey 1.11 or 1.8 and Spring 3.05 or 3.1.0 (SpringServlet and javax/ws/rs/Path, get, etc)

Pavel Bucek-2
Hello Kumar,

you need jdk 1.6+ to run Jersey from version 1.3. Jersey 1.2 is the last JDK 1.5 compliant version, so you might want to try that.

Regards,
Pavel

On 2/11/12 12:10 AM, Kumarasamy R wrote:
Hi,

I need your help to resolve couple of classloader issues. Currently I'm developing the Jersey+Spring based application from scratch.

Here are the version details,

Jersey 1.11
Spring 3.1.0
Websphere 6.1
java 1.5
RAD


Following jars are used.

jersey-core-1.11
jersey-json-1.11
jersey-server-1.11
jersey-servlet-1.11
jettison-1.1
jsr311-api-1.1.1
jersey-client-1.11
jackson-core-asl-1.9.2 and related jars
asm-3.1
jaxb-api-2.2.3
org.springframework.core-3.0.5.RELEASE, web, beans, context, context-support ... jars


I tried following combinations,

Jersey 1.8 with Spring 3.0.5
Jersey 1.8 with Spring 3.1.0
Jersey 1.11 with Spring 3.0.5
Jersey 1.11 with Spring 3.1.0

Getting following issues,

[2/10/12 17:40:40:372 EST] 000000ba WebExtensionP E   Error occured while preparing the servlet for initialization.
java.lang.Exception: java.lang.LinkageError: LinkageError while defining class: com.sun.jersey.spi.spring.container.servlet.SpringServlet
Could not be defined due to: (com/sun/jersey/spi/spring/container/servlet/SpringServlet) bad major version at offset=6
This is often caused by having a class defined at multiple
locations within the classloader hierarchy.  Other potential causes
include compiling against an older or newer version of the class
that has an incompatible method signature.
Dumping the current context classloader hierarchy:
    ==> indicates defining classloader
==>[0]
com.ibm.ws.classloader.CompoundClassLoader@1be01be0
   Local ClassPath: ...
   Delegation Mode: PARENT_FIRST
   [1] com.ibm.ws.classloader.JarClassLoader@1986426470 Local Classpath:  Delegation mode: PARENT_FIRST
   [2] com.ibm.ws.classloader.ProtectionClassLoader@22422242
   [3] com.ibm.ws.bootstrap.ExtClassLoader@db60db6
   [4] org.eclipse.osgi.framework.adaptor.core.CDSBundleClassLoader@d7c0d7c
   [5] sun.misc.Launcher$AppClassLoader@6f4a6f4a
   [6] sun.misc.Launcher$ExtClassLoader@4340434
---Original exception---
java.lang.UnsupportedClassVersionError: (com/sun/jersey/spi/spring/container/servlet/SpringServlet) bad major version at offset=6



also getting
Could not be defined due to: (javax/ws/rs/Path) bad major version at offset=6
This is often caused by having a class defined at multiple
locations within the classloader hierarchy.  Other potential causes
include compiling against an older or newer version of the class
that has an incompatible method signature.
Dumping the current context classloader hierarchy:
    ==> indicates defining classloader
==>[0]
com.ibm.ws.classloader.CompoundClassLoader@25442544
   Local ClassPath: ......
   Delegation Mode: PARENT_FIRST
   [1] com.ibm.ws.classloader.JarClassLoader@146933954 Local Classpath:  Delegation mode: PARENT_FIRST
   [2] com.ibm.ws.classloader.ProtectionClassLoader@22422242
   [3] com.ibm.ws.bootstrap.ExtClassLoader@db60db6
   [4] org.eclipse.osgi.framework.adaptor.core.CDSBundleClassLoader@d7c0d7c
   [5] sun.misc.Launcher$AppClassLoader@6f4a6f4a
   [6] sun.misc.Launcher$ExtClassLoader@4340434
---Original exception---
java.lang.UnsupportedClassVersionError: (javax/ws/rs/Path) bad major version at offset=6


Thanks
Kumar




Reply | Threaded
Open this post in threaded view
|

Re: Class loading issues with Jersey 1.11 or 1.8 and Spring 3.05 or 3.1.0 (SpringServlet and javax/ws/rs/Path, get, etc)

Kumarasamy Ramasamy
In reply to this post by Kumarasamy Ramasamy
I'm struck here. anyone please help me ? I tried lot of combinations and fighting with this for last one week.

Thanks a lot in advance.

Kumar




On Fri, Feb 10, 2012 at 6:10 PM, Kumarasamy R <[hidden email]> wrote:
Hi,

I need your help to resolve couple of classloader issues. Currently I'm developing the Jersey+Spring based application from scratch.

Here are the version details,

Jersey 1.11
Spring 3.1.0
Websphere 6.1
java 1.5
RAD


Following jars are used.

jersey-core-1.11
jersey-json-1.11
jersey-server-1.11
jersey-servlet-1.11
jettison-1.1
jsr311-api-1.1.1
jersey-client-1.11
jackson-core-asl-1.9.2 and related jars
asm-3.1
jaxb-api-2.2.3
org.springframework.core-3.0.5.RELEASE, web, beans, context, context-support ... jars


I tried following combinations,

Jersey 1.8 with Spring 3.0.5
Jersey 1.8 with Spring 3.1.0
Jersey 1.11 with Spring 3.0.5
Jersey 1.11 with Spring 3.1.0

Getting following issues,

[2/10/12 17:40:40:372 EST] 000000ba WebExtensionP E   Error occured while preparing the servlet for initialization.
java.lang.Exception: java.lang.LinkageError: LinkageError while defining class: com.sun.jersey.spi.spring.container.servlet.SpringServlet
Could not be defined due to: (com/sun/jersey/spi/spring/container/servlet/SpringServlet) bad major version at offset=6
This is often caused by having a class defined at multiple
locations within the classloader hierarchy.  Other potential causes
include compiling against an older or newer version of the class
that has an incompatible method signature.
Dumping the current context classloader hierarchy:
    ==> indicates defining classloader
==>[0]
com.ibm.ws.classloader.CompoundClassLoader@1be01be0
   Local ClassPath: ...
   Delegation Mode: PARENT_FIRST
   [1] com.ibm.ws.classloader.JarClassLoader@1986426470 Local Classpath:  Delegation mode: PARENT_FIRST
   [2] com.ibm.ws.classloader.ProtectionClassLoader@22422242
   [3] com.ibm.ws.bootstrap.ExtClassLoader@db60db6
   [4] org.eclipse.osgi.framework.adaptor.core.CDSBundleClassLoader@d7c0d7c
   [5] sun.misc.Launcher$AppClassLoader@6f4a6f4a
   [6] sun.misc.Launcher$ExtClassLoader@4340434
---Original exception---
java.lang.UnsupportedClassVersionError: (com/sun/jersey/spi/spring/container/servlet/SpringServlet) bad major version at offset=6



also getting
Could not be defined due to: (javax/ws/rs/Path) bad major version at offset=6
This is often caused by having a class defined at multiple
locations within the classloader hierarchy.  Other potential causes
include compiling against an older or newer version of the class
that has an incompatible method signature.
Dumping the current context classloader hierarchy:
    ==> indicates defining classloader
==>[0]
com.ibm.ws.classloader.CompoundClassLoader@25442544
   Local ClassPath: ......
   Delegation Mode: PARENT_FIRST
   [1] com.ibm.ws.classloader.JarClassLoader@146933954 Local Classpath:  Delegation mode: PARENT_FIRST
   [2] com.ibm.ws.classloader.ProtectionClassLoader@22422242
   [3] com.ibm.ws.bootstrap.ExtClassLoader@db60db6
   [4] org.eclipse.osgi.framework.adaptor.core.CDSBundleClassLoader@d7c0d7c
   [5] sun.misc.Launcher$AppClassLoader@6f4a6f4a
   [6] sun.misc.Launcher$ExtClassLoader@4340434
---Original exception---
java.lang.UnsupportedClassVersionError: (javax/ws/rs/Path) bad major version at offset=6


Thanks
Kumar




Reply | Threaded
Open this post in threaded view
|

Re: Class loading issues with Jersey 1.11 or 1.8 and Spring 3.05 or 3.1.0 (SpringServlet and javax/ws/rs/Path, get, etc)

jyeary
I believe the issue is the version of Java you are using. Are you using Java 6?

John
____________________________

John Yeary
____________________________ 

       
____________________________ 

"Far better it is to dare mighty things, to win glorious triumphs, even though checkered by failure, than to take rank with those poor spirits who neither enjoy much nor suffer much, because they live in the gray twilight that knows not victory nor defeat."
-- Theodore Roosevelt



On Tue, Feb 14, 2012 at 9:48 AM, Kumarasamy R <[hidden email]> wrote:
I'm struck here. anyone please help me ? I tried lot of combinations and fighting with this for last one week.

Thanks a lot in advance.

Kumar




On Fri, Feb 10, 2012 at 6:10 PM, Kumarasamy R <[hidden email]> wrote:
Hi,

I need your help to resolve couple of classloader issues. Currently I'm developing the Jersey+Spring based application from scratch.

Here are the version details,

Jersey 1.11
Spring 3.1.0
Websphere 6.1
java 1.5
RAD


Following jars are used.

jersey-core-1.11
jersey-json-1.11
jersey-server-1.11
jersey-servlet-1.11
jettison-1.1
jsr311-api-1.1.1
jersey-client-1.11
jackson-core-asl-1.9.2 and related jars
asm-3.1
jaxb-api-2.2.3
org.springframework.core-3.0.5.RELEASE, web, beans, context, context-support ... jars


I tried following combinations,

Jersey 1.8 with Spring 3.0.5
Jersey 1.8 with Spring 3.1.0
Jersey 1.11 with Spring 3.0.5
Jersey 1.11 with Spring 3.1.0

Getting following issues,

[2/10/12 17:40:40:372 EST] 000000ba WebExtensionP E   Error occured while preparing the servlet for initialization.
java.lang.Exception: java.lang.LinkageError: LinkageError while defining class: com.sun.jersey.spi.spring.container.servlet.SpringServlet
Could not be defined due to: (com/sun/jersey/spi/spring/container/servlet/SpringServlet) bad major version at offset=6
This is often caused by having a class defined at multiple
locations within the classloader hierarchy.  Other potential causes
include compiling against an older or newer version of the class
that has an incompatible method signature.
Dumping the current context classloader hierarchy:
    ==> indicates defining classloader
==>[0]
com.ibm.ws.classloader.CompoundClassLoader@1be01be0
   Local ClassPath: ...
   Delegation Mode: PARENT_FIRST
   [1] com.ibm.ws.classloader.JarClassLoader@1986426470 Local Classpath:  Delegation mode: PARENT_FIRST
   [2] com.ibm.ws.classloader.ProtectionClassLoader@22422242
   [3] com.ibm.ws.bootstrap.ExtClassLoader@db60db6
   [4] org.eclipse.osgi.framework.adaptor.core.CDSBundleClassLoader@d7c0d7c
   [5] sun.misc.Launcher$AppClassLoader@6f4a6f4a
   [6] sun.misc.Launcher$ExtClassLoader@4340434
---Original exception---
java.lang.UnsupportedClassVersionError: (com/sun/jersey/spi/spring/container/servlet/SpringServlet) bad major version at offset=6



also getting
Could not be defined due to: (javax/ws/rs/Path) bad major version at offset=6
This is often caused by having a class defined at multiple
locations within the classloader hierarchy.  Other potential causes
include compiling against an older or newer version of the class
that has an incompatible method signature.
Dumping the current context classloader hierarchy:
    ==> indicates defining classloader
==>[0]
com.ibm.ws.classloader.CompoundClassLoader@25442544
   Local ClassPath: ......
   Delegation Mode: PARENT_FIRST
   [1] com.ibm.ws.classloader.JarClassLoader@146933954 Local Classpath:  Delegation mode: PARENT_FIRST
   [2] com.ibm.ws.classloader.ProtectionClassLoader@22422242
   [3] com.ibm.ws.bootstrap.ExtClassLoader@db60db6
   [4] org.eclipse.osgi.framework.adaptor.core.CDSBundleClassLoader@d7c0d7c
   [5] sun.misc.Launcher$AppClassLoader@6f4a6f4a
   [6] sun.misc.Launcher$ExtClassLoader@4340434
---Original exception---
java.lang.UnsupportedClassVersionError: (javax/ws/rs/Path) bad major version at offset=6


Thanks
Kumar





Reply | Threaded
Open this post in threaded view
|

Re: Class loading issues with Jersey 1.11 or 1.8 and Spring 3.05 or 3.1.0 (SpringServlet and javax/ws/rs/Path, get, etc)

Kumarasamy Ramasamy
In reply to this post by Kumarasamy Ramasamy
Yes, It's working with 1.2. I have to use 1.5 unfortunately... but getting other issues. I will look into it.. Anyways Thanks a lot for the help. I tried up to 1.3 then gave up :(

I sent mail to users@jersey.dev.java.net and was waiting for the reply. then somehow I came to this forum and found my post here with proper solution :-)

thanks
Kumar
Reply | Threaded
Open this post in threaded view
|

Re: Class loading issues with Jersey 1.11 or 1.8 and Spring 3.05 or 3.1.0 (SpringServlet and javax/ws/rs/Path, get, etc)

Kumarasamy Ramasamy
I meant Java 1.5

-Kumar
Reply | Threaded
Open this post in threaded view
|

Re: Class loading issues with Jersey 1.11 or 1.8 and Spring 3.05 or 3.1.0 (SpringServlet and javax/ws/rs/Path, get, etc)

jyeary
There is a post on the forum which has the minimum requirements for Jersey versions. I can't find it now since I don't have access to them. 

I know that 1.11 requires JDK 1.6

John
____________________________

John Yeary
____________________________ 

       
____________________________ 

"Far better it is to dare mighty things, to win glorious triumphs, even though checkered by failure, than to take rank with those poor spirits who neither enjoy much nor suffer much, because they live in the gray twilight that knows not victory nor defeat."
-- Theodore Roosevelt



On Tue, Feb 14, 2012 at 3:45 PM, Kumarasamy Ramasamy <[hidden email]> wrote:
I meant Java 1.5

-Kumar

--
View this message in context: http://jersey.576304.n2.nabble.com/Class-loading-issues-with-Jersey-1-11-or-1-8-and-Spring-3-05-or-3-1-0-SpringServlet-and-javax-ws-rs--tp7275363p7285432.html
Sent from the Jersey mailing list archive at Nabble.com.