Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] JMS Cache coordination configuration issue

For cache coordination to work correctly both application instances must be utilizing the same JMS Broker Topic. As for why your application works on one server and not the other, my guess would be that the Topic your application is looking for does not exist on the server. (Perhaps a typo in the name?) Are the OC4J servers defined as a cluster?

I'm no expert on OC4J. I'm currently employing a GlassFish cluster for out application. I have two GlassFish instances that participate in the cluster. Our application is deployed to the cluster (1 application instance on each GlassFish instance). I have a ConnectionFactory defined in the cluster that points to a JMS cluster (2+ instances of OpenMQ) that is external of the GlassFish cluster.  When an application instance publishes a message onto the Cache Coordination Topic the other application instance can receive it. Based upon your description, you have two OC4J servers running on two separate hosts. Unless you have the OC4J instances configured to participate in a cluster or have the JMS Brokers in each server configured to work as a cluster, your messages will never be shared between you application instances.

Chris Mathrusse
christopher.mathrusse@xxxxxxxxxx
Sybase, Inc



From: Loreno Oliveira <lorenooliveira@xxxxxxxxx>
To: EclipseLink User Discussions <eclipselink-users@xxxxxxxxxxx>
Date: 01/21/2010 12:34 PM
Subject: Re: [eclipselink-users] JMS Cache coordination configuration issue
Sent by: <eclipselink-users-bounces@xxxxxxxxxxx>





Thanks for the help Christopher!

Actually, I'm a bit confused about this behavior. I have two copies of my application running at two OC4J servers, each on a different host.

In one of the OC4Js I have configured my the topic to be used by eclipselink. The application deployed at this same server works fine. I can observe in the enterprise manager that messages are being sent to the topic. However, the second application copy, running in the other OC4J installation at the second host is throwing this exception.

That is, should I provide some more configuration in order that the application running outside the OC4J where the topic was created can connect to he topic in the first host?

Loreno

On Thu, Jan 21, 2010 at 3:59 PM, <Christopher.Mathrusse@xxxxxxxxxx> wrote:
Below I've attached the SessionCustomizer that we are using, which works and we have wired into the application with Spring. But looking at your exception it appears to be related to the Topic being unknown on the connection to the JMS Server. You should verify that the Topic actually exists on the JMS broker that both applications are connecting to. Also, make certain that both servers are connecting to the same JMS Broker or cluster.

public final class JmsSessionCustomizer implements SessionCustomizer {


    private String jmsConnectionFactoryName;

   
    private String jmsTopicName;

   
    private String userName;

   
    private String password;

   
    private String providerURL;

   
    private String initialContextFactory;


    @Override

    public void customize(Session session) throws Exception {

        RemoteCommandManager rcm = new RemoteCommandManager((CommandProcessor) session);

        java.util.Properties props = new java.util.Properties();

        props.put(Context.PROVIDER_URL, getProviderURL());
        props.put(Context.INITIAL_CONTEXT_FACTORY, getInitialContextFactory());

       
        JMSTopicTransportManager tm = new JMSTopicTransportManager(rcm);

        tm.setLocalContextProperties(props);
        tm.setRemoteContextProperties(props);

        tm.setTopicName(getJmsTopicName());

        tm.setTopicConnectionFactoryName(getJmsConnectionFactoryName());

        tm.setUserName(getUserName());

        tm.setPassword(getPassword());

        tm.setShouldRemoveConnectionOnError(true);

       
        rcm.setTransportManager(tm);


        ((DatabaseSession)session).setCommandManager(rcm);

        ((DatabaseSession)session).setShouldPropagateChanges(true);


        rcm.initialize();
    }

}


Chris Mathrusse

christopher.mathrusse@xxxxxxxxxx
Sybase, Inc



From: Loreno Oliveira <lorenooliveira@xxxxxxxxx>
To: EclipseLink User Discussions <eclipselink-users@xxxxxxxxxxx>
Date: 01/21/2010 10:03 AM
Subject: [eclipselink-users] JMS Cache coordination configuration issue
Sent by: <eclipselink-users-bounces@xxxxxxxxxxx>







Hi there, 

