Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Jdeveloper javax.naming.NameNotFoundException: Unable to resolve 'jdbc.myDS'. Resolved 'jdbc'; remai

189123Mar 3 2020 — edited Mar 4 2020

I have the below code for a normal JSP and Java application in JDeveloper 12c

public String getDSName() {

        String dsn = null;

        try{

//        Context env = (Context)new InitialContext().lookup("java:comp/env");

//        dsn = (String)env.lookup("jdbc.name");

            dsn = "/jdbc/myDS";

        }

When I execute the JSP to run in browser, it throws the below error.

javax.naming.NameNotFoundException: Unable to resolve 'jdbc.myDS'. Resolved 'jdbc'; remaining name 'myDS'

at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:1292)

at weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.java:354)

at weblogic.jndi.internal.ServerNamingNode.lookupHere(ServerNamingNode.java:227)

at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:214)

at weblogic.jndi.internal.ServerNamingNode.lookup(ServerNamingNode.java:532)

at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:228)

at weblogic.jndi.internal.ServerNamingNode.lookup(ServerNamingNode.java:532)

at weblogic.jndi.internal.RootNamingNode.lookup(RootNamingNode.java:84)

at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:228)

at weblogic.jndi.internal.ServerNamingNode.lookup(ServerNamingNode.java:532)

at weblogic.jndi.internal.RootNamingNode.lookup(RootNamingNode.java:84)

at weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.java:307)

at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:435)

at javax.naming.InitialContext.lookup(InitialContext.java:417)

This is not in the server where JNDI/JDBC to be assigned to a Adminserver; I am running from JDeveloper where connection is created under connections node.

This post has been answered by dvohra21 on Mar 3 2020
Jump to Answer
Comments
Post Details
Added on Mar 3 2020
4 comments
7,747 views