• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

weblogic.jndi.internal.WLEventContextImpl cannot be cast to javax.sql.DataSource

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Got 2 webservices running on Weblogic 12c.

Both needed conversion from oracle EnterpriseManager/java6 to Java 7.

One (Let's call it webapp A) got converted pretty easy using Jdeveloper 12c, the other one (Webapp B) I converted to a java 7 Maven-project on Eclipse Kepler. (Don't ask me why, long story short: it didn't work on jdev...)

Anyways, both A and B use the same defined datasource on the weblogic container, both using pretty much the same code to retrieve the datasource.

It is working great for app A, but gives a class-cast exception on app B, and I can't seem to figure out why



This is pretty much the same code I use to get to my Connectionfactory and JMS queue's, which seems to work just fine...
The datasource name is correct, if I use anything else it fails alltogether. So, appaerantly it does find 'something', but of another type.

I can not really find an answer when I google this. I did read somewhere JDBC driver might be missing, so included oracle's thin client on my classpath (ojdbc7.jar). => Nothing

I am using apache CXF, if that matters... Not sure... It needs spring components, so there is an applicationContext.xml where I fiddled around with.
Found somewhere on google, so tried adding this. But it did not do the trick, and to be honoust, I have no clue what I'm doing here...



Is there anyone here who has a clue about what is happening here? Is there anyone who can explain to me how this stuff is supposed to work?
I'm not really into this java "magic" stuff... The InitContext for instance, how does it get the context from the server, while I am the one instantiating it with InitialContext initContext = new InitialContext() ?



Stacktrace:


Jan 30, 2014 11:54:50 PM org.apache.cxf.phase.PhaseInterceptorChain doDefaultLogging WARNING: Application {urn:hl7-org:v3}VaccinatiesOpvragen_Service#{urn:hl7-org:v3}VaccinatiesOpvragen_QueryResponse has thrown exception, unwinding now org.apache.cxf.interceptor.Fault: weblogic.jndi.internal.WLEventContextImpl cannot be cast to javax.sql.DataSource at org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:162) at org.apache.cxf.jaxws.AbstractJAXWSMethodInvoker.createFault(AbstractJAXWSMethodInvoker.java:213) at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:128) at org.apache.cxf.jaxws.AbstractJAXWSMethodInvoker.invoke(AbstractJAXWSMethodInvoker.java:178) at org.apache.cxf.jaxws.JAXWSMethodInvoker.invoke(JAXWSMethodInvoker.java:68) at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:75) at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37) at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:107) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272) at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:239) at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:248) at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:222) at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:153) at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:167) at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:286) at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:206) at javax.servlet.http.HttpServlet.service(HttpServlet.java:751) at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:262) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:280) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:254) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:136) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:341) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:238) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3363) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3333) 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:2220) at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2146) at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2124) at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1564) at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:254) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:295) at weblogic.work.ExecuteThread.run(ExecuteThread.java:254) Caused by: java.lang.ClassCastException: weblogic.jndi.internal.WLEventContextImpl cannot be cast to javax.sql.DataSource at nl.ordina.service.DbHandler.createConnection(DbHandler.java:444) at nl.ordina.service.DbHandler.<init>(DbHandler.java:74) at nl.ordina.service.DbHandler.instance(DbHandler.java:89) at nl.ordina.service.Verwerking.legVastInDB(Verwerking.java:421) at nl.ordina.service.Verwerking.verwerkBericht(Verwerking.java:143) at nl.ordina.service.VaccinatiesOpvragenProvider.invoke(VaccinatiesOpvragenProvider.java:62) at nl.ordina.service.VaccinatiesOpvragenProvider.invoke(VaccinatiesOpvragenProvider.java:1) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:180) at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96) ... 36 more



 
reply
    Bookmark Topic Watch Topic
  • New Topic