Hi,

I'm having an issue retieving a connection from a data source object
on a Weblogic server via a tomcat client and I hope someone may have
seen this before.

To reproduce this issue I have created a java class below:

public class ConnectionTester
{
// Constructor.
public ConnectionTester()
{
}

public void TestConnection()
{
// Declarations.
InitialContext ic = null;
Hashtable ht = new Hashtable();

try
{
// Create initial context.
ht.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
ht.put(Context.PROVIDER_URL, "t3://localhost:7001");
ic = new InitialContext(ht);
}
catch(NamingException ne)
{
System.out.println(ne);
return;
}

try
{
// Get data source.
DataSource ds = (DataSource)ic.lookup("ISSUER_DS_TX");

// Get connection.
Connection conn = ds.getConnection();
System.out.println("Success! Got database connection");

// Cleanup.
conn.close();
}
catch(NamingException ne)
{
System.out.println(ne);
}
catch(SQLException sqle)
{
System.out.println(sqle);
}

return;
}
}

When I create a simple java client test class and call
ConnectionTester.TestConnection, the test is successful. However, when
I create a simple jsp page on Tomcat and call the TestConnecter object
with the following code:

class="com.trintech.ecms.ConnectionTester"/>

<% oConnectionTester.TestConnection(); %>

....Tomcat complains and the following exception is raised:
java.lang.ClassCastException: Assigning instance of class $Proxy2 to
field weblogic.jdbc.rmi.SerialConnection#rmi_conn

I can see that the object returned from the lookup is of type $Proxy2
and when it tries to do a cast to a DataSource object, the cast fails.
I cannot explain why the returned object is of type $Proxy2.

I'm using Tomcat v4.0.3, Weblogic Server v7, Oracle 9.0.2 on SunOS
v5.8.

I would be grateful for any assistance that anyone can provide.

Thanks,
Michael.