[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: OpenJPA and JBoss

hungtru do-not-reply at jboss.com
Tue Jul 29 09:39:02 EDT 2008


Hi there.

The strange thing is that I don't really have exceptions.

I'm using JBoss 4.2.2, OpenJPA 1.1.0, and Java 1.5.

In two beans, I am injecting the OpenJPA context via the @PersistenceContext(unitName="EventData")

But I never see these two beans deploy completely, as it says it is waiting for the persistence unit "EventData" to start.

My persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
        <persistence-unit name="EventData" transaction-type="JTA">
			org.apache.openjpa.persistence.PersistenceProviderImpl
			<jta-data-source>java:jdbc/ds</jta-data-source>
			 I have classes here 
		
		 
		 
		</persistence-unit>



I get the following in the JBoss server log:
2008-07-29 00:32:07,373 DEBUG [org.jboss.ejb3.Ejb3Module] Starting jboss.j2ee:service=EJB3,module=app_ejb-1.0.0.jar
2008-07-29 00:32:07,394 DEBUG [org.jboss.injection.PersistenceUnitHandler] ******* could not find PU dependency so adding a default: persistence.units:unitName=EventData
2008-07-29 00:32:07,402 DEBUG [org.jboss.ejb3.EJBContainer] Initialising interceptors for DataAccessBean...
2008-07-29 00:32:07,402 DEBUG [org.jboss.ejb3.EJBContainer] Default interceptors: null
2008-07-29 00:32:07,402 DEBUG [org.jboss.ejb3.EJBContainer] Class interceptors: []
2008-07-29 00:32:07,403 DEBUG [org.jboss.ejb3.EJBContainer] All applicable interceptor classes: []

...
2008-07-29 00:32:07,442 INFO  [org.jboss.ejb3.JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=App.ear,jar=app_ejb-1.0.0.jar,name=DataAccessBean,service=EJB3 with dependencies:
2008-07-29 00:32:07,442 INFO  [org.jboss.ejb3.JmxKernelAbstraction]     persistence.units:unitName=EventData
2008-07-29 00:32:07,443 DEBUG [org.jboss.system.ServiceController] Creating service jboss.j2ee:ear=App.ear,jar=app_ejb-1.0.0.jar,name=DataAccessBean,service=EJB3
2008-07-29 00:32:07,443 DEBUG [org.jboss.system.ServiceController] adding depenApp in ServiceController.register: [persistence.units:unitName=EventData]
...
2008-07-29 00:32:07,443 DEBUG [org.jboss.system.ServiceController] waiting in create of jboss.j2ee:ear=App.ear,jar=app_ejb-1.0.0.jar,name=DataAccessBean,service=EJB3 waiting on persistence.units:unitName=EventData
2008-07-29 00:32:07,443 DEBUG [org.jboss.system.ServiceController] starting service jboss.j2ee:ear=App.ear,jar=app_ejb-1.0.0.jar,name=DataAccessBean,service=EJB3



It never hits the 
2008-07-29 00:32:07,450 INFO  [org.jboss.ejb3.EJBContainer] STARTED EJB: 

Like all my other session beans do.  


Does that mean that the bean is still waiting for the persistence unit?  These are the only two that don't get deployed completely and available in JNDI and the only ones that use the persistence stuff.

Sometimes...and not always, i will get trace logs from OpenJPA:
70  EventData  INFO   [pool-13-thread-1] openjpa.Runtime - Starting OpenJPA 1.1.0
71  EventData  TRACE  [pool-13-thread-1] openjpa.Runtime - Properties: openjpa.EntityManagerFactory: default
99  EventData  TRACE  [pool-13-thread-1] openjpa.Runtime - No cache marshaller found for id org.apache.openjpa.conf.MetaDataCacheMaintenance.
195  EventData  TRACE  [pool-13-thread-1] openjpa.MetaData - Using metadata factory "org.apache.openjpa.persistence.jdbc.PersistenceMappingFactory at 3a3b6b".
206  EventData  TRACE  [pool-13-thread-1] openjpa.jdbc.JDBC - OpenJPA will now connect to the database to attempt to determine what type of database dictionary to use. You may prevent this connection in the future by setting your openjpa.jdbc.DBDictionary configuration property to the appropriate value for your database (see the documentation for available values).

Not that I don't always get the openjpa.log, I don't know why though...it is rather inconsistent.

Thanks for any help.
H


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4167331#4167331

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4167331



More information about the jboss-user mailing list