これを行う:
1) jboss-classloading.xml を /src/main/webapp に追加します (私は Maven を使用しています):
コンテンツ:
<?xml version="1.0" encoding="UTF-8"?>
<classloading xmlns="urn:jboss:classloading:1.0"
domain="$UNIQUE_DOMAIN_NAME"
export-all="NON_EMPTY"
import-all="false"
parent-first="false">
</classloading>
2) $JBOSS_INSTALL_DIRECTORY/jboss-as/server/$PROFILE/conf/bootstrap/deployers.xml を変更し、最後に以下を追加します。
<bean name="IgnoreFilesDeployer"
class="org.jboss.deployers.vfs.spi.deployer.AbstractIgnoreFilesDeployer"
</bean>
3) 次の内容で、META-INF フォルダーにファイル JBOSS-IGNORE.TXT を作成します。
WEB-INF/classes/META-INF/persistence.xml
4) persistence.xml の名前を spring-persistence.xml に変更し、このファイルを context.xml に次のように追加しました。
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="persistenceXmlLocation" value="classpath:/META-INF/spring-persistence.xml"/>
....
</bean>
5) spring-persistence.xml (webapp\META-INF フォルダーに保存された persistence_2_0.xsd) も次のように変更しました。
<persistence version="2.0"
xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="file:///persistence_2_0.xsd
http://java.sun.com/xml/ns/persistence">
....
</persistence>