Meaningless Drivel is fun!*
The moose likes Oracle/OAS and the fly likes OC4J JMS Clustering problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Oracle/OAS
Bookmark "OC4J JMS Clustering problem" Watch "OC4J JMS Clustering problem" New topic
Author

OC4J JMS Clustering problem

Deepak Raina
Greenhorn

Joined: Jul 27, 2004
Posts: 6
I'm using OC4J 9.0.3 as a standalone server on Windows XP. I have a Tomcat 4.1.29 as my webserver on a different physical location. My webapp is installed in Tomcat and my ejb's are insalled in oc4j within a ear file. I'm also using OC4J/JMS as my jms provider. From my EJB I add a message in the jms queue. It works fine. But now when I cluster the oc4j by introduing another OC4J in a different phyisical location (in a seperate JVM) then my problem starts. I'm using OracleAS JMS Server Distributed Destinations where all factories and destinations are defined on both OC4J instances.

Following are different problems I get

1. I start both the servers at the same time and then If I run my jms application it gives the following error in my program.

javax.jms.JMSException: Unable to connect to JMSServer (/host1:9125)


2. Sometimes I get this error in the console.
java.lang.NullPointerException
at com.evermind.server.jms.JMSServer.removeClient(JMSServer.java:724)
at com.evermind.server.jms.JMSRequestHandler.run(JMSRequestHandler.java:278)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
at java.lang.Thread.run(Thread.java:534)

My jms.xml files on both the servers is same except for the port and host attributes. My two jms.xml files on two different servers are

<jms-server port="9125" host="host1">
<queue name="Queue1" location="jms/Queue/Queue1" persistence-file="pers"> </queue>
<queue-connection-factory location="jms/Queue/QCF"></queue-connection-factory>
</jms-server>

<jms-server port="9127" host="host2">
<queue name="Queue1" location="jms/Queue/Queue1" persistence-file="pers"> </queue>
<queue-connection-factory location="jms/Queue/QCF"></queue-connection-factory>
</jms-server>

3. If I start only one OC4J (host1) server then It works fine. If I start the second server (host2) after some time it still works fine. But if I stop the host1 oc4j server it's not able to find the jms server as it still looks for the host1 jms server.

Do I need any other specific configuration?
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9044
    
  10
OC4J standalone states that it does not support clustering.


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Deepak Raina
Greenhorn

Joined: Jul 27, 2004
Posts: 6
It supports clustering. I have gone through the OC4J documentation. My other applications are running fine. Only problem I'm facing is with the JMS application. Is there any specific thing anybody is aware of?
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9044
    
  10
Sorry. My error. I misread "Localhost will not work with clustering".
R�bert Nagy
Greenhorn

Joined: Aug 05, 2004
Posts: 1
We have the same problem.
First we try set parameter res-sharing-scope in ejb-jar.xml to Shareable:

This work only on standalone OC4J 9.0.3 aplications servers in cluster, but didn't work on 9iAS in cluster.
But we use some servlet to sending JMS to Queue, whitch work ok on all systems, and because that we make HTTPRequest to servlet from EJB. No pretty, but working solution.
We have two projects ejb and web together, and we may use this, but when yiu have only ejb project you have problem still
I think that this is something wronk in configuration in ejb-jar.xml or orion-ejb-jar.xml
[ August 05, 2004: Message edited by: R�bert Nagy ]
Deepak Raina
Greenhorn

Joined: Jul 27, 2004
Posts: 6
Hi Robert,

You have said that it works fine with standalone oc4j cluster. I'm using a standalone oc4j cluster only and I'm having the same settings in the ejb-jar.xml but this error still comes. If I start the servers at the same time then it works fine. It seems to be some problem with the jms.xml and rmi.xml files. Can you tell me the settings in your jms.xml and rmi.xml files. Also , what setting you are doing in orion-ejb-jar.xml file?

Thanks,
Deepak
Robert Nagy
Greenhorn

Joined: Aug 02, 2004
Posts: 1
Sorry for late reply

In jms.xml configuration file I use host="[ALL]":
<jms-server host="[ALL]" port="9127">

and for topic-connection-factory you must use multicast host adress (try use 230.0.0.1 or more):
<topic-connection-factory name="My Topic Connection Factory" host="230.0.0.20" port="9127" location="jms/MyTopicConnectionFactory" username="username" password="password">
<description>My Topic Connection factory</description>
</topic-connection-factory>

When you use Queue, you don't need configure any special.

My rmi.xml configuration file:
<rmi-server port="23791">
<cluster username="username" password="password" host="224.0.0.3" id="123"/>
<log>
<file path="../log/rmi.log"/>
</log>
</rmi-server>

host is another multicast adress. Use the same id on both instances (or change to different, when it don't work).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: OC4J JMS Clustering problem
 
Similar Threads
Multi datasource in websphere
Spring+JMS+OC4J
Communication between JMS topics in different JMS servers
Error : Spring + Jms Application deployed on Oc4j
Problem with Resin Load Balancing (Clustering)