PersistenceUnit Jboss7
quynhbt Aug 4, 2011 11:18 AMHello,
My application run fine in Jboss4.2 with Seam2.2. I'am trying to upgrade to Jboss7 as following this document: https://docs.jboss.org/author/display/AS7/How+do+I+migrate+my+application+from+AS5+or+AS6+to+AS7#HowdoImigratemyapplicationfromAS5orAS6toAS7-JBossLogging.
Structure of my application:
atlasnet.ear
+ META-INF
+ application.xml
+ jboss-deployement-structure.xml
+ lib
+ hibernate-annotations.jar
+ hibernate-core.jar
+ hibernate-common-annotations.jar
+ hibernate-entitymanagement.jar
+ hibernate-validator.jar
......
+ atlasnet.jar
+ atlasnet.war
I have this error :
15:31:56,617 INFO [org.hibernate.ejb.Ejb3Configuration] (MSC service thread 1-7) HHH00204:Processing PersistenceUnitInfo [ name: atlasnet_pu ...] 15:31:56,618 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC00001: Failed to start service jboss.persistenceunit."atlasnet.ear/atlasnet.jar#atlasnet_pu": org.jboss.msc.service.StartException in service jboss.persistenceunit."atlasnet.ear/atlasnet.jar#atlasnet_pu": Failed to start service at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1786) at org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_25] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_25] at java.lang.Thread.run(Thread.java:662) [:1.6.0_25] Caused by: java.lang.RuntimeException: error trying to scan <jar-file>: vfs:/content/lib/atlasnet-domain.jar at org.hibernate.ejb.Ejb3Configuration.scanForClasses(Ejb3Configuration.java:844) at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:580) at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:72) at org.jboss.as.jpa.service.PersistenceUnitService.createContainerEntityManagerFactory(PersistenceUnitService.java:168) at org.jboss.as.jpa.service.PersistenceUnitService.start(PersistenceUnitService.java:80) at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765) ... 4 more Caused by: java.lang.RuntimeException: Missing annotation index to scan entity classes at org.jboss.as.jpa.hibernate4.HibernateAnnotationScanner.getClassesInJar(HibernateAnnotationScanner.java:123) at org.hibernate.ejb.Ejb3Configuration.addScannedEntries(Ejb3Configuration.java:474) at org.hibernate.ejb.Ejb3Configuration.scanForClasses(Ejb3Configuration.java:841) ... 9 more 15:31:56,958 INFO [org.jboss.seam.init.Initialization] (MSC service thread 1-10) reading /WEB-INF/components.xml
My file persistence.xml looks like this:
<?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"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0">
<!-- Persistence Unit -->
<persistence-unit name="atlasnet_pu" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>atlasnetDatasource</jta-data-source>
<jar-file>/lib/atlasnet-domain.jar</jar-file>
<properties>
<!-- Debugging -->
<property name="hibernate.show_sql" value="false"/>
<property name="hibernate.format_sql" value="true"/>
<property name="hibernate.use_sql_comments" value="true"/>
<property name="hibernate.generate_statistics" value="true"/>
<!-- Transaction -->
<!--property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/-->
<property name="jboss.entity.manager.factory.jndi.name" value="java:/atlasnetEntityManagerFactory"/>
.....
any ideas would be appreciated
Help me please
TBQ
-
persistence.xml 2.5 KB