PersitenceUnit no more found after updating to SEAM 2.2
fermat Oct 23, 2009 9:47 PMHello,
I have updated a project from SEAM 2.0.1 to 2.2. I also updated my JBoss Server from 4.2.2 to 5.1.0. After porting all my code to SEAM 2.2 I am not able to see some of my beans running. But I have one problem I do not know why it is going wrong:
I generated a new seam project called mda2009. After starting, when I try to login using the web GUI I get an exception:
21:26:19,286 WARN [SeamLoginModule] Error invoking login method javax.el.ELException: javax.ejb.EJBTransactionRolledbackException: EntityManagerFactory not found in JNDI : java:comp/env/mda2009/pu at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:339) [....] Caused by: javax.naming.NameNotFoundException: mda2009 not bound at org.jnp.server.NamingServer.getBinding(NamingServer.java:771) [....]
The whole output would be too much to copy it here, but it is here availabe.
In the web.XML this defined as was done by seam-gen:
<persistence-unit-ref> <persistence-unit-ref-name>mda2009/pu</persistence-unit-ref-name> <persistence-unit-name>../mda2009.jar#mda2009</persistence-unit-name> <!-- The relative reference doesn't work on GlassFish. Instead, set the <persistence-unit-name> to "mda2009", package persistence.xml in the WAR, and add a <jar-file> element in persistence.xml with value "../../mda2009.jar". <persistence-unit-name>mda2009</persistence-unit-name> --> </persistence-unit-ref>
My persistence is defined as follows:
<?xml version="1.0" encoding="UTF-8"?> <!-- Persistence deployment descriptor for dev profile --> <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 name="mda2009"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <jta-data-source>mda2009Datasource</jta-data-source> <!-- The <jar-file> element is necessary if you put the persistence.xml in the WAR and the classes in the JAR --> <!-- <jar-file>../../vehicles.jar</jar-file> --> <properties> <property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/> <property name="hibernate.hbm2ddl.auto" value="validate"/> <property name="hibernate.show_sql" value="false"/> <property name="hibernate.format_sql" value="true"/> <property name="hibernate.use_sql_comments" value="false"/> <property name="jboss.entity.manager.factory.jndi.name" value="java:/mda2009EntityManagerFactory"/> </properties> </persistence-unit> </persistence>
My components.xml has an entry, I am not sure what it means:
<persistence:managed-persistence-context name="entityManager" auto-create="true" persistence-unit-jndi-name="@puJndiName@"/>
I do not know, how to get rid of the error, so I can use my EntityManager (and log). Can please anybody help me?
bests
Sascha Effert