5 Replies Latest reply on Oct 30, 2006 8:48 AM by Michiel Trimpe

    Embeddable EJB3 startup problem: xidFactory (NoSuchFieldErro

    Jens Weintraut Apprentice

      Hi there,

      I'm trying to test my Seam app with JUnit 4.1 and the Embeddable EJB3 RC8 patch2. I'm working with eclipse and my app works.
      I followed the installation instructions to get the embeddable EJB3 working. I added all the libs and the \conf directory to the classpath of the JUnit running (User entries). I also edited the embedded-jboss-beans.xml.
      In my testcase I call the boot(null) and scanClasspath() method. When I run the testcase it crashes calling the boot() method.

      This is the error printed on the console:

      WARN 21-06 08:53:16,203 (BeanSchemaBinding.java:init:227) -You should use the 2.0 version of the Microcontainer xml. xmlns='urn:jboss:bean-deployer:2.0'
      ERROR 21-06 08:53:16,484 (AbstractController.java:incrementState:350) -Error installing to Start: name=TransactionManagerInitializer state=Create
      java.lang.NoSuchFieldError: xidFactory
       at org.jboss.tm.TransactionManagerInitializer.start(TransactionManagerInitializer.java:110)
       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.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:582)
       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.deployment.AbstractKernelDeployer.deployBean(AbstractKernelDeployer.java:291)
       at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBeans(AbstractKernelDeployer.java:261)
       at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deploy(AbstractKernelDeployer.java:117)
       at org.jboss.kernel.plugins.deployment.xml.BeanXMLDeployer.deploy(BeanXMLDeployer.java:95)
       at org.jboss.ejb3.embedded.EJB3StandaloneBootstrap.boot(EJB3StandaloneBootstrap.java:380)
       at com.idsscheer.ares.test.LoginActionTest.startupEmbeddedEJB3(LoginActionTest.java:78)
       at com.idsscheer.ares.test.LoginActionTest.initClass(LoginActionTest.java:27)
       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.BeforeAndAfterRunner.invokeMethod(BeforeAndAfterRunner.java:74)
       at org.junit.internal.runners.BeforeAndAfterRunner.runBefores(BeforeAndAfterRunner.java:50)
       at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:33)
       at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
       at junit.framework.JUnit4TestAdapter.run(JUnit4TestAdapter.java:32)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
      


      And the JUnit plugin prints that:
      java.lang.RuntimeException: java.lang.IllegalArgumentException: Null name
       at org.jboss.ejb3.embedded.EJB3StandaloneBootstrap.boot(EJB3StandaloneBootstrap.java:391)
       at com.idsscheer.ares.test.LoginActionTest.startupEmbeddedEJB3(LoginActionTest.java:78)
       at com.idsscheer.ares.test.LoginActionTest.initClass(LoginActionTest.java:27)
       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.BeforeAndAfterRunner.invokeMethod(BeforeAndAfterRunner.java:74)
       at org.junit.internal.runners.BeforeAndAfterRunner.runBefores(BeforeAndAfterRunner.java:50)
       at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:33)
       at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
       at junit.framework.JUnit4TestAdapter.run(JUnit4TestAdapter.java:32)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
      Caused by: java.lang.IllegalArgumentException: Null name
       at org.jboss.dependency.plugins.AbstractController.getContext(AbstractController.java:101)
       at org.jboss.kernel.plugins.dependency.AbstractKernelController.getContext(AbstractKernelController.java:94)
       at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.internalValidate(AbstractKernelDeployer.java:229)
       at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.validate(AbstractKernelDeployer.java:161)
       at org.jboss.ejb3.embedded.EJB3StandaloneBootstrap.boot(EJB3StandaloneBootstrap.java:381)
       ... 14 more


      It looks like it's a eclipse configuration error. But I'm not sure, so I'm asking here for help. That's my embedded-jboss-beans.xml:
      <?xml version="1.0" encoding="UTF-8"?>
      
      <deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_1_0.xsd"
       xmlns="urn:jboss:bean-deployer">
       <bean name="Naming" class="org.jnp.server.SingletonNamingServer"/>
      
       <bean name="InitialContextProperties" class="java.util.Hashtable">
       <constructor>
       <parameter class="java.util.Map">
       <map keyClass="java.lang.String" valueClass="java.lang.String">
       <entry>
       <key>java.naming.factory.initial</key>
       <value>org.jnp.interfaces.LocalOnlyContextFactory</value>
       </entry>
       <entry>
       <key>java.naming.factory.url.pkgs</key>
       <value>org.jboss.naming:org.jnp.interfaces</value>
       </entry>
       </map>
       </parameter>
       </constructor>
       </bean>
      
       <bean name="java:comp/Initializer" class="org.jboss.ejb3.embedded.JavaCompInitializer">
       <property name="jndiProperties"><inject bean="InitialContextProperties"/></property>
       </bean>
      
       <bean name="XidFactory" class="org.jboss.tm.XidFactoryImpl"/>
      
       <bean name="XidFactoryMBean" class="org.jboss.ejb3.embedded.XidFactoryMBean">
       <constructor>
       <parameter class="org.jboss.tm.XidFactoryBase">
       <inject bean="XidFactory"/>
       </parameter>
       </constructor>
       </bean>
      
       <bean name="TransactionManagerInitializer" class="org.jboss.tm.TransactionManagerInitializer">
       <property name="xidFactory"><inject bean="XidFactory"/></property>
       <property name="initialContextProperties"><inject bean="InitialContextProperties"/></property>
       </bean>
      
       <bean name="UserTransaction" class="org.jboss.ejb3.embedded.UserTransactionImpl">
       <demand>TransactionManagerInitializer</demand>
       </bean>
      
       <bean name="UserTransactionBinding" class="org.jboss.ejb3.embedded.JndiBinder">
       <property name="jndiProperties"><inject bean="InitialContextProperties"/></property>
       <property name="target"><inject bean="UserTransaction"/></property>
       <property name="bindTo">UserTransaction</property>
       <property name="serializable">false</property>
       </bean>
      
      
       <bean name="TransactionManager" class="java.lang.Object">
       <constructor factoryMethod="getTransactionManager">
       <factory bean="TransactionManagerInitializer"/>
       </constructor>
       </bean>
       <bean name="CachedConnectionManager" class="org.jboss.resource.connectionmanager.CachedConnectionManagerReference">
       <property name="transactionManager"><inject bean="TransactionManager"/></property>
       </bean>
      
       <!--
       <bean class="org.jboss.jdbc.HypersonicDatabase"
       name="jboss:service=Hypersonic,database=localDB">
       <property name="database">localDB</property>
       <property name="inProcessMode">true</property>
       <property name="dbDataDir">.</property>
       </bean>
       -->
      
       <bean name="aresDSBootstrap" class="org.jboss.resource.adapter.jdbc.local.LocalTxDataSource">
       <property name="driverClass">oracle.jdbc.driver.OracleDriver</property>
       <property name="connectionURL">jdbc:oracle:thin:@pcjewe:1521:XE</property>
       <property name="userName">MrDefault</property>
       <property name="password">MrDefault</property>
      
       <!-- <property name="driverClass">org.hsqldb.jdbcDriver</property>
       <property name="connectionURL">jdbc:hsqldb:.</property>
       <property name="userName">sa</property> -->
      
       <property name="jndiName">java:/aresDS</property>
       <property name="minSize">0</property>
       <property name="maxSize">10</property>
       <property name="blockingTimeout">1000</property>
       <property name="idleTimeout">100000</property>
       <property name="transactionManager"><inject bean="TransactionManager"/></property>
       <property name="cachedConnectionManager"><inject bean="CachedConnectionManager"/></property>
       <property name="initialContextProperties"><inject bean="InitialContextProperties"/></property>
       </bean>
      
       <bean name="aresDS" class="java.lang.Object">
       <constructor factoryMethod="getDatasource">
       <factory bean="aresDSBootstrap"/>
       </constructor>
       </bean>
      
      
      </deployment>


      I'm asking why the embeddable EJB3 claims there were a problem with the xidFactory problem. Which mistake could produce this error?