[
https://jira.jboss.org/jira/browse/JBSEAM-2690?page=com.atlassian.jira.pl...
]
Eric Jung commented on JBSEAM-2690:
-----------------------------------
Posting the solution directly as requested by Peter.
Here is the solution to get rid of java.lang.ClassCastException:
org.jboss.seam.persistence.EntityManagerFactory incompatible with
javax.persistence.EntityManagerFactory
1. Ensure
<ear-project>/META-INF/ibmconfig/cells/defaultCell/applications/defaultApp/deployments/defaultApp/deployment.xml
has *three* modules entries (your war, your jar with ejbs, and jboss-seam.jar). By
default, you'll only have two. The file should look like this, with the filenames for
the jar and ear appropriate for your project.
<?xml version="1.0" encoding="UTF-8"?>
<appdeployment:Deployment xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:appdeployment="http://www.ibm.com/websphere/appserver/schemas/...
xmi:id="Deployment_1219936444526">
<deployedObject xmi:type="appdeployment:ApplicationDeployment"
xmi:id="ApplicationDeployment_1219936444526" startingWeight="10"
warClassLoaderPolicy="SINGLE">
<modules xmi:type="appdeployment:WebModuleDeployment"
xmi:id="WebModuleDeployment_1219936444526" startingWeight="10000"
uri="my-war.war"/>
<modules xmi:type="appdeployment:EJBModuleDeployment"
xmi:id="EJBModuleDeployment_1219936444526" startingWeight="5000"
uri="jboss-seam.jar"/>
<modules xmi:type="appdeployment:EJBModuleDeployment"
xmi:id="EJBModuleDeployment_1219937434401" startingWeight="5000"
uri="my-jar.jar" />
<classloader xmi:id="Classloader_1219936444526"
mode="PARENT_FIRST"/>
</deployedObject>
</appdeployment:Deployment>
A few things to note about this file:
a. warClassLoaderPolicy="SINGLE" - I am not sure this is necessary
b. The numbers after WebModuleDeployment_, EJBModuleDeployment_, and Classloader_ come
from the complete deployment.xml file. That file can be found at
<WAS-install-dir>\sdp70\runtimes\base_v61\profiles\<app-server>\config\cells\cell-name\applications\<ear-name.ear>\deployments\<ear-project-name>\deployment.xml.
This is the same file where you can ensure PARENT_LAST is set both of the WAR and the EAR
since the admin console doesn't always work when setting these.
2. Create default ibm-application-ext.xmi and ibm-application-ext-pme.xmi files in the
<ear>/META-INF folder (siblings to application.xml). If you're using RAD, this
can be done by:
a. Open application.xml in RAD so you get the wizard.
b. On the Overview tab of the wizard, check "Shared session context". Click the
save button on the toolbar. You should now have a ibm-application-ext.xmi file. Uncheck
"Shared session context" and click save again. You'll now have a default
ibm-application-ext.xmi.
c. On the Extended Services tab, check "Last participant support". Click the
save button on the toolbar. You should now have a ibm-application-ext-pme.xmi file.
Uncheck "Last participant support" and click save again. You'll now have a
default ibm-application-ext-pme.xmi.
Rebuild and and restart twice. No more java.lang.ClassCastException:
org.jboss.seam.persistence.EntityManagerFactory incompatible with
javax.persistence.EntityManagerFactory error.
Eric
Websphere on Windows JPA reference guide example throws a
ClassCastException
----------------------------------------------------------------------------
Key: JBSEAM-2690
URL:
https://jira.jboss.org/jira/browse/JBSEAM-2690
Project: Seam
Issue Type: Bug
Components: Documentation Issues, Platform interoperability
Affects Versions: 2.0.1.GA, 2.1.0.A1
Environment: Webspher 6.1 on Windows
Reporter: Jay Balunas
Assignee: Jay Balunas
Priority: Minor
Fix For: The future
Several users have reported that on windows following the reference guide JPA example
results in a ClassCastException.
The issue you are seeing "java.lang.ClassCastException:
org.jboss.seam.persistence.EntityManagerFactory incompatible with
javax.persistence.EntityManagerFactory:"
Following the forum link a user suggests a solution to the issue on windows.
Need to verify websphere windows error, and test user fix. Then update document as
needed.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira