Hello,
I was playing with openejb and a test ejb application in my machine. My
intention was to identify how much openejb is useful for me as an ejb
container, so that I can recommend to use at my workplace. While I was
trying to integrate openejb along with the application I cannot able to
lookup the datasource connection defined in the openejb.conf file. If I
explain in detail, my openejb.conf has the following connection
configuration.
<Connector id="MyDatasource" type="Datasource">
JdbcDriver org.gjt.mysql.Driver
JdbcUrl jdbc:mysql://localhost:3306/test_db
UserName root
Password 12345
jtamanaged true
</Connector>
I am using the "Default Stateless Container" with ctype="STATELESS". And my
ejb code (my ejbs are stateless session beans) for datasource lookup is as
follows,
public Connection getConnection () throws Exception {
Context ctx = new InitialContext();
Datasource ds = (Datasource) ctx.lookup( "MyDatasource" );
return (ds!=null?ds.getConnection():null);
}
This code is throwing a javax.naming.NameNotFoundException. I tried with
various other JNDI names like "java:comp/MyDatasource",
"java:openejb/MyDatasource" etc. But the same result.
The openejb version I am using is 1.0, because the EJB version I was using
is 2.0.
Can anyone help me to figure out what is the JNDI name to use for connector
lookup ?
Thanks in advance.
Manoj.
--
View this message in context: http://www.nabble.com/OpenEJB---Datasource-lookup-problem-tp14645858p14645858.html
Sent from the OpenEJB User mailing list archive at Nabble.com.
|