7 Replies Latest reply on Jun 28, 2008 1:04 PM by skajotde

    Error bootstrap embedded JBoss through testNG

    polygoncell

      I have download the embedded jboss and try to write a unit using testNG based on the given Customer example. But I get error while deploying the jar. The stack trace looks like this:

      INFO [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA' to JNDI name 'java:JmsXA'
      ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to Parse: name=vfs://12144816443750/ state=Not Installed mode=Manual requiredState=Parse
      org.jboss.deployers.spi.DeploymentException: Error during deploy: vfs://12144816443750/
       at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
       at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:175)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:853)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:794)
       at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:327)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1309)
       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:734)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:862)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:784)
       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:622)
       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:411)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:498)
       at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:506)
       at org.jboss.embedded.DeploymentGroup.process(DeploymentGroup.java:127)
       at org.jboss.embedded.Bootstrap.deploy(Bootstrap.java:327)
       at org.jboss.embedded.tutorial.junit.EjbResourceLocater.deploy(EjbResourceLocater.java:82)
       at org.jboss.embedded.tutorial.junit.EjbTest.testEJBs(EjbTest.java:53)
       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:597)
       at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:580)
       at org.testng.internal.Invoker.invokeMethod(Invoker.java:478)
       at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:607)
       at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:874)
       at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
       at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
       at org.testng.TestRunner.runWorkers(TestRunner.java:689)
       at org.testng.TestRunner.privateRun(TestRunner.java:566)
       at org.testng.TestRunner.run(TestRunner.java:466)
       at org.testng.SuiteRunner.runTest(SuiteRunner.java:301)
       at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:296)
       at org.testng.SuiteRunner.privateRun(SuiteRunner.java:276)
       at org.testng.SuiteRunner.run(SuiteRunner.java:191)
       at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:808)
       at org.testng.TestNG.runSuitesLocally(TestNG.java:776)
       at org.testng.TestNG.run(TestNG.java:701)
       at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73)
       at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:124)
      Caused by: java.lang.AssertionError: expected a jar or file url, but was vfs://12144816443750/
       at org.jboss.ejb3.deployers.PersistenceUnitParsingDeployer.parse(PersistenceUnitParsingDeployer.java:110)
       at org.jboss.ejb3.deployers.PersistenceUnitParsingDeployer.parse(PersistenceUnitParsingDeployer.java:89)
       at org.jboss.ejb3.deployers.PersistenceUnitParsingDeployer.parse(PersistenceUnitParsingDeployer.java:51)
       at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:223)
       at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.createMetaData(AbstractParsingDeployerWithOutput.java:199)
       at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.deploy(AbstractParsingDeployerWithOutput.java:162)
       at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:169)
       ... 37 more
      org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
      
      *** CONTEXTS IN ERROR: Name -> Error
      
      vfs://12144816443750/ -> java.lang.AssertionError: expected a jar or file url, but was vfs://12144816443750/
      
      
       at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:576)
       at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:559)
       at org.jboss.embedded.DeploymentGroup.process(DeploymentGroup.java:128)
       at org.jboss.embedded.Bootstrap.deploy(Bootstrap.java:327)
       at org.jboss.embedded.tutorial.junit.EjbResourceLocater.deploy(EjbResourceLocater.java:82)
       at org.jboss.embedded.tutorial.junit.EjbTest.testEJBs(EjbTest.java:53)
       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:597)
       at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:580)
       at org.testng.internal.Invoker.invokeMethod(Invoker.java:478)
       at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:607)
       at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:874)
       at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
       at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
       at org.testng.TestRunner.runWorkers(TestRunner.java:689)
       at org.testng.TestRunner.privateRun(TestRunner.java:566)
       at org.testng.TestRunner.run(TestRunner.java:466)
       at org.testng.SuiteRunner.runTest(SuiteRunner.java:301)
       at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:296)
       at org.testng.SuiteRunner.privateRun(SuiteRunner.java:276)
       at org.testng.SuiteRunner.run(SuiteRunner.java:191)
       at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:808)
       at org.testng.TestNG.runSuitesLocally(TestNG.java:776)
       at org.testng.TestNG.run(TestNG.java:701)
       at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73)
       at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:124)
      javax.naming.NameNotFoundException: CustomerDAOBean not bound
       at org.jnp.server.NamingServer.getBinding(NamingServer.java:542)
       at org.jnp.server.NamingServer.getBinding(NamingServer.java:550)
       at org.jnp.server.NamingServer.getObject(NamingServer.java:556)
       at org.jnp.server.NamingServer.lookup(NamingServer.java:267)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:669)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:629)
       at javax.naming.InitialContext.lookup(InitialContext.java:392)
       at org.jboss.embedded.tutorial.junit.EjbTest.testEJBs(EjbTest.java:58)
       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:597)
       at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:580)
       at org.testng.internal.Invoker.invokeMethod(Invoker.java:478)
       at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:607)
       at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:874)
       at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
       at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
       at org.testng.TestRunner.runWorkers(TestRunner.java:689)
       at org.testng.TestRunner.privateRun(TestRunner.java:566)
       at org.testng.TestRunner.run(TestRunner.java:466)
       at org.testng.SuiteRunner.runTest(SuiteRunner.java:301)
       at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:296)
       at org.testng.SuiteRunner.privateRun(SuiteRunner.java:276)
       at org.testng.SuiteRunner.run(SuiteRunner.java:191)
       at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:808)
       at org.testng.TestNG.runSuitesLocally(TestNG.java:776)
       at org.testng.TestNG.run(TestNG.java:701)
       at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73)
       at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:124)
      


      The jar is just built like it in the given junit test:

      jar = AssembledContextFactory.getInstance().create("ejbTestCase.jar");
       jar.addClass(Customer.class);
       jar.addClass(CustomerDAOBean.class);
       jar.addClass(CustomerDAOLocal.class);
       jar.addClass(CustomerDAORemote.class);
       jar.mkdir("META-INF").addResource("persistence.xml", "persistence.xml");
      


      The persistence.xml looks like this:
      <?xml version="1.0" encoding="UTF-8"?>
      <persistence>
       <persistence-unit name="custdb">
       <jta-data-source>java:/DefaultDS</jta-data-source>
       <class>org.jboss.embedded.tutorial.junit.beans.Customer</class>
       <properties>
       <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
       <property name="jboss.entity.manager.factory.jndi.name"
       value="java:/EntityManagerFactories/testEMF" />
       <property name="jboss.entity.manager.jndi.name"
       value="java:/EntityManagers/testEM" />
       </properties>
       </persistence-unit>
      </persistence>
      


      And the interest thing is: the test is passed, if the same unit test is run through Junit. I get only a WARN but it passed. The WARN looks like this:
      WARN [org.hibernate.ejb.packaging.InputStreamZippedJarVisitor] Unable to find file (ignored): vfs://12144823179210/
      java.lang.RuntimeException: Cannot open stream
       at org.jboss.virtual.plugins.context.vfs.AssembledDirectoryHandler.openStream(AssembledDirectoryHandler.java:117)
       at org.jboss.virtual.VirtualFile.openStream(VirtualFile.java:216)
       at org.jboss.virtual.plugins.vfs.VirtualFileURLConnection.getInputStream(VirtualFileURLConnection.java:117)
       at java.net.URL.openStream(URL.java:1009)
       at org.hibernate.ejb.packaging.InputStreamZippedJarVisitor.doProcessElements(InputStreamZippedJarVisitor.java:33)
       at org.hibernate.ejb.packaging.JarVisitor.getMatchingEntries(JarVisitor.java:240)
       at org.hibernate.ejb.Ejb3Configuration.addScannedEntries(Ejb3Configuration.java:275)
       at org.hibernate.ejb.Ejb3Configuration.scanForClasses(Ejb3Configuration.java:601)
       at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:347)
       at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:126)
       at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:259)
       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:597)
       at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:56)
       at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:110)
       at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
       at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:214)
       at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:45)
       at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:108)
       at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:69)
       at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:221)
       at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.installAction(KernelControllerContextAction.java:135)
       at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.installAction(KernelControllerContextAction.java:46)
       at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
       at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
       at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
       at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:327)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1309)
       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:734)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:862)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:784)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:574)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:398)
       at org.jboss.kernel.plugins.dependency.AbstractKernelController.install(AbstractKernelController.java:96)
       at org.jboss.kernel.plugins.dependency.AbstractKernelController.install(AbstractKernelController.java:90)
       at org.jboss.ejb3.MCKernelAbstraction.install(MCKernelAbstraction.java:151)
       at org.jboss.ejb3.Ejb3Deployment.startPersistenceUnits(Ejb3Deployment.java:604)
       at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:400)
       at org.jboss.ejb3.deployers.EJBStage2Deployer.deploy(EJBStage2Deployer.java:53)
       at org.jboss.ejb3.deployers.EJBStage2Deployer.deploy(EJBStage2Deployer.java:37)
       at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:65)
       at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
       at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:169)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:853)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:794)
       at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:327)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1309)
       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:734)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:862)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:784)
       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:622)
       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:411)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:498)
       at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:506)
       at org.jboss.embedded.DeploymentGroup.process(DeploymentGroup.java:127)
       at org.jboss.embedded.Bootstrap.deploy(Bootstrap.java:327)
       at org.jboss.embedded.tutorial.junit.EjbResourceLocater.deploy(EjbResourceLocater.java:82)
       at org.jboss.embedded.tutorial.junit.EjbTest.testEJBs(EjbTest.java:53)
       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:597)
       at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)
       at org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98)
       at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79)
       at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87)
       at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)
       at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
       at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88)
       at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
       at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
       at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
       at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
       at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
       at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
       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)
      


      I use Java 1.6.x and the JVM properties: -Dsun.lang.ClassLoader.allowArraySyntax=true
      -Djava.endorsed.dirs=C:\java\jdk1.6.0\jre\lib\endorsed
      are already set.

      Can anyone tell me where I did wrong? Or there are some conflicts between the embedded jboss and the testng?

        • 1. Re: Error bootstrap embedded JBoss through testNG
          skajotde

          This test doesn't work because hibernate dont operate on VFS. Remove virtual jar, and scanclasspath like this Bootstrap.getInstance().scanClasspath("projectdir/target/classes".replace(File.separator)).

          • 2. Re: Error bootstrap embedded JBoss through testNG
            polygoncell

             

            "skajotde" wrote:
            This test doesn't work because hibernate dont operate on VFS. Remove virtual jar, and scanclasspath like this Bootstrap.getInstance().scanClasspath("projectdir/target/classes".replace(File.separator)).


            thanks for the answer.

            Actually this way is not a good solution. The reason is: in a project with multi modules, if we call scanclasspath(), not only the classpath of the current module but also the classpath of all depended modules will be scaned. That means we should better make sure that there is only one META-INF/persistence.xml in all classpaths. Or, if there are many persistence.xml files, then no persistence.xml should contain persistence unit, which use transaction-type="RESOURCE_LOCAL". Otherwise, the jboss will throw exception. That is painful.

            • 3. Re: Error bootstrap embedded JBoss through testNG
              skajotde

               

              "polygoncell" wrote:

              Actually this way is not a good solution. The reason is: in a project with multi modules, if we call scanclasspath(), not only the classpath of the current module but also the classpath of all depended modules will be scaned. That means we should better make sure that there is only one META-INF/persistence.xml in all classpaths. Or, if there are many persistence.xml files, then no persistence.xml should contain persistence unit, which use transaction-type="RESOURCE_LOCAL". Otherwise, the jboss will throw exception. That is painful.


              Yes it's not good but you give wrong example. Bootstrap#Scanpath requires explicity entries from classpath. And yes jboss is not flexible in this area. I'll test openejb (which looks very much flexible and simple) and spring which is also VERY flexible. Mayby I dont know Jboss Embedded and I cant get gain power from jboss microcontainer (mayby I could give my own classpath configurator scanner which can scan among provided filter and other files than persistence.xml, eg persistence-test.xml and these parametrers would be provided at tests startup !)

              My test fails because we using 4 persistence units and jboss embedded can create only one (scanClassPath create only one). My hope is that spring/openejb will be eanough flexible in this area.

              • 4. Re: Error bootstrap embedded JBoss through testNG
                polygoncell

                 

                "skajotde" wrote:
                "polygoncell" wrote:

                Actually this way is not a good solution. The reason is: in a project with multi modules, if we call scanclasspath(), not only the classpath of the current module but also the classpath of all depended modules will be scaned. That means we should better make sure that there is only one META-INF/persistence.xml in all classpaths. Or, if there are many persistence.xml files, then no persistence.xml should contain persistence unit, which use transaction-type="RESOURCE_LOCAL". Otherwise, the jboss will throw exception. That is painful.


                Yes it's not good but you give wrong example. Bootstrap#Scanpath requires explicity entries from classpath. And yes jboss is not flexible in this area. I'll test openejb (which looks very much flexible and simple) and spring which is also VERY flexible. Mayby I dont know Jboss Embedded and I cant get gain power from jboss microcontainer (mayby I could give my own classpath configurator scanner which can scan among provided filter and other files than persistence.xml, eg persistence-test.xml and these parametrers would be provided at tests startup !)

                My test fails because we using 4 persistence units and jboss embedded can create only one (scanClassPath create only one). My hope is that spring/openejb will be eanough flexible in this area.


                thanks for the info. Maybe I should also try using the openEJB.

                I just wonder why the embedded jboss release package does not provide some unit test calling the scanclasspath() method?

                • 5. Re: Error bootstrap embedded JBoss through testNG
                  skajotde

                  I get examples from excellent Bauer book Java Persistence with Hibernate with this errata: http://forum.hibernate.org/viewtopic.php?p=2381705. There is used Ejb3 Embedded but is similair to Jboss Embedded which base on this first.

                  DI is base for really flexibility, I often suprise what can be achieved by replaced beans in spring context by other configuration (I prefer Java as configuration DI like in Guice or Spring-Config - http://springframework.org/javaconfig which is in milestone) I've strong hope Jboss Microcontainer has similiar abilities ;) What I watched during my intro review to jboss code it to using many static invocation and singletons. Imho Replacing with DI gains more flexibility.

                  I'm really fan of Jboss and I've used it for 3 years in production and I like to still using it ;) But I maintain code to be enough independent to server to replace when it achieves critical point ;). For 3 years I haven't run unit test for eclipse with full succesfull and it's true requirements for agile development. I've started 3 years ago jee development with jboss and it was hard, one small changes required 30 minutes deployment cycle, it's horrible. Of course now i have more experience ;) and jboss go forward. Running entity menager from eclipse is cool. Important is using compenets indepentently (similair opinion http://www.devwebsphere.com/devwebsphere/2005/07/end_of_the_road.html).

                  Scanning classpath fails in my simple case, I have 4 Persistence units with many modules and persistence.xml with element and it fails in eclipse ;/ I've reasons to assume that spring will be enough flexibility with this case and myaby I will have to write some glue code (only glue, not base code). Whet I test it I will write on this threas on effects ;)

                  • 6. Re: Error bootstrap embedded JBoss through testNG
                    skajotde

                    errata;

                    "skajotde" wrote:

                    4 Persistence units with many modules and persistence.xml with jar element


                    • 7. Re: Error bootstrap embedded JBoss through testNG
                      skajotde