My Oracle Support Banner

Encountering Java.lang.ClassCastException When Deploying Jersey (2.22.4) Application In Weblogic 12.2.1.3 (Doc ID 2595153.1)

Last updated on DECEMBER 07, 2021

Applies to:

Oracle WebLogic Server - Version 12.2.1.3.0 and later
Information in this document applies to any platform.

Symptoms

On : 12.2.1.3.0 version, WLS-WebServices

java.lang.ClassCastException is thrown when deploying Jersey (2.22.4) application into Weblogic 12.2.1.3

ERROR
-----------------------
java.lang.ClassCastException: Cannot cast oracle.j2ee.ws.server.jaxrs.JrfServletContainerProvider to org.glassfish.jersey.servlet.internal.spi.ServletContainerProvider
  at weblogic.application.internal.ExtensibleModuleWrapper.start(ExtensibleModuleWrapper.java:140)
  at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:124)
  at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:233)
  at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:228)
  at weblogic.application.utils.StateMachineDriver$ParallelChange.run(StateMachineDriver.java:83)
  Truncated. see log file for complete stacktrace
Caused By: java.lang.ClassCastException: Cannot cast oracle.j2ee.ws.server.jaxrs.JrfServletContainerProvider to org.glassfish.jersey.servlet.internal.spi.ServletContainerProvider
  at java.lang.Class.cast(Class.java:3369)
  at org.glassfish.jersey.internal.ServiceFinder$LazyObjectIterator.hasNext(ServiceFinder.java:713)
  at org.glassfish.jersey.internal.ServiceFinder.toArray(ServiceFinder.java:396)
  at org.glassfish.jersey.servlet.internal.ServletContainerProviderFactory.getAllServletContainerProviders(ServletContainerProviderFactory.java:66)
  at org.glassfish.jersey.servlet.init.JerseyServletContainerInitializer.onStartup(JerseyServletContainerInitializer.java:134)
  Truncated. see log file for complete stacktrace

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.