Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DEBUG [org.jboss.as.jpa.messages] (MSC service thread 1-1) persistence unit search for unitName=null referenced from class=the.spring.Bean (annotation=@javax.persistence.PersistenceContext() on void the.spring.Bean.setEntityManager(javax.persistence.EntityManager))
- <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
- <deployment>
- <exclusions>
- <module name="deployment.jee-app.war.spring-app.jar" />
- <!-- I have also tried the following -->
- <!-- <module name="jee-app.war.spring-app.jar" /> -->
- <!-- <module name="spring-app.jar" /> -->
- </exclusions>
- </deployment>
- </jboss-deployment-structure>
- <scanning xmlns="urn:jboss:scanning:1.0">
- <path name="jee-app.war/WEB-INF/lib">
- <exclude name="spring-app.jar" />
- </path>
- </scanning>
- jee-app.war
- ├── WEB-INF
- │ ├── classes
- | │ ├── META-INF
- | │ | └── persistence.xml _____________ # 2 PUs here
- | | └── < lots of packages >
- | ├── lib
- | | ├── spring-app.jar ___________________ # to EXCLUDE from scanning !!!
- | | | ├── META-INF
- | | | | └── persistence
- | | | | └── persistence.xml ______ # 1 PU here, loaded by Spring
- | | | ├── application.xml ______________ # Spring definition
- | | | └── the
- | | | └── spring
- | | | └── Bean.class
- | | └── < lots of other jars >
- | ├── jboss-deployment-structure.xml
- | ├── jboss-scanning.xml
- | └── web.xml
- └── < some JSPs >
- <?xml version="1.0" encoding="UTF-8"?>
- <persistence version="2.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_2_0.xsd">
- <persistence-unit name="PU1" transaction-type="JTA">
- <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
- <jta-data-source>java:jboss/datasources/DS1</jta-data-source>
- <class>...</class> <!-- a lot of classes included by name !-->
- <exclude-unlisted-classes>true</exclude-unlisted-classes>
- <properties>
- <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect" />
- <property name="hibernate.hbm2ddl.auto" value="update" />
- <property name="hibernate.cache.provider_class" value="net.sf.ehcache.hibernate.EhCacheProvider" />
- <property name="hibernate.show_sql" value="true" />
- <property name="hibernate.format_sql" value="false" />
- </properties>
- </persistence-unit>
- <persistence-unit name="PU2" transaction-type="JTA">
- <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
- <jta-data-source>java:jboss/datasources/DS2</jta-data-source>
- <class>...</class> <!-- a lot of classes included by name !-->
- <exclude-unlisted-classes>true</exclude-unlisted-classes>
- <properties>
- <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect" />
- <property name="hibernate.hbm2ddl.auto" value="update" />
- <property name="hibernate.cache.provider_class" value="net.sf.ehcache.hibernate.EhCacheProvider" />
- <property name="hibernate.show_sql" value="true" />
- <property name="hibernate.format_sql" value="false" />
- </properties>
- </persistence-unit>
- </persistence>
- <?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="xa-rm">
- <provider>org.hibernate.ejb.HibernatePersistence</provider>
- <mapping-file>META-INF/persistence/orm.xml</mapping-file>
- <exclude-unlisted-classes>false</exclude-unlisted-classes>
- </persistence-unit>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement