0 Replies Latest reply on May 23, 2006 12:21 PM by Marco

    testing EJB3 with JUnit and embeddable alpha6

    Marco Novice

      hello all,
      ihave been testing successfully my ejb3 code using JUnit and embeddable-alpha5 jar files..
      recently, i tried to use the latest embeddable (alpha6), and when i tried my tsts they all failed.......

      here's jboss log

      ---- bootstrapping EJB3 container....
      log4j:ERROR Parsing error on line 50 and column 23
      log4j:ERROR The content of element type "log4j:configuration" must match "(renderer*,appender*,(category|logger)*,root?,categoryFactory?)".
      2006-05-23 17:16:04,406 DEBUG org.jboss.kernel.KernelFactory [main] - Starting JBoss Kernel construction...
      2006-05-23 17:16:04,593 DEBUG org.jboss.kernel.KernelFactory [main] - Completed JBoss Kernel construction. Duration: 187 milliseconds
      2006-05-23 17:16:04,968 WARN org.jboss.kernel.plugins.deployment.xml.BeanSchemaBinding [main] - You should use the 2.0 version of the Microcontainer xml. xmlns='urn:jboss:bean-deployer:2.0'
      2006-05-23 17:16:05,015 DEBUG org.jboss.kernel.plugins.deployment.xml.BeanXMLDeployer [main] - Parsing file:/D:/Sw/ExpenseControlApp/ejbs/target/test-classes/embedded-jboss-beans.xml took 406 milliseconds
      2006-05-23 17:16:05,203 INFO org.jboss.resource.adapter.jdbc.local.LocalTxDataSource [main] - Bound datasource to JNDI name 'java:/DefaultDS'
      2006-05-23 17:16:05,203 DEBUG org.jboss.kernel.plugins.deployment.xml.BeanXMLDeployer [main] - Deploying file:/D:/Sw/ExpenseControlApp/ejbs/target/test-classes/embedded-jboss-beans.xml took 594 milliseconds
      ...... deploying embedded-jboss-beans....
      2006-05-23 17:16:05,437 DEBUG org.jboss.ejb3.embedded.EJB3StandaloneBootstrap [main] - No MBeanServer
      2006-05-23 17:16:05,453 DEBUG org.jboss.ejb3.security.JaccHelper [main] - Initialising JACC Context for deployment: jboss-ejb3-all-alpha6
      2006-05-23 17:16:10,093 INFO org.jboss.ejb3.Ejb3Deployment [main] - EJB3 deployment time took: 4640
      2006-05-23 17:16:10,093 DEBUG org.jboss.ejb3.security.JaccHelper [main] - Initialising JACC Context for deployment: commons-collections-2.1.1
      2006-05-23 17:16:10,203 INFO org.jboss.ejb3.Ejb3Deployment [main] - EJB3 deployment time took: 110
      2006-05-23 17:16:10,203 DEBUG org.jboss.ejb3.security.JaccHelper [main] - Initialising JACC Context for deployment: surefire-testng-2.0-SNAPSHOT
      2006-05-23 17:16:10,218 INFO org.jboss.ejb3.Ejb3Deployment [main] - EJB3 deployment time took: 15
      2006-05-23 17:16:10,218 DEBUG org.jboss.ejb3.security.JaccHelper [main] - Initialising JACC Context for deployment: thirdparty-all-alpha6
      2006-05-23 17:16:13,187 INFO org.jboss.ejb3.Ejb3Deployment [main] - EJB3 deployment time took: 2969
      2006-05-23 17:16:13,187 DEBUG org.jboss.ejb3.security.JaccHelper [main] - Initialising JACC Context for deployment: surefire-booter-2.0-SNAPSHOT
      2006-05-23 17:16:13,187 INFO org.jboss.ejb3.Ejb3Deployment [main] - EJB3 deployment time took: 0
      2006-05-23 17:16:13,187 DEBUG org.jboss.ejb3.security.JaccHelper [main] - Initialising JACC Context for deployment: surefire-api-2.0-SNAPSHOT
      2006-05-23 17:16:13,218 INFO org.jboss.ejb3.Ejb3Deployment [main] - EJB3 deployment time took: 31
      2006-05-23 17:16:13,218 DEBUG org.jboss.ejb3.security.JaccHelper [main] - Initialising JACC Context for deployment: qdox-1.5
      2006-05-23 17:16:13,265 INFO org.jboss.ejb3.Ejb3Deployment [main] - EJB3 deployment time took: 47
      2006-05-23 17:16:13,265 DEBUG org.jboss.ejb3.security.JaccHelper [main] - Initialising JACC Context for deployment: geronimo-spec-j2ee-1.4-rc4
      2006-05-23 17:16:13,500 INFO org.jboss.ejb3.Ejb3Deployment [main] - EJB3 deployment time took: 235
      2006-05-23 17:16:13,500 DEBUG org.jboss.ejb3.security.JaccHelper [main] - Initialising JACC Context for deployment: hibernate-all-alpha6
      2006-05-23 17:16:15,000 INFO org.jboss.ejb3.Ejb3Deployment [main] - EJB3 deployment time took: 1500
      2006-05-23 17:16:15,000 DEBUG org.jboss.ejb3.security.JaccHelper [main] - Initialising JACC Context for deployment: classes
      2006-05-23 17:16:15,031 DEBUG org.jboss.ejb3.Ejb3DescriptorHandler [main] - found ejb-jar.xml file:/D:/Sw/ExpenseControlApp/ejbs/target/classes/META-INF/ejb-jar.xml
      2006-05-23 17:16:15,109 DEBUG org.jboss.ejb3.Ejb3DescriptorHandler [main] - adding class annotation org.jboss.annotation.internal.DefaultInterceptorMarker to com.myapp.econtrol.session.EControlSessionBean org.jboss.annotation.internal.DefaultInterceptorMarkerImpl@165b7e
      2006-05-23 17:16:15,109 DEBUG org.jboss.ejb3.Ejb3AnnotationHandler [main] - found EJB3: ejbName=EControlSessionBean, class=com.myapp.econtrol.session.EControlSessionBean, type=STATELESS
      2006-05-23 17:16:15,109 DEBUG org.jboss.ejb3.ProxyDeployer [main] - no declared remote bindings for : EControlSessionBean
      2006-05-23 17:16:15,234 INFO org.jboss.ejb3.Ejb3Deployment [main] - EJB3 deployment time took: 234
      2006-05-23 17:16:15,234 DEBUG org.jboss.ejb3.security.JaccHelper [main] - Initialising JACC Context for deployment: dbunit-2.1
      2006-05-23 17:16:15,406 INFO org.jboss.ejb3.Ejb3Deployment [main] - EJB3 deployment time took: 172
      2006-05-23 17:16:15,406 DEBUG org.jboss.ejb3.security.JaccHelper [main] - Initialising JACC Context for deployment: junit-3.8.1
      2006-05-23 17:16:15,484 INFO org.jboss.ejb3.Ejb3Deployment [main] - EJB3 deployment time took: 78
      2006-05-23 17:16:15,484 DEBUG org.jboss.ejb3.security.JaccHelper [main] - Initialising JACC Context for deployment: antlr-2.7.6rc1
      2006-05-23 17:16:15,718 INFO org.jboss.ejb3.Ejb3Deployment [main] - EJB3 deployment time took: 234
      2006-05-23 17:16:15,718 DEBUG org.jboss.ejb3.security.JaccHelper [main] - Initialising JACC Context for deployment: jboss-seam-ui-1.0.0CR2
      2006-05-23 17:16:15,734 INFO org.jboss.ejb3.Ejb3Deployment [main] - EJB3 deployment time took: 16
      2006-05-23 17:16:15,734 DEBUG org.jboss.ejb3.security.JaccHelper [main] - Initialising JACC Context for deployment: test-classes
      2006-05-23 17:16:15,750 INFO org.jboss.ejb3.Ejb3Deployment [main] - EJB3 deployment time took: 16
      2006-05-23 17:16:15,750 DEBUG org.jboss.ejb3.security.JaccHelper [main] - Initialising JACC Context for deployment: commons-logging-api-1.0.4
      2006-05-23 17:16:15,750 INFO org.jboss.ejb3.Ejb3Deployment [main] - EJB3 deployment time took: 0
      2006-05-23 17:16:15,765 DEBUG org.jboss.ejb3.security.JaccHelper [main] - Initialising JACC Context for deployment: ehcache-alpha6
      2006-05-23 17:16:15,781 INFO org.jboss.ejb3.Ejb3Deployment [main] - EJB3 deployment time took: 16
      2006-05-23 17:16:15,781 DEBUG org.jboss.ejb3.security.JaccHelper [main] - Initialising JACC Context for deployment: testng-4.7-jdk15
      2006-05-23 17:16:16,156 INFO org.jboss.ejb3.Ejb3Deployment [main] - EJB3 deployment time took: 375
      2006-05-23 17:16:16,156 DEBUG org.jboss.ejb3.security.JaccHelper [main] - Initialising JACC Context for deployment: ehcache-1.2beta4
      2006-05-23 17:16:16,234 INFO org.jboss.ejb3.Ejb3Deployment [main] - EJB3 deployment time took: 78
      2006-05-23 17:16:16,234 DEBUG org.jboss.ejb3.security.JaccHelper [main] - Initialising JACC Context for deployment: plexus-utils-1.1
      2006-05-23 17:16:16,312 INFO org.jboss.ejb3.Ejb3Deployment [main] - EJB3 deployment time took: 78
      2006-05-23 17:16:16,312 DEBUG org.jboss.ejb3.security.JaccHelper [main] - Initialising JACC Context for deployment: jboss-seam-1.0.0CR2
      2006-05-23 17:16:16,500 INFO org.jboss.ejb3.Ejb3Deployment [main] - EJB3 deployment time took: 188
      2006-05-23 17:16:16,500 DEBUG org.jboss.ejb3.security.JaccHelper [main] - Initialising JACC Context for deployment: bsh-2.0b1
      2006-05-23 17:16:16,656 INFO org.jboss.ejb3.Ejb3Deployment [main] - EJB3 deployment time took: 156
      2006-05-23 17:16:16,656 INFO org.jboss.ejb3.MCKernelAbstraction [main] - installing bean: persistence.units:jar=classes.jar,unitName=cal with dependencies:
      2006-05-23 17:16:16,656 INFO org.jboss.ejb3.MCKernelAbstraction [main] - AbstractDependencyMetaData@1754699{dependency=DefaultDS}
      2006-05-23 17:16:16,656 DEBUG org.jboss.ejb3.entity.PersistenceUnitDeployment [main] - Found persistence.xml file in EJB3 jar
      2006-05-23 17:16:16,687 INFO org.hibernate.cfg.Environment [main] - Hibernate 3.2 alpha2
      2006-05-23 17:16:16,703 INFO org.hibernate.cfg.Environment [main] - hibernate.properties not found
      2006-05-23 17:16:16,703 INFO org.hibernate.cfg.Environment [main] - using bytecode reflection optimizer
      2006-05-23 17:16:16,703 INFO org.hibernate.cfg.Environment [main] - Bytecode provider name : cglib
      2006-05-23 17:16:16,703 INFO org.hibernate.cfg.Environment [main] - using JDK 1.4 java.sql.Timestamp handling
      2006-05-23 17:16:16,765 DEBUG org.hibernate.ejb.Ejb3Configuration [main] - Processing PersistenceUnitInfo [
       name: cal
       persistence provider classname: org.hibernate.ejb.HibernatePersistence
       classloader: sun.misc.Launcher$AppClassLoader@133056f
       Temporary classloader: null
       excludeUnlistedClasses: false
       JTA datasource: org.jboss.resource.adapter.jdbc.WrapperDataSource@1be2893
       Non JTA datasource: null
       Transaction type: JTA
       PU root URL: file:/D:/Sw/ExpenseControlApp/ejbs/target/classes/
       Jar files URLs []
       Managed classes names []
       Mapping files names []
       Properties [
       hibernate.jacc.ctx.id: classes
       hibernate.transaction.manager_lookup_class: org.hibernate.transaction.JBossTransactionManagerLookup
       hibernate.transaction.factory_class: org.hibernate.transaction.JTATransactionFactory
       hibernate.hbm2ddl.auto: create-drop]
      2006-05-23 17:16:16,765 DEBUG org.hibernate.ejb.Ejb3Configuration [main] - Detect class: true; detect hbm: true
      2006-05-23 17:16:16,765 INFO org.hibernate.ejb.Ejb3Configuration [main] - found EJB3 Entity bean: com.myapp.econtrol.entities.Expense
      2006-05-23 17:16:16,765 INFO org.hibernate.ejb.Ejb3Configuration [main] - found EJB3 Entity bean: com.myapp.econtrol.entities.Item
      2006-05-23 17:16:16,765 INFO org.hibernate.ejb.Ejb3Configuration [main] - found EJB3 Entity bean: com.myapp.econtrol.entities.Product
      2006-05-23 17:16:16,781 ERROR org.hibernate.AssertionFailure [main] - an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session)
      org.hibernate.AssertionFailure: Unknown PersisntenceUnitTransactionType: JTA
       at org.hibernate.ejb.Ejb3Configuration.prepareProperties(Ejb3Configuration.java:687)
       at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:513)
       at org.hibernate.ejb.Ejb3Configuration.createContainerEntityManagerFactory(Ejb3Configuration.java:306)
       at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:115)
       at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:264)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
       at java.lang.reflect.Method.invoke(Unknown Source)
       at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:55)
       at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:107)
       at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
       at org.jboss.kernel.plugins.dependency.KernelControllerContextActions.dispatchJoinPoint(KernelControllerContextActions.java:100)
       at org.jboss.kernel.plugins.dependency.KernelControllerContextActions$LifecycleAction.installAction(KernelControllerContextActions.java:583)
       at org.jboss.kernel.plugins.dependency.KernelControllerContextActions$KernelControllerContextAction.install(KernelControllerContextActions.java:175)
       at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
       at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:226)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:593)
       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:346)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:438)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:379)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:225)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:151)
       at org.jboss.kernel.plugins.dependency.AbstractKernelController.install(AbstractKernelController.java:79)
       at org.jboss.kernel.plugins.dependency.AbstractKernelController.install(AbstractKernelController.java:73)
       at org.jboss.ejb3.MCKernelAbstraction.install(MCKernelAbstraction.java:86)
       at org.jboss.ejb3.Ejb3Deployment.startPersistenceUnits(Ejb3Deployment.java:623)
       at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:473)
       at org.jboss.ejb3.embedded.EJB3StandaloneDeployer.start(EJB3StandaloneDeployer.java:450)
       at org.jboss.ejb3.embedded.EJB3StandaloneBootstrap.scanClasspath(EJB3StandaloneBootstrap.java:241)
       at example1.EJB3ContainerTestNG.startup(EJB3ContainerTestNG.java:42)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
       at java.lang.reflect.Method.invoke(Unknown Source)
       at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:552)
       at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:318)
       at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:152)
       at org.testng.SuiteRunner.privateRun(SuiteRunner.java:216)
       at org.testng.SuiteRunner.run(SuiteRunner.java:146)
       at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:713)
       at org.testng.TestNG.runSuitesLocally(TestNG.java:676)
       at org.apache.maven.surefire.testng.TestNGExecutor.executeTestNG(TestNGExecutor.java:64)
       at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:75)
       at org.apache.maven.surefire.Surefire.run(Surefire.java:129)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
       at java.lang.reflect.Method.invoke(Unknown Source)
       at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:220)
       at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:733)
      2006-05-23 17:16:16,812 DEBUG org.hibernate.cfg.AnnotationConfiguration [main] - Execute first pass mapping processing
      2006-05-23 17:16:16,812 DEBUG org.hibernate.cfg.AnnotationConfiguration [main] - Process hbm files
      2006-05-23 17:16:16,812 DEBUG org.hibernate.cfg.AnnotationConfiguration [main] - Process annotated classes
      2006-05-23 17:16:16,843 INFO org.hibernate.cfg.AnnotationBinder [main] - Binding entity from annotated class: com.myapp.econtrol.entities.Expense
      2006-05-23 17:16:16,859 INFO org.hibernate.cfg.annotations.QueryBinder [main] - Binding Named query: findExpenseByDate => SELECT e FROM Expense e where e.date < :expenseDate
      2006-05-23 17:16:16,859 INFO org.hibernate.cfg.annotations.QueryBinder [main] - Binding Named query: findAllExpenses => FROM Expense e
      2006-05-23 17:16:16,859 INFO org.hibernate.cfg.annotations.QueryBinder [main] - Binding Named query: findExpenseBySite => SELECT e FROM Expense e where e.site = :site
      2006-05-23 17:16:16,875 DEBUG org.hibernate.cfg.Ejb3Column [main] - Binding column DTYPE unique false
      2006-05-23 17:16:16,875 DEBUG org.hibernate.cfg.annotations.EntityBinder [main] - Import with entity name=Expense
      2006-05-23 17:16:16,890 INFO org.hibernate.cfg.annotations.EntityBinder [main] - Bind entity com.myapp.econtrol.entities.Expense on table expense
      2006-05-23 17:16:16,890 DEBUG org.hibernate.cfg.AnnotationBinder [main] - Processing com.myapp.econtrol.entities.Expense property annotation
      2006-05-23 17:16:16,921 DEBUG org.hibernate.cfg.AnnotationBinder [main] - Processing annotations of com.myapp.econtrol.entities.Expense.id
      2006-05-23 17:16:16,921 DEBUG org.hibernate.cfg.Ejb3Column [main] - Binding column id unique false
      
      



      and here' s my persistence.xml
      <!-- Persistence file for EJB3 application -->
      <persistence>
       <persistence-unit name="cal">
       <jta-data-source>java:/DefaultDS</jta-data-source>
       <properties>
       <property name="hibernate.hbm2ddl.auto"
       value="create-drop"/>
       </properties>
       </persistence-unit>
      
      </persistence>
      
      




      anyone could help?

      thanks and regards
      marco