tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Quintin Beukes <quin...@skywalk.co.za>
Subject Re: A Bug in OpenEJB?
Date Fri, 11 Sep 2009 07:22:48 GMT
OK. Let me check again.

1. I just ran a junit for a TestBean. It was successful.
2. I'm changing and doing a clean+build:
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
to
<property name="hibernate.hbm2ddl.auto"/>
3. Rerun the test. Fails with the mentioned error. Below is my
persistence.xml and full output:
------------------------
CONFIG:
------------------------
<?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>testPool</jta-data-source>
    <exclude-unlisted-classes>false</exclude-unlisted-classes>
    <properties>
      <property name="hibernate.dialect"
value="org.hibernate.dialect.PostgreSQLDialect"/>
      <property name="hibernate.show_sql" value="true"/>
      <!--
      <property name="hibernate.cache.provider_class"
value="org.hibernate.cache.NoCacheProvider"/>
      -->
      <property name="hibernate.hbm2ddl.auto"/>
      <property name="hibernate.transaction.manager_lookup_class"
value="org.apache.openejb.hibernate.TransactionManagerLookup"/>
    </properties>
  </persistence-unit>
</persistence>

------------------------
OUTPUT:
------------------------
log4j:WARN No appenders could be found for logger
(org.springframework.beans.factory.xml.XmlBeanDefinitionReader).
log4j:WARN Please initialize the log4j system properly.
Fri Sep 11 09:18:33 SAST 2009 -
net.kunye.platform.appclient.context.AppContext - trace - Retrieving
bean 'propertyConfigurer' of type
'org.springframework.beans.factory.config.PropertyPlaceholderConfigurer'.
Fri Sep 11 09:18:33 SAST 2009 -
net.kunye.platform.appclient.context.AppContext - debug - Retrieved
bean 'propertyConfigurer' of type
'org.springframework.beans.factory.config.PropertyPlaceholderConfigurer'
[org.springframework.beans.factory.config.PropertyPlaceholderConfigurer].
Fri Sep 11 09:18:33 SAST 2009 -
net.kunye.platform.appclient.context.AppContext - debug - Created new
Application Context.
Fri Sep 11 09:18:33 SAST 2009 -
net.kunye.platform.appclient.context.AppContext - debug - Loaded XML
Spring configuration for class
'net.kunye.platform.testing.LocalTestFramework':
/META-INF/local-test-framework.xml.
Fri Sep 11 09:18:33 SAST 2009 -
net.kunye.platform.appclient.context.AppContext - trace - Retrieving
bean 'testDefaultConfiguration' of type 'java.util.Properties'.
Fri Sep 11 09:18:33 SAST 2009 -
net.kunye.platform.appclient.context.AppContext - debug - Retrieved
bean 'testDefaultConfiguration' of type 'java.util.Properties'
[java.util.Properties].
Fri Sep 11 09:18:33 SAST 2009 -
net.kunye.platform.appclient.context.AppContext - debug - Loaded XML
Spring configuration for class 'net.kunye.test.TestBeanTest':
/META-INF/tests.xml.
Fri Sep 11 09:18:33 SAST 2009 -
net.kunye.platform.appclient.context.AppContext - trace - Retrieving
bean 'testConfiguration' of type 'java.util.Properties'.
Fri Sep 11 09:18:33 SAST 2009 -
net.kunye.platform.appclient.context.AppContext - debug - Retrieved
bean 'testConfiguration' of type 'java.util.Properties'
[java.util.Properties].
Initial Context Properties - Start
-- listing properties --
java.naming.factory.initial=org.apache.openejb.client.LocalInitia...
testPool.UserName=kms
testPool=new://Resource?type=DataSource
net.kunye.platform.tests.appclient.auth.admin.pass=kmsTESTpassword
net.kunye.platform.tests.appclient.auth.admin.username=testuser-admin
testPool.Password=kms
testPool.JdbcUrl=jdbc:postgresql://localhost:5432/test...
net.kunye.platform.tests.appclient.auth.lamp-room.username=testuser-lamproom
net.kunye.platform.tests.appclient.auth.lamp-room.pass=kmsTESTpassword
testPool.JdbcDriver=org.postgresql.Driver
Initial Context Properties - End
Apache OpenEJB 3.1.2-SNAPSHOT    build: 20090827-09:05
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=testPool, type=Resource,
provider-id=Default JDBC Database)
INFO - Found ClientModule in classpath:
/opt/netbeans-6.7.1/java2/ant/lib/ant-launcher.jar
INFO - Found ClientModule in classpath:
/opt/netbeans-6.7.1/java2/ant/lib/ant.jar
INFO - Found ClientModule in classpath:
/home/quintin/dev/kms/KMSPlatform/ApplicationClientLib/dist/ApplicationClientLib.jar
INFO - Found ClientModule in classpath:
/home/quintin/dev/kms/libs/junit-openejb/xml-resolver-1.2.jar
INFO - Found EjbModule in classpath:
/home/quintin/dev/kms/KMSPlatform/KMSPlatform-ejb/build/jar
INFO - Found ClientModule in classpath:
/home/quintin/dev/kms/libs/hibernate/javassist-3.9.0.GA.jar
INFO - Found EjbModule in classpath:
/home/quintin/dev/kms/KMSPlatform/UnitTesting/dist/UnitTesting.jar
INFO - Beginning load: /opt/netbeans-6.7.1/java2/ant/lib/ant-launcher.jar
INFO - Beginning load: /opt/netbeans-6.7.1/java2/ant/lib/ant.jar
INFO - Beginning load:
/home/quintin/dev/kms/KMSPlatform/ApplicationClientLib/dist/ApplicationClientLib.jar
INFO - Beginning load:
/home/quintin/dev/kms/libs/junit-openejb/xml-resolver-1.2.jar
INFO - Beginning load:
/home/quintin/dev/kms/KMSPlatform/KMSPlatform-ejb/build/jar
INFO - Beginning load:
/home/quintin/dev/kms/libs/hibernate/javassist-3.9.0.GA.jar
INFO - Beginning load:
/home/quintin/dev/kms/KMSPlatform/UnitTesting/dist/UnitTesting.jar
INFO - Configuring enterprise application: classpath.ear
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 'testPoolNonJta' of type
'DataSource for 'KMSPlatform-PU'.
INFO - Configuring Service(id=testPoolNonJta, type=Resource,
provider-id=testPool)
INFO - Adjusting PersistenceUnit KMSPlatform-PU <non-jta-data-source>
to Resource ID 'testPoolNonJta' from 'null'
ERROR - FATAL ERROR: Unknown error in Assembler.  Please send the
following stack trace and this message to users@openejb.apache.org :
 java.lang.NullPointerException
        at java.util.Hashtable.put(Hashtable.java:394)
        at org.apache.openejb.config.AppInfoBuilder.buildPersistenceModules(AppInfoBuilder.java:502)
        at org.apache.openejb.config.AppInfoBuilder.build(AppInfoBuilder.java:111)
        at org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:604)
        at org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:551)
        at org.apache.openejb.config.ConfigurationFactory.getOpenEjbConfiguration(ConfigurationFactory.java:380)
        at org.apache.openejb.assembler.classic.Assembler.getOpenEjbConfiguration(Assembler.java:299)
        at org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:278)
        at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:137)
        at org.apache.openejb.OpenEJB.init(OpenEJB.java:286)
        at org.apache.openejb.OpenEJB.init(OpenEJB.java:265)
        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:71)
        at org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:53)
        at org.apache.openejb.client.LocalInitialContextFactory.getInitialContext(LocalInitialContextFactory.java:42)
        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.testing.LocalTestFramework.<init>(LocalTestFramework.java:72)
        at net.kunye.test.TestBeanTest.setUpClass(TestBeanTest.java:49)
        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:292)
        at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:137)
        at org.apache.openejb.OpenEJB.init(OpenEJB.java:286)
        at org.apache.openejb.OpenEJB.init(OpenEJB.java:265)
        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:71)
        at org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:53)
        at org.apache.openejb.client.LocalInitialContextFactory.getInitialContext(LocalInitialContextFactory.java:42)
        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.testing.LocalTestFramework.<init>(LocalTestFramework.java:72)
        at net.kunye.test.TestBeanTest.setUpClass(TestBeanTest.java:49)
        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:502)
        at org.apache.openejb.config.AppInfoBuilder.build(AppInfoBuilder.java:111)
        at org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:604)
        at org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:551)
        at org.apache.openejb.config.ConfigurationFactory.getOpenEjbConfiguration(ConfigurationFactory.java:380)
        at org.apache.openejb.assembler.classic.Assembler.getOpenEjbConfiguration(Assembler.java:299)
        at org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:278)
        ... 31 more