I was following some old threads about solving problems related to cache coordination. In my last attempt I tried to adapt the implementation of the CacheCoordinationSessionCustomizer.java, in the eclipselink's test repository.

My current implementation of SessionCustomizer is as follows:

public void customize(Session arg0) throws Exception {
session.setProperty( "cachecoordination.protocol", "jms" );

RemoteCommandManager rcm = new RemoteCommandManager( (DatabaseSessionImpl) session );

JMSTopicTransportManager tm = new JMSTopicTransportManager(rcm);
tm.setTopicHostUrl( "ormi://<ip>:23791/Referencia" );
tm.setTopicName( "jms/TopicoCoordenacaoCacheCNIS" );
tm.setTopicConnectionFactoryName( "jms/TopicConnectionFactoryCNIS" );
rcm.setTransportManager( tm );
rcm.getTransportManager().setUserName( "oc4jadmin" );
rcm.getTransportManager().setPassword( "topsecret" );
rcm.setShouldPropagateAsynchronously( false );
rcm.getTransportManager().setNamingServiceType( TransportManager.JNDI_NAMING_SERVICE );
rcm.getTransportManager().setInitialContextFactoryName( "oracle.j2ee.rmi.RMIInitialContextFactory" );
rcm.getTransportManager().setShouldRemoveConnectionOnError( true );
rcm.setServerPlatform(((org.eclipse.persistence.sessions.DatabaseSession) session).getServerPlatform());
((DatabaseSessionImpl) session).setCommandManager(rcm);
((DatabaseSessionImpl) session).setShouldPropagateChanges(true);
rcm.initialize();

// Sleep to allow RCM to startup and find each session.
try {
Thread.sleep(2000);
} catch (Exception ignore) {
}
}

And in my persistence.xml I have:

<property name="eclipselink.session.customizer" value="packagepath.CacheCustomizer"/>

Well, the problem I'm running into is (just the root of the exception) (sorry for the topic description in portuguese. I did not translate the original exception message for maintaining the exception transcription exactly as I got it):

Caused by: javax.jms.InvalidDestinationException: JMSServer[null:9127]: destination "Tópico para coordenação de cache L2 do eclipselink" is unknown in connection "Oc4jJMS.Connection.null.62d6aaf9:12651f748d4:-8000.4".
at com.evermind.server.jms.JMSUtils.make(JMSUtils.java:1075)
at com.evermind.server.jms.JMSUtils.toInvalidDestinationException(JMSUtils.java:1137)
at com.evermind.server.jms.JMSProvider.findDestination(JMSProvider.java:935)
at com.evermind.server.jms.JMSProvider.findDestination(JMSProvider.java:893)
at com.evermind.server.jms.JMSProvider.createConsumer(JMSProvider.java:450)
at com.evermind.server.jms.EvermindMessageConsumer.<init>(EvermindMessageConsumer.java:87)
at com.evermind.server.jms.EvermindTopicSubscriber.<init>(EvermindTopicSubscriber.java:50)
at com.evermind.server.jms.EvermindTopicSession.createSubscriber(EvermindTopicSession.java:83)
at com.evermind.server.jms.EvermindTopicSession.createSubscriber(EvermindTopicSession.java:74)
at org.eclipse.persistence.internal.sessions.coordination.jms.JMSTopicRemoteConnection.<init>(JMSTopicRemoteConnection.java:78)
at org.eclipse.persistence.sessions.coordination.jms.JMSTopicTransportManager.createConnection(JMSTopicTransportManager.java:101)
... 85 more

I tried search for this error message but just found people with the same problem, but no one with a working solution or, at least, some comment about what is going wrong here.

Does anyone have any hint about what I am doing wrong?

Regards,

Loreno

PS1: I'm doing my first steps on the JMS field. Actually, this is my first incursion in a solution that involves JMS...
PS2: I'm using version 1.1.1 of eclipselink

PS3: I have two copies of the same appliaction running on different hosts. Everything goes just fine in the application deployed in the same host as the JMS topic. The problem above occurs when I try to use the application deployed in the second host, which tries to get access to the topic configured in the first host._______________________________________________
eclipselink-users mailing list

eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users



_______________________________________________
eclipselink-users mailing list

eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users

_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users



Back to the top