tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ManojS <>
Subject Re: OpenEJB - Datasource lookup problem
Date Sun, 06 Jan 2008 17:29:42 GMT

Thank you very much Mohammad and Jacek for your quick replies.

Yes, I missed to set the JNDI context factory setting at first. Now the API
has changed as follows. 

public Connection getConnection () throws Exception {
	Properties properties = new Properties();
	Context ctx = new InitialContext(properties);
	Datasource ds = (Datasource) ctx.lookup( "MyDatasource" );
	return (ds!=null?ds.getConnection():null);

I have implemented this method in a session bean only. Also, for your
information, I have added the datasource as resource referense in my
"ejb-jar.xml" and "openejb-jar.xml" files for the session bean as follows. 


Still the problem exist.

Now, as you all suggested, I will use the latest openejb 3.0. Let me
configure it first, and then in any case of issues I will come back to you
for help.

Thank you very much for your help.


Jacek Laskowski wrote:
> On Jan 6, 2008 10:51 AM, ManojS <> wrote:
>> The openejb version I am using is 1.0, because the EJB version I was
>> using
>> is 2.0.
> OpenEJB 3.0 (and any EJB3-compliant container) is fully
> backward-compatible with the previous ejb specs so using ejb 2.0
> doesn't necessarily mandate previous openejb releases. Having said
> this, I'd stronly recommend using OpenEJB 3.0 as the ejb container of
> your choice.
> Once you're at openejb3 level look it up via
> java:openejb/Resource/MyDatasource (Connector element has recently
> been deprecated).
> Download OpenEJB 3.0 from
> It's a build from today's sources.
> Jacek
> -- 
> Jacek Laskowski

View this message in context:
Sent from the OpenEJB User mailing list archive at

View raw message