-
1. Re: Could not dereference object
jaikiran Dec 14, 2007 8:54 AM (in response to lasanac)What is client application trying to do? Especially, what's the purpose of using
ctx.rebind("java:MySQLDS", ref);
-
2. Re: Could not dereference object
lasanac Dec 14, 2007 10:13 AM (in response to lasanac)I am just testing the back end of the application. Currently I used:
ctx.rebind("java:MySQLDS", ref);
as it got rid of another problem that I had earlier. That was a CastException for Reference object. I did retest it without that line and got the same error.
New Code:
System.out.println("step 1");
Context ctx= new InitialContext(env);
System.out.println("step 2");
DataSource ds = (DataSource)ctx.lookup("java:MySQLDS");
System.out.println("step 3 "); -
3. Re: Could not dereference object
lasanac Dec 14, 2007 11:00 AM (in response to lasanac)Please disregard my last post!!!!!!
When I don't use:
ctx.rebind("java:MySQLDS", ref);
I get the following error:
step 1
step 2
java.lang.ClassCastException: javax.naming.Reference
at com.kt.dao.DBConnection.doConnection(DBConnection.java:43)
at com.kt.dao.MakeConnectionTest.main(MakeConnectionTest.java:17)