tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Blevins <david.blev...@visi.com>
Subject Re: OpenEJB with JUnit from NetBeans: NameNotFoundException
Date Thu, 09 Oct 2008 10:15:27 GMT

On Oct 9, 2008, at 4:32 AM, Bernhard Humm wrote:

> init:
> deps-jar:
> compile:
> compile-test:
> Testsuite: org.superbiz.calculator.CalculatorTest
> Apache OpenEJB 3.0    build: 20080408-04:13
> http://openejb.apache.org/
> INFO - openejb.home = C:\temp\NetBeans\OpenEJBTest
> INFO - openejb.base = C:\temp\NetBeans\OpenEJBTest
> INFO - Configuring Service(id=Default Security Service,
> type=SecurityService, provider-id=Default Security Service)
> INFO - Configuring Service(id=Default Transaction Manager,
> type=TransactionManager, provider-id=Default Transaction Manager)
> INFO - Configuring Service(id=Default JDK 1.3 ProxyFactory,
> type=ProxyFactory, provider-id=Default JDK 1.3 ProxyFactory)
> Tests run: 2, Failures: 0, Errors: 2, Time elapsed: 5,234 sec

It doesn't look like the app is getting discovered with the way it's  
setup in NetBeans.  OpenEJB will search for directories or jars  
containing a META-INF/ejb-jar.xml file and load those directories and  
jars as individual ejb jars.  We have NetBeans users, so I know it's  
capable of putting both the classes and the META-INF/ejb-jar.xml in  
the same directory so that OpenEJB can discover them together as an  
app.  We just need to figure out what might be happening with this  
particular setup.

Run this in your test case and see if your classpath is setup right.   
There should be a META-INF/ejb-jar.xml file in any directories that  
contain ejb classes that should be deployed by OpenEJB.

         Enumeration<URL> ejbJars =  
this.getClass().getClassLoader().getResources("META-INF/ejb-jar.xml");
         while (ejbJars.hasMoreElements()) {
             URL url = ejbJars.nextElement();
             System.out.println("app = " + url);
         }


-David




Mime
View raw message