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

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



Back to the top