Cannot instantiate class: weblogic.jndi.WLInititialContext - Weblogic
This is a discussion on Cannot instantiate class: weblogic.jndi.WLInititialContext - Weblogic ; I am trying to run a very simple java application.I have installed weblogic 7.0.
I have included weblogic.jar in my classpath.
The error is being caused by the code
Hashtable ht=new Hashtable();
ht.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
ht.put(Context.PROVIDER_URL,"t3://localhost:7001");
//Get a Context for the JNDI ...
-
Cannot instantiate class: weblogic.jndi.WLInititialContext
I am trying to run a very simple java application.I have installed weblogic 7.0.
I have included weblogic.jar in my classpath.
The error is being caused by the code
Hashtable ht=new Hashtable();
ht.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
ht.put(Context.PROVIDER_URL,"t3://localhost:7001");
//Get a Context for the JNDI lookup
ctx=new InitialContext(ht);
javax.sql.DataSource ds=(javax.sql.DataSource)ctx.lookup("JWSPoolDataSource");
conn=ds.getConnection();
System.out.println("Making a Connection ..");
//Execute SQL statements
stmt=conn.createStatement();
Any help will be greatly appreciated
-
Re: Cannot instantiate class: weblogic.jndi.WLInititialContext
Hi there,
I see nothing wrong in your code. Have you tried using weblogic.jndi.Environment
instead. I assume by trying to set such properties, you are trying to connect
to WLS from a remote machine.
Thanks,
-RT
pradyot wrote:
>I am trying to run a very simple java application.I have installed weblogic
>7.0.
>I have included weblogic.jar in my classpath.
>
>The error is being caused by the code
>Hashtable ht=new Hashtable();
> ht.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
> ht.put(Context.PROVIDER_URL,"t3://localhost:7001");
>
> //Get a Context for the JNDI lookup
>
> ctx=new InitialContext(ht);
>
> javax.sql.DataSource ds=(javax.sql.DataSource)ctx.lookup("JWSPoolDataSource");
> conn=ds.getConnection();
>
> System.out.println("Making a Connection ..");
>
> //Execute SQL statements
>
> stmt=conn.createStatement();
>
>Any help will be greatly appreciated