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)  
-   [EMAIL PROTECTED]
  |     [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)  
-   [EMAIL PROTECTED]: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)  
-   [EMAIL PROTECTED]: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)  -   [EMAIL 
PROTECTED]: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)  -   [EMAIL PROTECTED]: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.

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3940462#3940462

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3940462


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to