tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Quintin Beukes <quin...@last.za.net>
Subject Fwd: A Bug in OpenEJB?
Date Sat, 05 Sep 2009 21:14:40 GMT
I tried a JUnit test and got the following. It first thought it might
be that I didn't set the non-jta-data-source. But this didn't help. So
what could cause this?

My initialization code:
   Properties p = new Properties();

   p.put(Context.INITIAL_CONTEXT_FACTORY,
"org.apache.openejb.client.LocalInitialContextFactory");

   p.put("jdbc_kmsPool", "new://Resource?type=DataSource");
   p.put("jdbc_kmsPool.JdbcDriver", "org.postgresql.Driver");
   p.put("jdbc_kmsPool.JdbcUrl", "jdbc:postgresql://localhost:5432/test_kms");
   p.put("jdbc_kmsPool.UserName", "kms");
   p.put("jdbc_kmsPool.Password", "kms");

   p.put("hibernate.hbm2ddl.auto", "create-drop");
   p.put("hibernate.dialect", "org.hibernate.dialect.PostgreSQLDialect");

My persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0"
xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
 <persistence-unit name="KMSPlatform-PU" transaction-type="JTA">
   <provider>org.hibernate.ejb.HibernatePersistence</provider>
   <jta-data-source>jdbc/kmsPool</jta-data-source>
   <exclude-unlisted-classes>false</exclude-unlisted-classes>
   <properties>
     <property
name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</property>
     <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
     <property name="hibernate.transaction.manager_lookup_class"
value="net.kunye.persistence.GeronimoTransactionManagerLookup"/>
   </properties>
 </persistence-unit>
</persistence>

This is the output from the JUnit test:
Sat Sep 05 23:05:26 SAST 2009 - net.kunye.configuration.Config - debug
- Loading module configuration for: tests
Sat Sep 05 23:05:26 SAST 2009 - net.kunye.configuration.Config - debug
- Application root for operating system 'Linux' is: /opt/kms
Sat Sep 05 23:05:26 SAST 2009 - net.kunye.configuration.Config - debug
- Loading application configuration for: tests
Sat Sep 05 23:05:26 SAST 2009 - net.kunye.configuration.Config - debug
- Application root for operating system 'Linux' is: /opt/kms
Apache OpenEJB 3.0    build: 20080408-04:13
http://openejb.apache.org/
INFO - openejb.home = /home/quintin/dev/kms/KMSPlatform/KMSPlatform-ejb
INFO - openejb.base = /home/quintin/dev/kms/KMSPlatform/KMSPlatform-ejb
INFO - Configuring Service(id=Default Security Service,
type=SecurityService, provider-id=Default Security Service)
INFO - Configuring Service(id=Default Transaction Manager,
type=TransactionManager, provider-id=Default Transaction Manager)
INFO - Configuring Service(id=jdbc_kmsPool, type=Resource,
provider-id=Default JDBC Database)
INFO - Configuring Service(id=Default JDK 1.3 ProxyFactory,
type=ProxyFactory, provider-id=Default JDK 1.3 ProxyFactory)
INFO - Found EjbModule in classpath:
/home/quintin/dev/kms/KMSPlatform/KMSPlatform-ejb/build/jar
INFO - Configuring app:
/home/quintin/dev/kms/KMSPlatform/KMSPlatform-ejb/build/jar
INFO - Configuring Service(id=Default Stateless Container,
type=Container, provider-id=Default Stateless Container)
INFO - Auto-creating a container for bean PersonnelBean:
Container(type=STATELESS, id=Default Stateless Container)
INFO - Configuring PersistenceUnit(name=KMSPlatform-PU,
provider=org.hibernate.ejb.HibernatePersistence)
INFO - Auto-creating a Resource with id 'jdbc_kmsPoolNonJta' of type
'DataSource for 'KMSPlatform-PU'.
INFO - Configuring Service(id=jdbc_kmsPoolNonJta, type=Resource,
provider-id=jdbc_kmsPool)
INFO - Adjusting KMSPlatform-PU <jta-data-source> to 'jdbc_kmsPool'
INFO - Adjusting KMSPlatform-PU <non-jta-data-source> to 'jdbc_kmsPoolNonJta'
ERROR - FATAL ERROR: Unknown error in Assembler.  Please send the
following stack trace and this message to user@openejb.org :
 java.lang.NullPointerException
       at java.util.Hashtable.put(Hashtable.java:394)
       at org.apache.openejb.config.AppInfoBuilder.buildPersistenceModules(AppInfoBuilder.java:426)
       at org.apache.openejb.config.AppInfoBuilder.build(AppInfoBuilder.java:95)
       at org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:443)
       at org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:391)
       at org.apache.openejb.config.ConfigurationFactory.getOpenEjbConfiguration(ConfigurationFactory.java:309)
       at org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:249)
       at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:149)
       at org.apache.openejb.OpenEJB.init(OpenEJB.java:288)
       at org.apache.openejb.OpenEJB.init(OpenEJB.java:267)
       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.apache.openejb.loader.OpenEJBInstance.init(OpenEJBInstance.java:36)
       at org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:62)
       at org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:51)
       at org.apache.openejb.client.LocalInitialContextFactory.getInitialContext(LocalInitialContextFactory.java:40)
       at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
       at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
       at javax.naming.InitialContext.init(InitialContext.java:223)
       at javax.naming.InitialContext.<init>(InitialContext.java:197)
       at net.kunye.platform.appclient.test.LocalTestFramework.<init>(LocalTestFramework.java:39)
       at net.kunye.platform.personnel.PersonnelBeanTest.setUpClass(PersonnelBeanTest.java:50)
       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.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
       at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
       at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
       at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
       at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
       at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
       at junit.framework.JUnit4TestAdapter.run(JUnit4TestAdapter.java:39)
       at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:515)
       at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:1031)
       at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:888)

