My Oracle Support Banner

Soaphandler Fails ClassCastException: weblogic.wsee.jaxws.HttpServletAdapter$RequestResponseWrapper$RequestWrapper cannot be cast to weblogic.servlet.internal.ServletRequestImpl (Doc ID 1562628.1)

Last updated on APRIL 09, 2018

Applies to:

Oracle WebLogic Server - Version 10.3.4 to 12.1.1.0
Information in this document applies to any platform.

Symptoms

When attempting to cast a HTTP Request in a JAX-WS handler
the following error occurs:

2013-06-16 19:56:56,886|ERROR|[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'|v1_0.login.EOPTServiceLoginHandlerImpl||weblogic.wsee.jaxws.HttpServletAdapter$RequestResponseWrapper$RequestWrapper cannot be cast to weblogic.servlet.internal.ServletRequestImpl|||
java.lang.ClassCastException: weblogic.wsee.jaxws.HttpServletAdapter$RequestResponseWrapper$RequestWrapper cannot be cast to weblogic.servlet.internal.ServletRequestImpl
at org.example.webservice.login.LoginHandlerImpl.handleMessage(LoginHandlerImpl.java:49)
at org.example.webservice.eopt.v1_0.login.EOPTServiceLoginHandlerImpl.handleMessage(EOPTServiceLoginHandlerImpl.java:35)
at org.example.webservice.eopt.v1_0.login.EOPTServiceLoginHandlerImpl.handleMessage(EOPTServiceLoginHandlerImpl.java:21)
at com.sun.xml.ws.handler.HandlerProcessor.callHandleMessage(HandlerProcessor.java:297)
at com.sun.xml.ws.handler.HandlerProcessor.callHandlersRequest(HandlerProcessor.java:140)
at com.sun.xml.ws.handler.ServerSOAPHandlerTube.callHandlersOnRequest(ServerSOAPHandlerTube.java:138)
at com.sun.xml.ws.handler.HandlerTube.processRequest(HandlerTube.java:115)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:892)
at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:841)
at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:804)
at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:706)
at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:430)
at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:640)
at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:265)
at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:163)
at weblogic.wsee.jaxws.WLSServletAdapter.handle(WLSServletAdapter.java:171)
at weblogic.wsee.jaxws.HttpServletAdapter$AuthorizedInvoke.run(HttpServletAdapter.java:708)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
at weblogic.wsee.util.ServerSecurityHelper.authenticatedInvoke(ServerSecurityHelper.java:103)
at weblogic.wsee.jaxws.HttpServletAdapter$3.run(HttpServletAdapter.java:311)
at weblogic.wsee.jaxws.HttpServletAdapter.post(HttpServletAdapter.java:336)
at weblogic.wsee.jaxws.JAXWSServlet.doRequest(JAXWSServlet.java:99)
at weblogic.servlet.http.AbstractAsyncServlet.service(AbstractAsyncServlet.java:99)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:844)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:242)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:216)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:132)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:338)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:221)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3292)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3262)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:57)
at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2171)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2097)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2075)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1514)
at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:254)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)

 
by using:

import weblogic.servlet.internal.ServletRequestImpl;

...
final ServletRequestImpl request = (ServletRequestImpl) context.get(MessageContext.SERVLET_REQUEST);
final String authHeader = request.getHeader("Authorization");

 



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


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