well, the thread is a bit old, but if anybody is still struggling with jpa2 an wls 10.3, here is a simple solution: The problem can be fixed if you rename persistence.xml to some other name, say foo.xml and thus bypassing weblogic autodiscovery. I dit it with spring 3.0.4 (spring <3 don't work)
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"> <property name="dataSource" ref="dataSource"/> <property name="persistenceUnitName" value="foo"/> <property name="persistenceXmlLocation" value="classpath:META-INF/foo.xml"/> </bean>
and in weblogic-application.xml:
<prefer-application-packages> <package-name>antlr.*</package-name> <package-name>org.apache.commons.*</package-name> <package-name>org.apache.xmlbeans.*</package-name> <package-name>org.springframework.*</package-name> <package-name>org.hibernate.*</package-name> <package-name>javax.persistence.*</package-name> </prefer-application-packages
|