FATAL - OpenEJB has encountered a fatal error and cannot be started:
Assembler failed to build the container system.
org.apache.openejb.OpenEJBException: java.lang.NullPointerException: null
       at org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:263)
       at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:149)
       at org.apache.openejb.OpenEJB.init(OpenEJB.java:288)
       at org.apache.openejb.OpenEJB.init(OpenEJB.java:267)
       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.apache.openejb.loader.OpenEJBInstance.init(OpenEJBInstance.java:36)
       at org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:62)
       at org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:51)
       at org.apache.openejb.client.LocalInitialContextFactory.getInitialContext(LocalInitialContextFactory.java:40)
       at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
       at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
       at javax.naming.InitialContext.init(InitialContext.java:223)
       at javax.naming.InitialContext.<init>(InitialContext.java:197)
       at net.kunye.platform.appclient.test.LocalTestFramework.<init>(LocalTestFramework.java:39)
       at net.kunye.platform.personnel.PersonnelBeanTest.setUpClass(PersonnelBeanTest.java:50)
       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.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
       at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
       at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
       at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
       at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
       at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
       at junit.framework.JUnit4TestAdapter.run(JUnit4TestAdapter.java:39)
       at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:515)
       at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:1031)
       at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:888)
Caused by: java.lang.NullPointerException
       at java.util.Hashtable.put(Hashtable.java:394)
       at org.apache.openejb.config.AppInfoBuilder.buildPersistenceModules(AppInfoBuilder.java:426)
       at org.apache.openejb.config.AppInfoBuilder.build(AppInfoBuilder.java:95)
       at org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:443)
       at org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:391)
       at org.apache.openejb.config.ConfigurationFactory.getOpenEjbConfiguration(ConfigurationFactory.java:309)
       at org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:249)
       ... 31 more



--
Quintin Beukes



-- 
Quintin Beukes

Mime
View raw message