Hi David,

I'm using a test application to take it one step at a time.  I'll eventually
tackle that other one.

My current problem is "caused by:"
Caused by: java.lang.NoClassDefFoundError:
org/apache/commons/dbcp/BasicDataSource

ScrapTest.Java:
@Stateless(name="ScrapTest")
public class ScrapTest implements IScrapTest {

        @PersistenceContext(unitName = "ScrapEjb")
    private EntityManager entityManager;

        public String Echo(String EchoString) {
                // TODO Auto-generated method stub
                return EchoString;
        }

}

ejb-jar.xml:
<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar version="3.0" xmlns="http://java.sun.com/xml/ns/javaee";
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd";>
  <display-name>Scrap Ejb Test </display-name>
  <enterprise-beans>
    <session>
      <ejb-name>ScrapTest</ejb-name>
      <resource-ref>
        <res-ref-name>SchedulerDB2</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
        <res-sharing-scope>Shareable</res-sharing-scope>
      </resource-ref>
      <resource-ref>
        <res-ref-name>SchedulerDB</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
        <res-sharing-scope>Shareable</res-sharing-scope>
      </resource-ref>
    </session>
  </enterprise-beans>
</ejb-jar>


persistence.xml
<?xml version="1.0" ...>
        <persistence-unit name="ScrapEjb" transaction-type="RESOURCE_LOCAL">
        <jta-data-source>SchedulerDB</jta-data-source>
        <non-jta-data-source>SchedulerDB2</non-jta-data-source>
                <class>com.abc.ivr.test.Outboundconfiguration</class>
                <properties>
                        <!-- <property name="openjpa.Log"
value="File=/tmp/org.apache.openjpa.log, DefaultLevel=WARN, Runtime=INFO,
Tool=INFO, SQL=TRACE"/> 
                </properties>
        </persistence-unit>
</persistence>


It's during the discovery process when the EJBs in the classpath are being
loaded.  Here's the stack trace:

pache OpenEJB 3.0    build: 20080408-04:13
http://openejb.apache.org/
INFO - openejb.home = C:\Projects\IVR\geronimo\OutboundSchedulerTest
INFO - openejb.base = C:\Projects\IVR\geronimo\OutboundSchedulerTest
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=SchedulerDB2, type=Resource,
provider-id=Default JDBC Database)
INFO - Configuring Service(id=SchedulerDB, type=Resource,
provider-id=Default JDBC Database)
INFO - Configuring Service(id=Default JDK 1.3 ProxyFactory,
type=ProxyFactory, provider-id=Default JDK 1.3 ProxyFactory)
INFO - Found EjbModule in classpath:
C:\Projects\IVR\geronimo\EmailEjb\build\classes
INFO - Found EjbModule in classpath:
C:\eclipseRC3\workspace\ScrapEjb\build\classes
INFO - Configuring app: C:\Projects\IVR\geronimo\EmailEjb\build\classes
INFO - Configuring Service(id=Default Stateless Container, type=Container,
provider-id=Default Stateless Container)
INFO - Auto-creating a container for bean SysErrorEmail:
Container(type=STATELESS, id=Default Stateless Container)
INFO - Configuring Service(id=Default Mail Session, type=Resource,
provider-id=Default Mail Session)
INFO - Auto-creating a Resource with id 'Default Mail Session' of type
'javax.mail.Session for 'SysErrorEmail'.
INFO - Auto-linking resource-ref 'mail/MailSession' in bean SysErrorEmail to
Resource(id=Default Mail Session)
INFO - Loaded Module: C:\Projects\IVR\geronimo\EmailEjb\build\classes
INFO - Configuring app: C:\eclipseRC3\workspace\ScrapEjb\build\classes
INFO - Auto-linking resource-ref 'SchedulerDB2' in bean ScrapTest to
Resource(id=SchedulerDB2)
INFO - Auto-linking resource-ref 'SchedulerDB' in bean ScrapTest to
Resource(id=SchedulerDB)
INFO - Configuring PersistenceUnit(name=ScrapEjb)
INFO - Loaded Module: C:\eclipseRC3\workspace\ScrapEjb\build\classes
ERROR - FATAL ERROR: Unknown error in Assembler.  Please send the following
stack trace and this message to [EMAIL PROTECTED] :
 org.apache.xbean.recipe.ConstructionException: Error invoking factory
method: public static javax.sql.DataSource
org.apache.openejb.resource.jdbc.DataSourceFactory.create(boolean,boolean)
        at
org.apache.xbean.recipe.ObjectRecipe.createInstance(ObjectRecipe.java:419)
        at org.apache.xbean.recipe.ObjectRecipe.create(ObjectRecipe.java:191)
        at org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:28)
        at
org.apache.openejb.assembler.classic.Assembler.createResource(Assembler.java:888)
        at
org.apache.openejb.assembler.classic.Assembler.buildContainerSystem(Assembler.java:327)
        at 
org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:250)
        at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:149)
        at org.apache.openejb.OpenEJB.init(OpenEJB.java:288)
        at org.apache.openejb.OpenEJB.init(OpenEJB.java:267)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at 
org.apache.openejb.loader.OpenEJBInstance.init(OpenEJBInstance.java:36)
        at
org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:62)
        at
org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:51)
        at
org.apache.openejb.client.LocalInitialContextFactory.getInitialContext(LocalInitialContextFactory.java:40)
        at 
javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
        at 
javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
        at javax.naming.InitialContext.init(InitialContext.java:223)
        at javax.naming.InitialContext.<init>(InitialContext.java:197)
        at
com.twcable.ivr.scheduler.CallSchedulerTest.test1(CallSchedulerTest.java:64)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at
org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
        at
org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
        at
org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
        at
org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
        at
org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
        at
org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:66)
        at
org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
        at
org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
        at
org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
        at 
org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
        at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)
        at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
        at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
        at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
        at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
        at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: java.lang.NoClassDefFoundError:
org/apache/commons/dbcp/BasicDataSource


I'm guessing it's something simple with my configuration...
-- 
View this message in context: 
http://www.nabble.com/JUnit-question-tp20306283p20333264.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Reply via email to