In the meantime I've found solution for the problem. There is possibility in
Websphere to change DataSource. In my case I've changed it to version 4,
because it can't use DataSource 5 which is used by websphere.

On 28/01/2008, pr0v4 <[EMAIL PROTECTED]> wrote:
>
> Like you can see from the title, it describes my problem pretty well.
> Ok, I have a problem with my ULC application which is deployed on the 
> WebSphere
> Application 
> Server<https://zmsaix.zms.pan:9043/ibm/console/pa.do?_pa=-1809308291&_rid=-72547758:117a7c13ce7:-7ff3&.pa=true>
> 6.1.0.0 application borrows db connection from app server, which means it
> receiving db connection from connection pool from websphere.
> My version of ULC is 6.2.1.
>
> Here is the snippet of my code where I'm trying to borrow a connection
> from Websphere connection pool:
>
>       try{
>                         InitialContext cxt = new InitialContext();
>                         if ( cxt == null ) {
>                            throw new Exception("Uh oh -- no context!");
>                         }
>
>                         DataSource ds = (DataSource) cxt.lookup(
> "java:comp/env/jdbc/zmspayplus" );
>
>                         if ( ds == null ) {
>                            throw new Exception("Data source not found!");
>                         }
>
>                         Connection con = ds.getConnection();
>
>                         }catch(Exception e1){
>                             ULCAlert alert = new ULCAlert("Errir" ,
> e1.getMessage(), "Ok");
>                             alert.show();
>                             e1.printStackTrace();
>                         }
>        }
>
>
>
>
> That should work that way, but what I get is the following error:
>
> ********************ERROR BEGINS HERE********************\
> 00000024 Helpers       W   NMSV0605W: A javax.naming.Reference object
> looked up from the
> context "java:" with the name "comp/env/jdbc/zmspayplus" was sent to the
> JNDI Naming Manager and an exception resu
> lted. Reference data follows:
> Reference Factory Class Name:
> com.ibm.ws.util.ResRefJndiLookupObjectFactory
> Reference Factory Class Location URLs: <null>
> Reference Class Name: java.lang.Object
> Type: ResRefJndiLookupInfo
> Content: [EMAIL PROTECTED]: Look up Name="jdbc/zmspayplus";JndiLoo
> kupInfo: jndiName="jdbc/zmspayplus"; providerURL="";
> initialContextFactory=""
>
> Exception data follows:
> com.ibm.websphere.naming.CannotInstantiateObjectException: Exception
> occurred while the JNDI NamingManager was proc
> essing a javax.naming.Reference object. [Root exception is
> java.lang.Exception: Attempted to use a 5.0 DataSource o
> utside of a 2.3 servlet]
>  at com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookupExt(
> Helpers.java:1000)
>         at com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookup
> (Helpers.java:705)
>         at com.ibm.ws.naming.jndicos.CNContextImpl.processResolveResults(
> CNContextImpl.java:2093)
>         at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(
> CNContextImpl.java:1947)
>         at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(
> CNContextImpl.java:1862)
>         at com.ibm.ws.naming.jndicos.CNContextImpl.lookupExt(
> CNContextImpl.java:1552)
>         at com.ibm.ws.naming.util.IndirectJndiLookupObjectFactory$1.run(
> IndirectJndiLookupObjectFactory.java:372)
>         at com.ibm.ws.security.util.AccessController.doPrivileged(
> AccessController.java:118)
>         at
> com.ibm.ws.naming.util.IndirectJndiLookupObjectFactory.getObjectInstanceExt
> (IndirectJndiLookupObjectFact
> ory.java:221)
>         at
> com.ibm.ws.naming.util.IndirectJndiLookupObjectFactory.getObjectInstance
> (IndirectJndiLookupObjectFactory
> .java:149)
>         at com.ibm.ws.util.ResRefJndiLookupObjectFactory.getObjectInstance
> (ResRefJndiLookupObjectFactory.java:144)
>         at javax.naming.spi.NamingManager.getObjectInstance(
> NamingManager.java:316)
>         at
> com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookupExt(
> Helpers.java:896)
>         at
> com.ibm.ws.naming.urlbase.UrlContextHelper.processBoundObjectForLookup(
> UrlContextHelper.java:191)
>         at
> com.ibm.ws.naming.java.javaURLContextRoot.processBoundObjectForLookup(
> javaURLContextRoot.java:403)
>  at com.ibm.ws.naming.urlbase.UrlContextImpl.lookup(UrlContextImpl.java
> :1280)
>         at com.ibm.ws.naming.java.javaURLContextImpl.lookup(
> javaURLContextImpl.java:384)
>         at com.ibm.ws.naming.java.javaURLContextRoot.lookup(
> javaURLContextRoot.java:201)
>         at com.ibm.ws.naming.java.javaURLContextRoot.lookup(
> javaURLContextRoot.java:142)
>         at javax.naming.InitialContext.lookup(InitialContext.java:363)
>         at test.TestBoxPane$1.actionPerformed(Unknown Source)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(
> NativeMethodAccessorImpl.java:64)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:615)
>         at
> com.ulcjava.base.shared.internal.ReflectionUtilities.invokeMethod(
> ReflectionUtilities.java:93)
>         at com.ulcjava.base.application.ULCProxy.dispatchEvent(
> ULCProxy.java:422)
>         at com.ulcjava.base.application.ULCProxy.processActionEvent(
> ULCProxy.java:357)
>         at
> com.ulcjava.base.application.ULCProxy$ULCProxyDispatcher.processActionEvent
> (ULCProxy.java:18)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(
> NativeMethodAccessorImpl.java:64)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:615)
>         at
> com.ulcjava.base.shared.internal.ReflectionUtilities.invokeMethod(
> ReflectionUtilities.java:93)
>         at com.ulcjava.base.application.ULCProxy.a(ULCProxy.java:20)
>         at com.ulcjava.base.application.ULCProxy.handleEvent(ULCProxy.java
> :50)
>         at
> com.ulcjava.base.application.ULCProxy$ULCProxyDispatcher.handleEvent(
> ULCProxy.java:15)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(
> NativeMethodAccessorImpl.java:64)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:615)
>         at
> com.ulcjava.base.shared.internal.ReflectionUtilities.invokeMethod(
> ReflectionUtilities.java:93)
>         at com.ulcjava.base.application.ULCProxy.processInvokeULC(
> ULCProxy.java:124)
>         at com.ulcjava.base.application.ULCProxy.handleRequest(
> ULCProxy.java:371)
>         at com.ulcjava.base.server.ULCSession.processRequest(
> ULCSession.java:293)
>         at com.ulcjava.base.server.ULCSession.processRequests(
> ULCSession.java:215)
>         at
> com.ulcjava.container.servlet.server.ActivationSession.processRequests(
> ActivationSession.java:10)
>         at
> com.ulcjava.container.servlet.server.SendRequestsCommand.handleRequestContent
> (SendRequestsCommand.java:8
> )
>         at com.ulcjava.container.servlet.server.ContainerCommand.execute(
> ContainerCommand.java:55)
>         at
> com.ulcjava.container.servlet.server.ServletContainerAdapterHelper.a(
> ServletContainerAdapterHelper.java:
> 90)
>         at
> com.ulcjava.container.servlet.server.ServletContainerAdapterHelper.service
> (ServletContainerAdapterHelper
> .java:66)
>  at com.ulcjava.container.servlet.server.ServletContainerAdapter.service(
> ServletContainerAdapter.java:1)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
>         at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(
> ServletWrapper.java:966)
>         at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(
> ServletWrapper.java:478)
>         at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(
> ServletWrapper.java:463)
>         at
> com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(
> CacheServletWrapper.java:92)
>         at com.ibm.ws.webcontainer.WebContainer.handleRequest(
> WebContainer.java:744)
>         at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(
> WebContainer.java:1425)
>         at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(
> WCChannelLink.java:92)
>         at
> com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(
> HttpInboundLink.java:465)
>         at
> com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(
> HttpInboundLink.java:394)
>         at
> com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(
> HttpICLReadCallback.java:102)
>         at
> com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(
> AioReadCompletionListener.java:152
> )
>         at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(
> AbstractAsyncFuture.java:213)
>         at com.ibm.io.async.AbstractAsyncFuture.fireCompletionActions(
> AbstractAsyncFuture.java:195)
>         at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
>         at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:193)
>         at com.ibm.io.async.ResultHandler.runEventProcessingLoop(
> ResultHandler.java:725)
>         at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:847)
>         at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1498)
> Caused by: java.lang.Exception: Attempted to use a 5.0 DataSource outside
> of a 2.3 servlet
>         at com.ibm.ejs.j2c.ConnectionFactoryBuilderImpl.validServlet(
> ConnectionFactoryBuilderImpl.java:1179)
>         at com.ibm.ejs.j2c.ConnectionFactoryBuilderImpl.getCMConfigData(
> ConnectionFactoryBuilderImpl.java:769)
>         at com.ibm.ejs.j2c.ConnectionFactoryBuilderImpl.getObjectInstance(
> ConnectionFactoryBuilderImpl.java:361)
>         at javax.naming.spi.NamingManager.getObjectInstance(
> NamingManager.java:316)
>         at
> com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookupExt(
> Helpers.java:896)
>         ... 70 more
> ********************ERROR ENDING HERE********************\
>
>
> This is SystemOut log from Websphere, it means that log is written by ULC
> application. I've realized from the error that my application using an
> servlet 2.3... Is there any work around for this problem?
> If anyone have any kind of experience with such environment and such
> prerequisites please give some example or advice that could be helpful.
>
> Thanks and regards,
> Josip.
>

Reply via email to