Javax.naming.NameNotFoundException:Unable to resolve ' jdbc.mydb '. Resolved ' JDBC '; Remaining name '

Source: Internet
Author: User

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;


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.