tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From BraamB <botes.br...@gmail.com>
Subject Re: OpenEJB - Datasource lookup problem
Date Tue, 13 May 2008 06:16:51 GMT

Hallo,

Were you able to fix this problem? I am using the embedded openEJB with
Tomcat 6 and have the exact same problem. I keep getting
NameNotFoundException. Could you please help?




ManojS wrote:
> 
> 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-tp14645858p17201828.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Mime
View raw message