A very, very small problem with Jndi in WebLogic:
The error is as follows:
Javax.naming.NameNotFoundException:Unable to resolve ' jdbc.mydb '. Resolved ' JDBC '; Remaining name ' MyDB ' at Weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException (basicnamingnode.java:1180 ) at Weblogic.jndi.internal.BasicNamingNode.lookupHere (basicnamingnode.java:270) at Weblogic.jndi.internal.ServerNamingNode.lookupHere (servernamingnode.java:187) at Weblogic.jndi.internal.BasicNamingNode.lookup (basicnamingnode.java:210) at Weblogic.jndi.internal.BasicNamingNode.lookup (basicnamingnode.java:224) at Weblogic.jndi.internal.WLEventContextImpl.lookup (wleventcontextimpl.java:253) at Weblogic.jndi.internal.WLContextImpl.lookup (wlcontextimpl.java:426) at Javax.naming.InitialContext.lookup ( initialcontext.java:411) at Jsp_servlet.__index._jspservice (__index.java:101) at Weblogic.servlet.jsp.JspBase.service (jspbase.java:34) 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) |
The code connection is as follows:
DataSource ds = (DataSource) ctx.lookup ("Jdbc.mydb");
This is because no Jndi found, (in fact, is nonsense, the error has been explained ^_^);
Workaround:
Set the target option in the JDBC data Source-0 settings in WebLogic Management to check the service, such as the default:adminserver after the preservation can be;