but when the code run to
Context ctx = (Context)ic2.lookup("java:/comp/env"); // error

error as following is thrown
>
javax.naming.NameNotFoundException: remaining name: /comp/env
at weblogic.j2eeclient.SimpleContext.resolve(SimpleContext.java:35)
at weblogic.j2eeclient.SimpleContext.resolve(SimpleContext.java:39)
at weblogic.j2eeclient.SimpleContext.lookup(SimpleContext.java:59)
at weblogic.j2eeclient.SimpleContext.lookup(SimpleContext.java:64)
at weblogic.jndi.factories.java.ReadOnlyContextWrapper.lookup(ReadOnlyContextWrapper.java:45)
at weblogic.jndi.internal.AbstractURLContext.lookup(AbstractURLContext.java:130)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at jdbc.test.ConnectOracle.getEnvironment(ConnectOracle.java:84)
at jdbc.test.ConnectOracle.main(ConnectOracle.java:178)

what is the reason?
I get this inspiration from a website [https://blogs.oracle.com/randystuph/entry/injecting_jndi_datasources_for_junit|https://blogs.oracle.com/randystuph/entry/injecting_jndi_datasources_for_junit]
which mention
>
Context initContext = new InitialContext();
Context webContext = (Context)initContext.lookup("java:/comp/env");