openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Guillaume Chauvet (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (OPENJPA-2106) JORAM and OpenJPA remote event notification framework‏
Date Thu, 12 Jan 2012 08:29:38 GMT

    [ https://issues.apache.org/jira/browse/OPENJPA-2106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13184815#comment-13184815
] 

Guillaume Chauvet commented on OPENJPA-2106:
--------------------------------------------

I think it's a problem or invalid OpenJPA configuration because I use JORAM only throught
OpenJPA. If you look the sample below based on OpenJPA documentation, chapter 2.1.1  :

===============================================================
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
version="2.0">
    <persistence-unit name="TEST" transaction-type="RESOURCE_LOCAL">
        <class>fr.chauvet.guillaume.mom.dto.Person</class>
        <properties>
            <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema"/>
            <property name="openjpa.ConnectionURL" value="jdbc:derby://localhost:1527/test;create=true"/>
            <property name="openjpa.ConnectionUserName" value="test"/>
            <property name="openjpa.ConnectionPassword" value="test"/>
            <property name="openjpa.Multithreaded" value="true"/>
            <property name="openjpa.ConnectionDriverName" value="org.apache.derby.jdbc.ClientDriver"/>
            <property name="openjpa.RemoteCommitProvider" value="jms(Topic=OpenJPACommitProviderTopic,
TopicConnectionFactory=ConnectionFactory, TransmitPersistedObjectIds=true)"/>
        </properties>
    </persistence-unit>
</persistence>

===============================================================
package fr.chauvet.guillaume.mom.client;

import fr.chauvet.guillaume.mom.dto.Person;
import fr.dyade.aaa.jndi2.client.NamingContextFactory;
import javax.naming.Context;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import org.apache.openjpa.persistence.EntityManagerFactoryImpl;

public class PublisherApp {

    public static void main(String[] args) throws Exception {
        System.getProperties().put(Context.INITIAL_CONTEXT_FACTORY, NamingContextFactory.class.getName());
        EntityManagerFactory factory = Persistence.createEntityManagerFactory("TEST");
        EntityManager em = factory.createEntityManager();
        Person person = new Person();
        person.setName("Name");
        person.setSurname("Surname");
        em.getTransaction().begin();
        em.persist(person);
        em.getTransaction().commit();                               // Exception thrown !
        em.close();
    }
}

Regards,
Guillaume

                
> JORAM and OpenJPA remote event notification framework‏
> ------------------------------------------------------
>
>                 Key: OPENJPA-2106
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2106
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 2.1.0
>         Environment: Windows XP 32 bits, Java SE (JRE 1.6.0_29 / JDK 1.6.0_26),  NetBeans
7.0.1
>            Reporter: Guillaume Chauvet
>
> Hi,
> I have a serious error with Joram and OpenJPA. When I start my collocated Joram Server
and start my mockup OpenJPA client, I have this exception :
> 134484  TEST  WARN   [main] openjpa.Runtime - Error broadcasting JMS update to topic
"OpenJPACommitProviderTopic". Remote BrokerFactories may be out-of-date.
> javax.jms.IllegalStateException: Illegal control thread
> 	at org.objectweb.joram.client.jms.Session.checkThreadOfControl(Session.java:706)
> 	at org.objectweb.joram.client.jms.Session.send(Session.java:2045)
> 	at org.objectweb.joram.client.jms.MessageProducer.doSend(MessageProducer.java:377)
> 	at org.objectweb.joram.client.jms.MessageProducer.send(MessageProducer.java:269)
> 	at org.objectweb.joram.client.jms.TopicPublisher.publish(TopicPublisher.java:85)
> 	at org.apache.openjpa.event.JMSRemoteCommitProvider.broadcast(JMSRemoteCommitProvider.java:122)
> 	at org.apache.openjpa.event.RemoteCommitEventManager.afterCommit(RemoteCommitEventManager.java:156)
> 	at org.apache.openjpa.event.TransactionEventManager.fireEvent(TransactionEventManager.java:107)
> 	at org.apache.openjpa.lib.util.concurrent.AbstractConcurrentEventManager.fireEvent(AbstractConcurrentEventManager.java:115)
> 	at org.apache.openjpa.kernel.BrokerImpl.fireTransactionEvent(BrokerImpl.java:868)
> 	at org.apache.openjpa.kernel.BrokerImpl.endTransaction(BrokerImpl.java:2353)
> 	at org.apache.openjpa.kernel.BrokerImpl.afterCompletion(BrokerImpl.java:1989)
> 	at org.apache.openjpa.kernel.LocalManagedRuntime.commit(LocalManagedRuntime.java:94)
> 	at org.apache.openjpa.kernel.BrokerImpl.commit(BrokerImpl.java:1493)
> 	at org.apache.openjpa.kernel.DelegatingBroker.commit(DelegatingBroker.java:925)
> 	at org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.java:561)
> 	at fr.chauvet.guillaume.mom.client.PublisherApp.main(PublisherApp.java:27) 
> You can upload my maven mock-up project, with 2 modules : MOM server and MOM client at
:
> https://docs.google.com/open?id=0B7gRE0nL6vNiMTIyZmE2NjEtZTY1Yy00ZTVjLWJlNGEtODAyZmZhZjY5ZDM3

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

Mime
View raw message