tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tbbstny <>
Subject Re: Need help getting Derby running in JUnit
Date Tue, 23 Nov 2010 13:41:54 GMT
> If you  want to use a non-portable name, your bean can  lookup

> "openejb:Resource/MYDB".

OK, tried this first, and the lookup worked.

> If you want to do things the portable  way, your bean has to declare a
> reference to the resource via xml or  annotation:

Following those instructions, I changed the ejb-jar.xml to look like this:
(This appears to look right compared to other snippets I've found in the mail 
list archives too)


Now nothing is loaded, and I am getting this error:

[severity=ERROR,message=unexpected element 
(uri:"", local:"resource-ref"). Expected 
elements are 

> This doc is still a work in progress, but has some info on Java EE and JNDI:

I've read a few times.  Do I understand correctly that I will not be able to use 
the same JNDI names in OpenEJB inside JUnit that I'm using when deployed to 
JBoss?  For example, my JNDI name for my datasource when deployed would be 
"java:/MYDB", and my EJB might be "java:comp/env/ShortcutFacade".

Besides the ejb-jar.xml file, I have OpenEJB included as part of my test 
libraries, and my setUpClass method includes this:

            // Create initial context
            Properties properties = new Properties();
            properties.put("MYDB", "new://Resource?type=DataSource");
            properties.put("MYDB.JtaManaged", "false");
            ic = new InitialContext(properties);

View raw message