geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mafranko <ramos.fra...@gmail.com>
Subject Datasource remote lookup
Date Tue, 28 Jun 2011 18:50:07 GMT
Hi all,

I'm looking to a way to lookup a datasource deployed on WAS CE from a
external application using the JNDI name (for example:
jca:/console.dbpool/MYDATASOURCE/JCAManagedConnectionFactory/MYDATASOURCE).
That's possible?

I'm trying to do something like that:

        Properties prop = new Properties();
        prop.put(Context.INITIAL_CONTEXT_FACTORY,
            "org.apache.openejb.client.RemoteInitialContextFactory");
        prop.put(Context.PROVIDER_URL, "ejbd://localhost:4201");
        
        try {
            Context initialContext = new InitialContext(prop);
            DataSource  datasource =
(DataSource)initialContext.lookup("jca:/console.dbpool/DIS_DS/JCAManagedConnectionFactory/DIS_DS");
            
            
        } catch (NamingException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

This code returns the following exception:
javax.naming.NamingException: Expected an ejb proxy, found unknown object:
type=org.tranql.connector.jdbc.TranqlDataSource,
toString=org.tranql.connector.jdbc.TranqlDataSource@6b106b10
	at
org.apache.openejb.server.ejbd.JndiRequestHandler.doLookup(JndiRequestHandler.java:337)
	at
org.apache.openejb.server.ejbd.JndiRequestHandler.processRequest(JndiRequestHandler.java:125)
	at
org.apache.openejb.server.ejbd.EjbDaemon.processJndiRequest(EjbDaemon.java:168)


I'm using the openEJB initial context factory but I'm not sure about that...

Thanks.

--
View this message in context: http://apache-geronimo.328035.n3.nabble.com/Datasource-remote-lookup-tp3118919p3118919.html
Sent from the Users mailing list archive at Nabble.com.

Mime
View raw message