On Thu, Sep 10, 2009 at 11:35 PM, David Blevins <david.blevins@visi.com> wrote:
> This is strange as the parsing is done by JAXB and the related class looks
> setup correctly:
>
> @XmlAccessorType(XmlAccessType.FIELD)
> @XmlType(name = "")
> public class Property {
>
>    @XmlAttribute(required = true)
>    protected String name;
>    @XmlAttribute(required = true)
>    protected String value;
>
> It should complain that you don't have the required attribute.
>
> -David
>
> On Sep 8, 2009, at 6:42 AM, Quintin Beukes wrote:
>
>> Hey,
>>
>> I can reproduce it everytime. All I have to do is leave out the value
>> attribute.
>>
>> Q
>>
>> On Tue, Sep 8, 2009 at 2:06 PM, Jean-Louis MONTEIRO
>> <jean-louis.monteiro@atosorigin.com> wrote:
>>>
>>> Hi Quintin,
>>>
>>> The specification only supports the second form.
>>> Here is an extract from the specification:
>>>                    <xsd:complexType>
>>>                       <xsd:attribute name="name" type="xsd:string"
>>>                                      use="required"/>
>>>                       <xsd:attribute name="value" type="xsd:string"
>>>                                      use="required"/>
>>>                     </xsd:complexType>
>>>
>>>
>>> Q Beukes wrote:
>>>>
>>>> I got the first one from an example. Can't recall where though, is it
>>>> incorrect? If I think about it I've always used the 2nd form.
>>>>
>>> Please, if you find it again, let us know so we can fix it.
>>>
>>> Thanks in advance.
>>> Jean-Louis
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Fwd%3A-A-Bug-in-OpenEJB--tp25313066p25344885.html
>>> Sent from the OpenEJB User mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>>
>> --
>> Quintin Beukes
>>
>
>



-- 
Quintin Beukes

Mime
View raw message