IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

JPA Java Discussion :

Erreur "org.apache.openjpa.persistence.InvalidStateException: Could not perform automatic lookup of EJB"


Sujet :

JPA Java

  1. #1
    Expert confirmé
    Avatar de sekaijin
    Homme Profil pro
    Urbaniste
    Inscrit en
    Juillet 2004
    Messages
    4 205
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 61
    Localisation : France, Yvelines (Île de France)

    Informations professionnelles :
    Activité : Urbaniste
    Secteur : Santé

    Informations forums :
    Inscription : Juillet 2004
    Messages : 4 205
    Par défaut Erreur "org.apache.openjpa.persistence.InvalidStateException: Could not perform automatic lookup of EJB"
    Bonjour.
    j'utilise OSGI JPA ARIES BLUEPRINT

    j'ai une erreur et je ne sais dans quelle direction chercher.
    <openjpa-2.1.1-r422266:1148538 fatal user error> org.apache.openjpa.persistence.InvalidStateException: Could not perform automatic lookup of EJB container's javax.transaction.TransactionManager implementation. Please ensure that you are running the application from within an EJB 1.1 compliant EJB container, and then set the org.apache.openjpa.ManagedRuntime property to the appropriate value to obtain the TransactionManager.
    at org.apache.openjpa.ee.AutomaticManagedRuntime.getTransactionManager(AutomaticManagedRuntime.java:253)
    at org.apache.openjpa.kernel.AbstractBrokerFactory.syncWithManagedTransaction(AbstractBrokerFactory.java:717)
    at org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:389)
    at org.apache.openjpa.kernel.BrokerImpl.initialize(BrokerImpl.java:323)
    at org.apache.openjpa.kernel.AbstractBrokerFactory.initializeBroker(AbstractBrokerFactory.java:229)
    at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:213)
    at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
    at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
    at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:154)
    at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
    at org.apache.aries.jpa.container.impl.CountingEntityManagerFactory.createEntityManager(CountingEntityManagerFactory.java:64)
    ...
    Caused by: javax.naming.NotContextException: java:comp/TransactionSynchronizationRegistry
    at org.apache.xbean.naming.context.AbstractContext.lookup(AbstractContext.java:165)
    at org.apache.xbean.naming.context.AbstractContext.lookup(AbstractContext.java:605)
    at org.apache.servicemix.naming.InitialContextWrapper.lookup(InitialContextWrapper.java:173)
    at javax.naming.InitialContext.lookup(InitialContext.java:392)[:1.6.0_32]
    at org.apache.openjpa.ee.RegistryManagedRuntime.getTransactionManager(RegistryManagedRuntime.java:61)
    at org.apache.openjpa.ee.AutomaticManagedRuntime.getTransactionManager(AutomaticManagedRuntime.java:171)
    je suppose qu'il me manque quelque chose quelque part mais je ne vois pas quoi. je n'ai pas de dépendance non résolue mes entitées sont dans le class path le percitence.xml est bien initialisé les entityManagerFactory et transactionManager sont bien créés.

    la connexion à la base fonctionne et la table a bien la structure attendue
    jpa m'affiche au démarage:
    1750 person2 INFO [Camel (jpa2jms) thread #5 - jpa://net.lr.tutorial.karaf.camel.jpa2jms.model.Person] openjpa.Runtime - Starting OpenJPA 2.1.1
    1828 person2 INFO [Camel (jpa2jms) thread #5 - jpa://net.lr.tutorial.karaf.camel.jpa2jms.model.Person] openjpa.jdbc.JDBC - Using dictionary class "org.apache.openjpa.jdbc.sql.OracleDictionary" (Oracle Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bit Production
    With the Partitioning, OLAP and Data Mining options ,Oracle JDBC driver 10.2.0.1.0XE).
    mais à chaque tentative de lecture j'ai la même erreur.
    merci de votre aide
    A+JYT

  2. #2
    Rédacteur/Modérateur
    Avatar de andry.aime
    Homme Profil pro
    Inscrit en
    Septembre 2007
    Messages
    8 391
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Ile Maurice

    Informations forums :
    Inscription : Septembre 2007
    Messages : 8 391
    Par défaut
    Bonjour,

    Caused by: javax.naming.NotContextException
    Regarde ici.


    A+.

  3. #3
    Expert confirmé
    Avatar de sekaijin
    Homme Profil pro
    Urbaniste
    Inscrit en
    Juillet 2004
    Messages
    4 205
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 61
    Localisation : France, Yvelines (Île de France)

    Informations professionnelles :
    Activité : Urbaniste
    Secteur : Santé

    Informations forums :
    Inscription : Juillet 2004
    Messages : 4 205
    Par défaut
    Oui je sais ce qu'est une NoContextException.
    ce que je ne sais pas c'est comment faire pour savoir QUOI dans JPA fait un lookup de QUOI qui causse cette exception

    A+JYT

  4. #4
    Expert confirmé
    Avatar de sekaijin
    Homme Profil pro
    Urbaniste
    Inscrit en
    Juillet 2004
    Messages
    4 205
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 61
    Localisation : France, Yvelines (Île de France)

    Informations professionnelles :
    Activité : Urbaniste
    Secteur : Santé

    Informations forums :
    Inscription : Juillet 2004
    Messages : 4 205
    Par défaut
    Bonjour

    j'ai enfin trouvé du temps et du coup la solution

    cette erreur provient d'une utilisation transactionnelle de JPA (JTA) alors que la datasource n'est pas compatible XA

    la solution utiliser une datasource xA ou utiliser une persistance non JTA

    A+JYT

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Réponses: 1
    Dernier message: 21/10/2011, 16h10
  2. Réponses: 1
    Dernier message: 18/10/2011, 23h55
  3. Réponses: 0
    Dernier message: 28/07/2010, 19h10
  4. Réponses: 0
    Dernier message: 29/09/2008, 18h13
  5. Réponses: 2
    Dernier message: 15/01/2007, 14h42

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo