users@jersey.java.net

[Jersey] 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)

From: Kumarasamy R <kumarasamyr_at_gmail.com>
Date: Tue, 14 Feb 2012 09:48:40 -0500

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 <kumarasamyr_at_gmail.com> 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_at_1be01be0
> Local ClassPath: ...
> Delegation Mode: PARENT_FIRST
> [1] com.ibm.ws.classloader.JarClassLoader_at_1986426470 Local Classpath:
> Delegation mode: PARENT_FIRST
> [2] com.ibm.ws.classloader.ProtectionClassLoader_at_22422242
> [3] com.ibm.ws.bootstrap.ExtClassLoader_at_db60db6
> [4] org.eclipse.osgi.framework.adaptor.core.CDSBundleClassLoader_at_d7c0d7c
> [5] sun.misc.Launcher$AppClassLoader_at_6f4a6f4a
> [6] sun.misc.Launcher$ExtClassLoader_at_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_at_25442544
> Local ClassPath: ......
> Delegation Mode: PARENT_FIRST
> [1] com.ibm.ws.classloader.JarClassLoader_at_146933954 Local Classpath:
> Delegation mode: PARENT_FIRST
> [2] com.ibm.ws.classloader.ProtectionClassLoader_at_22422242
> [3] com.ibm.ws.bootstrap.ExtClassLoader_at_db60db6
> [4] org.eclipse.osgi.framework.adaptor.core.CDSBundleClassLoader_at_d7c0d7c
> [5] sun.misc.Launcher$AppClassLoader_at_6f4a6f4a
> [6] sun.misc.Launcher$ExtClassLoader_at_4340434
> ---Original exception---
> *java.lang.UnsupportedClassVersionError: (javax/ws/rs/Path) bad major
> version at offset=6*
>
>
> Thanks
> Kumar
>
>
>
>