1

When I deploy my ear file on weblogic administrator console, I get the following error -

javax.servlet.ServletException: [HTTP:101249][ServletContext@47518104[app:CorporateActionDatabaseEAR-0 module:/CorporateActionDatabaseWAR path:/CorporateActionDatabaseWAR spec-version:null]]: Servlet class org.glassfish.jersey.servlet.ServletContainer for servlet Jersey Web Application could not be loaded because the requested class was not found in the classpath . java.lang.UnsupportedClassVersionError: org/glassfish/jersey/servlet/ServletContainer : unsupported classversion 51.0.

Any idea why this is happening? I know it has something to do with adding jersey-container-servlet-core jar but which module do I add it in? my war module or my jar module or my ear module? Note that it is a maven web project that I have obtained an ear file from.

My java version is 1.7 and I have already tried adding jersey-core-1.17.1 and jersey-servlet-1.17.1 to the build path of the war module but I still seem to be getting the same error.

Much appreciated!

TheLuminor
  • 1,411
  • 3
  • 19
  • 34
  • 1
    http://stackoverflow.com/questions/22022114/org-glassfish-jersey-servlet-servletcontainer-classnotfoundexception – andrucz Dec 07 '15 at 12:39

1 Answers1

0

Which version of JREare you using for weblogic?

The "unsupported classversion X.Y." error occurs when JVM tries to load a class file that has been compiled with a higher version of java. In this case, 51.0 indicates that he class file has been compiled with java 1.7 and may be your version of java is < 1.7. In that case, I see two options to solve the issue

  1. Use java 1.7 or above to run the weblogic.
  2. Or get a jersey-container-servlet-core jar (and dependent jars if any) that is compatible with your JRE.
  • But I'm using Java version 1.7! @MadhusudanaReddySunnapu – TheLuminor Dec 08 '15 at 10:38
  • Sorry, my java version was set to 1.7. whereas the weblogic JRE version is 1.6. From this link the oracle site it is clear to me that weblogic does not ship with Java 7. Though I have in installed on my computer. Any idea on how to make Weblogic run with version 7 instead of the default 1.6? @MadhusudanaReddySunnapu – TheLuminor Dec 09 '15 at 03:44
  • If the weblogic is already installed I think you must be able do that by manually updating the weblogic confiruation files like setDomainEnv.bat/sh & commEnv.sh/bat. Variables like JAVA_HOME or JDK* or JRE* related settings needs to be updated to point to java 7. Or if you have an option to reinstall the weblogic see if this link helps https://docs.oracle.com/cd/E23943_01/doc.1111/e14142/jdk7.htm#WLSIG262 – Madhusudana Reddy Sunnapu Dec 09 '15 at 06:45