geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ralf Baumhof (JIRA)" <j...@apache.org>
Subject [jira] Created: (GERONIMO-3892) Persistence.CreateEntityManagerFactory leads to an JNDI Exception in EJB Container
Date Mon, 03 Mar 2008 14:56:50 GMT
Persistence.CreateEntityManagerFactory leads to an JNDI Exception in EJB Container
----------------------------------------------------------------------------------

                 Key: GERONIMO-3892
                 URL: https://issues.apache.org/jira/browse/GERONIMO-3892
             Project: Geronimo
          Issue Type: Bug
      Security Level: public (Regular issues)
          Components: naming, OpenEJB, persistence
    Affects Versions: 2.1, 2.0.2
         Environment: Windows XP, Linux (Ubuntu)
            Reporter: Ralf Baumhof


I have got a stateless session bean (ssb) which uses annotation @PersistenceUnit(unitName="Vesuv")
protected EntityManagerFactory emf; This works fine. I can instantiate an entity manager and
use it's persistence methods. However, the name of the persistence unit may vary in production
dependant on the user logged on the the application. So an approach EntityManagerFactory emf
= Persistence.CreateEntitiyManagerFactory("Vesuv") is much more suitable. But this statement
does not work if i execute it in a class running in the geronimo ejb container (regardless
of ssb or not). It works, if i execute it in a servlet in tomcat container.  The error message
is: "PersistenceException: There was an error during JNDI lookup of the name "Postgres.vesuv".
Postgres.vesuv is the name of the datasource which is attached in persistence.xml to the persistence
unit "Vesuv". 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message