Unable to locate the TopicConnectionFactory !_NEWLINE_!from an RMI server
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Ram_Alluri
Posted On:   Friday, April 6, 2001 03:39 PM

I am using the J2SDKEE1.3 beta version as my App Server. So I am using the Message Queue that come swith this reference implementation. I am able to create the Topic and TopicConnectionFactory from a regular java client (i.e from the SimpleTopicPublisher example that comes with the reference implementation) But I need to access the TopicConnectionFactory from within an RMI server that needs to publish async messages to the Topic on the J2SDKEE1.3 server I have the following code from my RMI server implementation class TopicConnection topicConnection = null; Topic topic = null; TopicConnectionFactory topicConnectionFactory = null; Context context = null; public    More>>

I am using the J2SDKEE1.3 beta version as my App Server. So I am using the Message Queue that come swith this reference implementation.


I am able to create the Topic and TopicConnectionFactory from a regular java client (i.e from the SimpleTopicPublisher example that comes with the reference implementation)

But I need to access the TopicConnectionFactory from within an RMI server that needs to publish async messages to the Topic on the J2SDKEE1.3 server

I have the following code from my RMI server implementation class

TopicConnection topicConnection = null;
Topic topic = null;
TopicConnectionFactory
topicConnectionFactory = null;
Context context = null;

public VoiceContactRMIServerImpl()
throws RemoteException
{
super();

/*
* Create a JNDI InitialContext
* object if none exists yet.
*/
try
{
context = new InitialContext();
}
catch (NamingException e)
{
System.out.println(e.toString());
}

/*
* Look up connection factory
* and topic. If either does
* not exist, exit.
*/
try
{
// Create a TopicConnection
topic = (Topic)context.
lookup("MyTopic");
if (topic != null)
System.out.println(topic.toString());

topicConnectionFactory =
TopicConnectionFactory)context.
lookup("TopicConnectionFactory");
System.out.println ("Factory" +
"created successfully");

}
catch (NamingException e)
{
System.out.println("e.toString());
}

}


This constructor method is able to successfully lookup the Topic but then hangs when it is trying to create the TopicConnectionFactory.

This same piece of code works fine from a regular java class (i.e not a RMI class)

What do I need to do to make this work from within an RMI server.

Thanks.

   <<Less
About | Sitemap | Contact