I am not able to call JNDI Datasource , i got the following exeption
"Exception occurred while the JNDI NamingManager was processing a javax.naming.Reference object."
weather in console it when i am testing connection , it gives successful message
My code is as follows:
Sometimes it works sometime i got this message "Exception occurred while the JNDI NamingManager was processing a javax.naming.Reference object."
Please help
Thanks in advance
Kumar
You didn't include any code that I could see, and that would be quite
important in giving us information to allow us to help you.
It seems quite likely that although you may have created a data source
in the administrative console (Hopefully now a datasource that isn't a
WebSphere version 4 one like your attempt earlier this month) that
perhaps you haven't made a reference mapping when deploying the
application.
Are you still trying to access the data source from a JSP?
Have you created a reference to a data source within your
application's deployment descriptor?
I think we'd perhaps benefit from seeing the deployment descriptor as
well as the source-code from which you are attempting to connect to
this data source. There are some good publications out there that
might help you, in fact, this might be easier if you get to understand
the deployment of your application into Tomcat 6 or something first,
then try to map that experience onto WebSphere.
Anyway: http://java.sun.com/developer/technicalArticles/xml/WebAppDev4/
might be of some use. I seem to remember that there are some good
O'Reilly books on servlet and JSP programming as well.
If you'd really like help, please do contact me, and I'll try my best
to either supply you with examples or to work with your code and
deployment descriptors to see if we can get you working with
WebSphere, or Tomcat for that matter.
Peter Bennett
www.dsps.net
www.middleware-dsps.blogspot.com
On Sep 16, 4:49 pm, kumarpsinha <kumar.pr...@sdgc.com> wrote:
> Hi all,
>
> I am not able to call JNDI Datasource , i got the following exeption
> "Exception occurred while the JNDI NamingManager was processing a javax.naming.Reference object."
>
> weather in console it when i am testing connection , it gives successful message
(Is that a reference to 'cloud' computing? 8o)
Another thought occurs. Did you install the sample programs when you
installed WebSphere?
Try running those and then take a look through the code to see how
they are written and in particular, how they make database
connections.
Pete.
at the point of exception i am getting this
Exception stack trace: com.ibm.websphere.naming.CannotInstantiateObjectException: Exception occurred while the JNDI NamingManager was processing a javax.naming.Reference object. [Root exception is javax.naming.NamingException: access denied (java.lang.RuntimePermission getClassLoader) [Root exception is java.security.AccessControlException: access denied (java.lang.RuntimePermission getClassLoader)]]
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:2097)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1951)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1866)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookupExt(CNContextImpl.java:1556)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookup(CNContextImpl.java:1358)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:172)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at com.ibm._jsp._JNDI._jspService(_JNDI.java:84)
at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:87)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1146)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:592)
at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:481)
at com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest(GenericServletWrapper.java:122)
at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.handleRequest(AbstractJSPExtensionServletWrapper.java:232)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3507)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:269)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:815)
at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1466)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:122)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:458)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:387)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:102)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:196)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:751)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:881)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1497)
Caused by: javax.naming.NamingException: access denied (java.lang.RuntimePermission getClassLoader) [Root exception is java.security.AccessControlException: access denied (java.lang.RuntimePermission getClassLoader)]
at com.ibm.websphere.advanced.cm.factory.DataSourceFactory$ResourceReferenceObjectFactory.getObjectInstance(DataSourceFactory.java:941)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
at com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookupExt(Helpers.java:896)
... 32 more
Caused by: java.security.AccessControlException: access denied (java.lang.RuntimePermission getClassLoader)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
at java.security.AccessController.checkPermission(AccessController.java:427)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at com.ibm.ws.security.core.SecurityManager.checkPermission(SecurityManager.java:213)
at java.lang.Thread.getContextClassLoader(Thread.java:1276)
at com.ibm.websphere.advanced.cm.factory.DataSourceFactory.getDSFactory(DataSourceFactory.java:1111)
at com.ibm.websphere.advanced.cm.factory.DataSourceFactory.access$100(DataSourceFactory.java:121)
at com.ibm.websphere.advanced.cm.factory.DataSourceFactory$ResourceReferenceObjectFactory.getObjectInstance(DataSourceFactory.java:937)
... 34 more
is there any permission issue? or other else?
Have you defined you datasource in the correct scope as per the
deployed application?
Preparing for Test 253
http://www.wascertify.getbegin.com