7 Replies Latest reply on May 25, 2006 2:44 PM by Sean Dawson

    Embedded EJB 3.0 JUnit Frustrations

    Michael McCullough Newbie

      I have been getting very frustrated with the number of various configurations that are possible to try to get things working to run some JUnit test cases for some simple entity beans. The latest that I can't seem to fix is:

      jboss.j2ee:jar=classes,name=CustomerDAOBean,service=EJB3 depends on:
       persistence.units:unitName=tempdb'{Create:NOT FOUND}
       persistence.units:unitName=tempdb'{Start:NOT FOUND}


      After this error I get a stack trace dump stating:

      java.lang.RuntimeException: Problems scanning classpath
       at org.jboss.ejb3.embedded.EJB3StandaloneBootstrap.scanClasspath(EJB3StandaloneBootstrap.java:248)
       at mil.navy.nrl.itd.nks.customer.EmbeddedEjb3TestCase.startupEmbeddedJboss(EmbeddedEjb3TestCase.java:42)
       at mil.navy.nrl.itd.nks.customer.EmbeddedEjb3TestCase$1.setUp(EmbeddedEjb3TestCase.java:30)
       at junit.extensions.TestSetup$1.protect(TestSetup.java:18)
       at junit.extensions.TestSetup.run(TestSetup.java:23)
       at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)


      Note that I am not deploying this to an already running instance of JBoss, but instead just trying to have an embedded instance running for running some JUnit test cases. I am following the example code that is provided in the embedded JBoss, with the exception of:

      public static void startupEmbeddedJboss() {
       EJB3StandaloneBootstrap.boot(null);
       //EJB3StandaloneBootstrap.scanClasspath("tutorial.jar");
       EJB3StandaloneBootstrap.scanClasspath();
      }


      I noticed that since I am not specifically setting the classpath, it will scan for a while until it hits this exception. I did this for the fact that I was getting other errors before, and the ability to get past those errors was a partial success for me.

      Any pointers / suggestions would be greatly appreciated.

        • 2. Re: Embedded EJB 3.0 JUnit Frustrations
          Bill Burke Master

          can you post your log? The error message means that an EJB is dependent on an EntityManager starting and the EntityManager hasn't started.

          Can you post what your classpath looks like? Also describe what your jars look like: how you have things packaged. Also post your persistence.xml.

          • 3. Re: Embedded EJB 3.0 JUnit Frustrations
            Michael McCullough Newbie

            My classpath has:

            <location of jboss>\jboss-EJB-3.0_Embeddable_ALPHA_6\conf


            I have set my JBOSS_HOME to the jboss-4.0.4.CR2 directory.

            My log is as follows (I use IntelliJ for running the test cases):
            "C:\Program Files\Java\jdk1.5.0_06\bin\java" -Xdebug -Xrunjdwp:transport=dt_socket,address=127.0.0.1:2392,suspend=y,server=n -Dfile.encoding=windows-1252 -classpath "C:\Program Files\Java\jdk1.5.0_06\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.5.0_06\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.5.0_06\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.5.0_06\jre\lib\jce.jar;C:\Program Files\Java\jdk1.5.0_06\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.5.0_06\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.5.0_06\jre\lib\rt.jar;C:\Program Files\Java\jdk1.5.0_06\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.5.0_06\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.5.0_06\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.5.0_06\jre\lib\ext\sunpkcs11.jar;C:\Projects\NkmRelease3\BusinessTier\classes;C:\Program Files\jboss-4.0.4.CR2\server\default\lib\javax.servlet.jar;C:\Program Files\jboss-4.0.4.CR2\server\default\lib\javax.servlet.jsp.jar;C:\Program Files\jboss-4.0.4.CR2\server\default\lib\jboss-j2ee.jar;C:\Program Files\jboss-4.0.4.CR2\server\default\deploy\ejb3.deployer\jboss-annotations-ejb3.jar;C:\Program Files\jboss-4.0.4.CR2\server\default\deploy\ejb3.deployer\jboss-ejb3.jar;C:\Program Files\jboss-4.0.4.CR2\server\default\deploy\ejb3.deployer\jboss-ejb3x.jar;C:\Program Files\jboss-4.0.4.CR2\server\all\lib\ejb3-persistence.jar;C:\Program Files\jboss-4.0.4.CR2\jboss-EJB-3.0_Embeddable_ALPHA_6\lib\hibernate-all.jar;C:\Program Files\jboss-4.0.4.CR2\jboss-EJB-3.0_Embeddable_ALPHA_6\lib\jboss-ejb3-all.jar;C:\Program Files\jboss-4.0.4.CR2\jboss-EJB-3.0_Embeddable_ALPHA_6\lib\thirdparty-all.jar;C:\junit3.8.1\junit.jar;C:\Program Files\JetBrains\IntelliJ IDEA 5245\lib\idea_rt.jar" com.intellij.rt.execution.junit.JUnitStarter -ideVersion5 mil.navy.nrl.itd.nks.customer.EmbeddedEjb3TestCase
            Connected to the target VM, address: '127.0.0.1:2392', transport: 'socket'
            WARN 27-04 10:24:32,778 (BeanSchemaBinding.java:init:227) -You should use the 2.0 version of the Microcontainer xml. xmlns='urn:jboss:bean-deployer:2.0'
            ERROR 27-04 10:25:30,996 (KernelErrors.java:validate:107) -
            *** DEPLOYMENTS MISSING DEPENDENCIES:
            jboss.j2ee:jar=classes,name=CustomerDAOBean,service=EJB3 depends on:
             persistence.units:unitName=tempdb'{Create:NOT FOUND}
             persistence.units:unitName=tempdb'{Start:NOT FOUND}
            jboss.j2ee:jar=classes,name=ShoppingCartBean,service=EJB3 depends on:
             persistence.units:unitName=tempdb'{Create:NOT FOUND}
             persistence.units:unitName=tempdb'{Start:NOT FOUND}
            
            Wrong test finished. Last started: null stopped: junit.framework.TestSuite@121ab80
            
            java.lang.RuntimeException: Problems scanning classpath
             at org.jboss.ejb3.embedded.EJB3StandaloneBootstrap.scanClasspath(EJB3StandaloneBootstrap.java:248)
             at mil.navy.nrl.itd.nks.customer.EmbeddedEjb3TestCase.startupEmbeddedJboss(EmbeddedEjb3TestCase.java:42)
             at mil.navy.nrl.itd.nks.customer.EmbeddedEjb3TestCase$1.setUp(EmbeddedEjb3TestCase.java:30)
             at junit.extensions.TestSetup$1.protect(TestSetup.java:18)
             at junit.extensions.TestSetup.run(TestSetup.java:23)
             at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)
            
            Disconnected from the target VM, address: '127.0.0.1:2392', transport: 'socket'
            
            Process finished with exit code -1
            


            My tutorial.jar file has the corresponding classes in mil/navy/nrl/itd/nks/customer directory; the persistence.xml in the META-INF directory; and default.persistence.properties, ejb3-interceptors-aop.xml, embedded-jboss-beans.xml, jndi.properties, and log4j.xml in the root directory of the jar file.

            My persistence.xml file is:
            <?xml version="1.0" encoding="UTF-8"?>
            <persistence>
             <persistence-unit name="tempdb">
             <jta-data-source>java:/DefaultDS</jta-data-source>
             <class>mil.navy.nrl.itd.nks.customer.Customer</class>
             <properties>
             <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
             <property name="java.naming.factory.initial" value="org.jnp.interfaces.NamingContextFactory"/>
             </properties>
             </persistence-unit>
            </persistence>
            


            If there is anything else that I need to provide, please let me know. Thanks for the help.

            • 4. Re: Embedded EJB 3.0 JUnit Frustrations
              Trygve Hardersen Newbie

              I'm having similar problems with jboss-EJB-3.0_Embeddable_ALPHA_5, it seems to me like the;

              EJB3StandaloneBootstrap.scanClasspath();


              somehow creates a second ?virtual? JAR, and therefore installs two instances of the same SessionBean.

              I run the tests from ant using the junit task, with fork set to true. On the classpath I have all JARs from the lib directory of the jboss-EJB-3.0_Embeddable distribution and the conf directory as well. In addition to this I have the PostgreSQL JDBC driver and a JAR containing my application classes and the persistence.xml configuration file. The following output is produced:

              Buildfile: build.xml
              
              init:
              
              test-user-dao:
              
              test:
               [echo] Running test com.jtalking.dao.user.impl.test.UserDAOTestRunner
               [junit] Testsuite: com.jtalking.dao.user.impl.test.UserDAOTestRunner
               [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 10.625 sec
               [junit] ------------- Standard Output ---------------
               [junit] INFO 01-05 16:08:16,062 (EmbeddableJbossEJB3.java:<init>:59) -Contructing new EmbeddableJbossEJB3 singleton
               [junit] INFO 01-05 16:08:16,062 (EmbeddableJbossEJB3.java:boot:67) -Booting JBoss embeddable EJB environment
               [junit] WARN 01-05 16:08:17,062 (BeanSchemaBinding.java:init:227) -You should use the 2.0 version of the Microcontainer xml. xmlns='urn:jboss:bean-deployer:2.0'
               [junit] INFO 01-05 16:08:17,546 (LocalTxDataSource.java:bindConnectionFactory:117) -Bound datasource to JNDI name 'java:/DefaultDS'
               [junit] INFO 01-05 16:08:17,562 (LocalTxDataSource.java:bindConnectionFactory:117) -Bound datasource to JNDI name 'java:/MainDS'
               [junit] INFO 01-05 16:08:18,359 (Ejb3Deployment.java:create:444) -EJB3 deployment time took: 359
               [junit] INFO 01-05 16:08:18,531 (Ejb3AnnotationHandler.java:getContainers:156) -found EJB3: ejbName=UserServiceImpl, class=com.jtalking.service.user.impl.UserServiceImpl, type=STATELESS
               [junit] FATAL 01-05 16:08:18,625 (PersistenceXmlLoader.java:parsePersistenceUnit:101) -main JTA
               [junit] INFO 01-05 16:08:18,625 (Ejb3Deployment.java:create:444) -EJB3 deployment time took: 266
               [junit] INFO 01-05 16:08:18,640 (Ejb3Deployment.java:create:444) -EJB3 deployment time took: 0
               [junit] INFO 01-05 16:08:18,796 (Ejb3Deployment.java:create:444) -EJB3 deployment time took: 156
               [junit] INFO 01-05 16:08:18,953 (Ejb3Deployment.java:create:444) -EJB3 deployment time took: 141
               [junit] INFO 01-05 16:08:20,343 (Ejb3Deployment.java:create:444) -EJB3 deployment time took: 1390
               [junit] INFO 01-05 16:08:20,343 (Ejb3Deployment.java:create:444) -EJB3 deployment time took: 0
               [junit] INFO 01-05 16:08:20,781 (Ejb3Deployment.java:create:444) -EJB3 deployment time took: 438
               [junit] INFO 01-05 16:08:20,796 (Ejb3Deployment.java:create:444) -EJB3 deployment time took: 0
               [junit] INFO 01-05 16:08:21,140 (Ejb3Deployment.java:create:444) -EJB3 deployment time took: 344
               [junit] INFO 01-05 16:08:21,171 (Ejb3Deployment.java:create:444) -EJB3 deployment time took: 31
               [junit] INFO 01-05 16:08:23,578 (Ejb3Deployment.java:create:444) -EJB3 deployment time took: 2407
               [junit] INFO 01-05 16:08:23,796 (Ejb3AnnotationHandler.java:getContainers:156) -found EJB3: ejbName=UserServiceImpl, class=com.jtalking.service.user.impl.UserServiceImpl, type=STATELESS
               [junit] INFO 01-05 16:08:23,921 (Ejb3AnnotationHandler.java:getContainers:156) -found EJB3: ejbName=UserServiceImpl, class=com.jtalking.service.user.impl.UserServiceImpl, type=STATELESS
               [junit] INFO 01-05 16:08:23,953 (Ejb3Deployment.java:create:444) -EJB3 deployment time took: 375
               [junit] INFO 01-05 16:08:24,453 (Ejb3Deployment.java:create:444) -EJB3 deployment time took: 500
               [junit] INFO 01-05 16:08:24,453 (MCKernelAbstraction.java:install:79) -installing bean: persistence.units:jar=jtalking-embedded-0.1.jar,unitName=main with dependencies:
               [junit] INFO 01-05 16:08:24,468 (MCKernelAbstraction.java:install:82) - AbstractDependencyMetaData@b05acd{dependency=MainDS}
               [junit] INFO 01-05 16:08:24,515 (Environment.java:<clinit>:479) -Hibernate 3.1.2
               [junit] INFO 01-05 16:08:24,546 (Environment.java:<clinit>:509) -hibernate.properties not found
               [junit] INFO 01-05 16:08:24,546 (Environment.java:<clinit>:525) -using CGLIB reflection optimizer
               [junit] INFO 01-05 16:08:24,546 (Environment.java:<clinit>:555) -using JDK 1.4 java.sql.Timestamp handling
               [junit] INFO 01-05 16:08:24,703 (Ejb3Configuration.java:scanForClasses:375) -found EJB3 @EmbeddableSuperclass: com.jtalking.model.common.impl.PersistentImpl
               [junit] INFO 01-05 16:08:24,703 (Ejb3Configuration.java:scanForClasses:365) -found EJB3 Entity bean: com.jtalking.model.user.impl.RoleImpl
               [junit] INFO 01-05 16:08:24,703 (Ejb3Configuration.java:scanForClasses:365) -found EJB3 Entity bean: com.jtalking.model.user.impl.UserImpl
               [junit] INFO 01-05 16:08:24,812 (AnnotationBinder.java:bindClass:322) -Binding entity from annotated class: com.jtalking.model.user.impl.RoleImpl
               [junit] INFO 01-05 16:08:24,859 (EntityBinder.java:bindTable:300) -Bind entity com.jtalking.model.user.impl.RoleImpl on table RoleImpl
               [junit] INFO 01-05 16:08:24,937 (AnnotationBinder.java:bindClass:322) -Binding entity from annotated class: com.jtalking.model.user.impl.UserImpl
               [junit] INFO 01-05 16:08:24,953 (EntityBinder.java:bindTable:300) -Bind entity com.jtalking.model.user.impl.UserImpl on table UserImpl
               [junit] INFO 01-05 16:08:25,156 (ConnectionProviderFactory.java:newConnectionProvider:72) -Initializing connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
               [junit] INFO 01-05 16:08:25,156 (InjectedDataSourceConnectionProvider.java:configure:34) -Using provided datasource
               [junit] INFO 01-05 16:08:25,390 (SettingsFactory.java:buildSettings:77) -RDBMS: PostgreSQL, version: 8.1.3
               [junit] INFO 01-05 16:08:25,390 (SettingsFactory.java:buildSettings:78) -JDBC driver: PostgreSQL Native Driver, version: PostgreSQL 8.1 JDBC3 with SSL (build 404)
               [junit] INFO 01-05 16:08:25,421 (Dialect.java:<init>:103) -Using dialect: org.hibernate.dialect.PostgreSQLDialect
               [junit] INFO 01-05 16:08:25,421 (TransactionFactoryFactory.java:buildTransactionFactory:31) -Using default transaction strategy (direct JDBC transactions)
               [junit] INFO 01-05 16:08:25,546 (TransactionManagerLookupFactory.java:getTransactionManagerLookup:38) -instantiating TransactionManagerLookup: org.hibernate.transaction.JBossTransactionManagerLookup
               [junit] INFO 01-05 16:08:25,546 (TransactionManagerLookupFactory.java:getTransactionManagerLookup:42) -instantiated TransactionManagerLookup
               [junit] INFO 01-05 16:08:25,546 (SettingsFactory.java:buildSettings:125) -Automatic flush during beforeCompletion(): enabled
               [junit] INFO 01-05 16:08:25,546 (SettingsFactory.java:buildSettings:129) -Automatic session close at end of transaction: disabled
               [junit] INFO 01-05 16:08:25,546 (SettingsFactory.java:buildSettings:136) -JDBC batch size: 15
               [junit] INFO 01-05 16:08:25,546 (SettingsFactory.java:buildSettings:139) -JDBC batch updates for versioned data: disabled
               [junit] INFO 01-05 16:08:25,546 (SettingsFactory.java:buildSettings:144) -Scrollable result sets: enabled
               [junit] INFO 01-05 16:08:25,546 (SettingsFactory.java:buildSettings:152) -JDBC3 getGeneratedKeys(): disabled
               [junit] INFO 01-05 16:08:25,546 (SettingsFactory.java:buildSettings:160) -Connection release mode: after_statement
               [junit] INFO 01-05 16:08:25,546 (SettingsFactory.java:buildSettings:187) -Default batch fetch size: 1
               [junit] INFO 01-05 16:08:25,562 (SettingsFactory.java:buildSettings:191) -Generate SQL with comments: disabled
               [junit] INFO 01-05 16:08:25,562 (SettingsFactory.java:buildSettings:195) -Order SQL updates by primary key: disabled
               [junit] INFO 01-05 16:08:25,562 (SettingsFactory.java:createQueryTranslatorFactory:338) -Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
               [junit] INFO 01-05 16:08:25,562 (ASTQueryTranslatorFactory.java:<init>:24) -Using ASTQueryTranslatorFactory
               [junit] INFO 01-05 16:08:25,562 (SettingsFactory.java:buildSettings:203) -Query language substitutions: {}
               [junit] INFO 01-05 16:08:25,562 (SettingsFactory.java:buildSettings:209) -Second-level cache: enabled
               [junit] INFO 01-05 16:08:25,562 (SettingsFactory.java:buildSettings:213) -Query cache: disabled
               [junit] INFO 01-05 16:08:25,562 (SettingsFactory.java:createCacheProvider:325) -Cache provider: org.hibernate.cache.HashtableCacheProvider
               [junit] INFO 01-05 16:08:25,562 (SettingsFactory.java:buildSettings:228) -Optimize cache for minimal puts: disabled
               [junit] INFO 01-05 16:08:25,562 (SettingsFactory.java:buildSettings:237) -Structured second-level cache entries: disabled
               [junit] INFO 01-05 16:08:25,578 (SettingsFactory.java:buildSettings:264) -Statistics: disabled
               [junit] INFO 01-05 16:08:25,578 (SettingsFactory.java:buildSettings:268) -Deleted entity synthetic identifier rollback: disabled
               [junit] INFO 01-05 16:08:25,578 (SettingsFactory.java:buildSettings:283) -Default entity-mode: pojo
               [junit] INFO 01-05 16:08:25,625 (SessionFactoryImpl.java:<init>:153) -building session factory
               [junit] INFO 01-05 16:08:26,062 (SessionFactoryObjectFactory.java:addInstance:82) -Not binding factory to JNDI, no JNDI name configured
               [junit] INFO 01-05 16:08:26,062 (SchemaExport.java:execute:155) -Running hbm2ddl schema export
               [junit] INFO 01-05 16:08:26,078 (SchemaExport.java:execute:182) -exporting generated schema to database
               [junit] INFO 01-05 16:08:26,140 (SchemaExport.java:execute:202) -schema export complete
               [junit] INFO 01-05 16:08:26,140 (NamingHelper.java:getInitialContext:26) -JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
               [junit] INFO 01-05 16:08:26,203 (MCKernelAbstraction.java:install:79) -installing bean: jboss.j2ee:service=EJB3,jar=jtalking-embedded-0.1,name=UserServiceImpl with dependencies:
               [junit] INFO 01-05 16:08:26,203 (MCKernelAbstraction.java:install:82) - AbstractDependencyMetaData@14b84c7{dependency=persistence.units:jar=jtalking-embedded-0.1.jar,unitName=main}
               [junit] INFO 01-05 16:08:26,656 (MCKernelAbstraction.java:install:79) -installing bean: jboss.j2ee:service=EJB3,jar=jtalking,name=UserServiceImpl with dependencies:
               [junit] INFO 01-05 16:08:26,656 (MCKernelAbstraction.java:install:82) - AbstractDependencyMetaData@f3552f{dependency=persistence.units:unitName=main}
               [junit] ERROR 01-05 16:08:26,656 (KernelErrors.java:validate:107) -
               [junit] *** DEPLOYMENTS MISSING DEPENDENCIES:
               [junit] jboss.j2ee:service=EJB3,jar=jtalking,name=UserServiceImpl depends on:
               [junit] persistence.units:unitName=main'{Create:NOT FOUND}
               [junit] persistence.units:unitName=main'{Start:NOT FOUND}
              
               [junit] FATAL 01-05 16:08:26,656 (EmbeddableJbossEJB3.java:boot:83) -Unable to boot JBoss EJB3Standalone
               [junit] java.lang.RuntimeException: Problems scanning classpath
               [junit] at org.jboss.ejb3.embedded.EJB3StandaloneBootstrap.scanClasspath(EJB3StandaloneBootstrap.java:245)
               [junit] at com.jtalking.jboss.ejb3.EmbeddableJbossEJB3.boot(EmbeddableJbossEJB3.java:72)
               [junit] at com.jtalking.jboss.ejb3.EmbeddableJbossEJB3.<init>(EmbeddableJbossEJB3.java:60)
               [junit] at com.jtalking.jboss.ejb3.EmbeddableJbossEJB3.<clinit>(EmbeddableJbossEJB3.java:25)
               [junit] at com.jtalking.dao.user.impl.test.UserDAOTest.setUp(UserDAOTest.java:34)
               [junit] at junit.framework.TestCase.runBare(TestCase.java:128)
               [junit] at junit.framework.TestResult$1.protect(TestResult.java:110)
               [junit] at junit.framework.TestResult.runProtected(TestResult.java:128)
               [junit] at junit.framework.TestResult.run(TestResult.java:113)
               [junit] at junit.framework.TestCase.run(TestCase.java:120)
               [junit] at junit.framework.TestSuite.runTest(TestSuite.java:228)
               [junit] at junit.framework.TestSuite.run(TestSuite.java:223)
               [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:297)
               [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:672)
               [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:567)
               [junit] ------------- ---------------- ---------------
              
               [junit] Testcase: testUserDAO took 10.625 sec
               [junit] Caused an ERROR
               [junit] null
               [junit] java.lang.ExceptionInInitializerError
               [junit] at com.jtalking.dao.user.impl.test.UserDAOTest.setUp(UserDAOTest.java:34)
               [junit] Caused by: java.lang.IllegalStateException: Unable to boot JBoss EJB3Standalone
               [junit] at com.jtalking.jboss.ejb3.EmbeddableJbossEJB3.boot(EmbeddableJbossEJB3.java:84)
               [junit] at com.jtalking.jboss.ejb3.EmbeddableJbossEJB3.<init>(EmbeddableJbossEJB3.java:60)
               [junit] at com.jtalking.jboss.ejb3.EmbeddableJbossEJB3.<clinit>(EmbeddableJbossEJB3.java:25)
               [junit] ... 11 more
               [junit] Caused by: java.lang.RuntimeException: Problems scanning classpath
               [junit] at org.jboss.ejb3.embedded.EJB3StandaloneBootstrap.scanClasspath(EJB3StandaloneBootstrap.java:245)
               [junit] at com.jtalking.jboss.ejb3.EmbeddableJbossEJB3.boot(EmbeddableJbossEJB3.java:72)
               [junit] ... 13 more
              
              
              BUILD FAILED
              


              If you look at the lines just before the error;
              (NamingHelper.java:getInitialContext:26) -JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
              (MCKernelAbstraction.java:install:79) -installing bean: jboss.j2ee:service=EJB3,jar=jtalking-embedded-0.1,name=UserServiceImpl with dependencies:
              (MCKernelAbstraction.java:install:82) - AbstractDependencyMetaData@14b84c7{dependency=persistence.units:jar=jtalking-embedded-0.1.jar,unitName=main}
              (MCKernelAbstraction.java:install:79) -installing bean: jboss.j2ee:service=EJB3,jar=jtalking,name=UserServiceImpl with dependencies:
              (MCKernelAbstraction.java:install:82) - AbstractDependencyMetaData@f3552f{dependency=persistence.units:unitName=main}
              


              you can see that the UserServiceImpl SessionBean is being installed twice, once from the jtalking-embedded-0.1 JAR, which is the acutal JAR, and once from a JAR named jtalking, which does not exist but is the name of the directory from within I'm running the tests. This should not be on the classpath however.

              It seems clear to me that the persistence unit named "main" is installed, and that the real cause of the problem lies elsewhere.

              Any ideas? Help much appreciated.

              • 5. Re: Embedded EJB 3.0 JUnit Frustrations
                Trygve Hardersen Newbie

                When I change the scanClasspath from;

                EJB3StandaloneBootstrap.scanClasspath();

                to
                EJB3StandaloneBootstrap.scanClasspath("jtalking-embedded-0.1.jar");

                it works fine.

                • 6. Re: Embedded EJB 3.0 JUnit Frustrations
                  Michael McCullough Newbie

                  I tried scanning the classpath directly on the tutorial.jar file, and that gets me beyond my first problem. Of course, that only gets me to the next problem where I now get NameNotFoundException's for the CustomerDAOBean and the EntityManagers not being bound (directly using the code straight from the tutorial).

                  I have checked the forums, changed my code such that it directly matches the tutorial, etc. to no avail. The only difference is that I am using the built-in JUnit debugger provided with IntelliJ. Right now, I am completely lost and even more frustrated than before to solve this issue.

                  • 7. Re: Embedded EJB 3.0 JUnit Frustrations
                    Sean Dawson Newbie

                    For future reference, removing the current directory from your classpath will solve this issue ;)