wood burning stoves 2.0*
The moose likes Websphere and the fly likes On which port iiop protocol listens in Websphere application server 5.0.1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "On which port iiop protocol listens in Websphere application server 5.0.1" Watch "On which port iiop protocol listens in Websphere application server 5.0.1" New topic
Author

On which port iiop protocol listens in Websphere application server 5.0.1

Seema
Greenhorn

Joined: Aug 05, 2002
Posts: 15
I am facing a problem in JNDI Lookup . I am using Websphere Application Server 5.0.1.
I have created Topic Connection Factory and Topic on Websphere (Resources - >Websphere JMS Provider)
I am setting given values for getting InitialContext.
Context.INITIAL_CONTEXT_FACTORY,"com.ibm.websphere.naming.WsnInitialContextFactory"
Context.PROVIDER_URL,"iiop://test2.dev.prodigy.net:9092"

try {
Hashtable hash = new Hashtable();
hash.put(Context.INITIAL_CONTEXT_FACTORY,"com.ibm.websphere.naming.WsnInitialContextFactory");
hash.put(Context.PROVIDER_URL,"iiop://test2.dev.prodigy.net:9080");
jndiContext = new InitialContext(hash);
System.out.println("Got Initial Context : "+ jndiContext);
} catch (NamingException e) {
System.out.println("Could not create JNDI API " +
"context: " + e.toString());
e.printStackTrace();
System.exit(1);
}

/*
* Look up connection factory and topic. If either does
* not exist, exit.
*/
try {
System.out.println("Before Lookup Topic Factory");
topicConnectionFactory = (TopicConnectionFactory)
jndiContext.lookup("TestTopicConnectionFactoryJNDI");
System.out.println("After Lookup Topic Factory");
topic = (Topic) jndiContext.lookup(topicName);
System.out.println("After Lookup TopicName ");
} catch (NamingException e) {
System.out.println("JNDI API lookup failed: " +
e.toString());
// e.printStackTrace();
System.exit(1);
}

Problem is at JNDI Lookup of TopicConnection Factory.
Its giving me this error :
JNDI API lookup failed: javax.naming.CommunicationException: A communication failure occurred while attempting to obtain an initial context using the provider
url: "iiop://test2.dev.prodigy.net:9092". Make sure that the host and port information is correct and that the server identified by the provider url is a running
name server. If no port number is specified, the default port number 2809 is used. Other possible causes include the network environment or workstation networ
k configuration. [Root exception is org.omg.CORBA.COMM_FAILURE: purge_calls:1197 reason=1 state=5 minor code: 4942F306 completed: Maybe]
javax.naming.CommunicationException: A communication failure occurred while attempting to obtain an initial context using the provider url: "iiop://test2.dev.prodigy.net:9092". Make sure that the host and port information is correct and that the server identified by the provider url is a running name server. If no por
t number is specified, the default port number 2809 is used. Other possible causes include the network environment or workstation network configuration. Root e
xception is org.omg.CORBA.COMM_FAILURE: purge_calls:1197reason=1 state=5 minor code: 4942F306 completed: Maybe
at com.ibm.rmi.iiop.Connection.purge_calls(Connection.java:1196)
at com.ibm.rmi.iiop.Connection.doReaderWorkOnce(Connection.java:2496)
at com.ibm.rmi.transport.ReaderThread.run(ReaderPoolImpl.java:138)
can anyone help me from where do I find on which port iiop listens in websphere application server 5.0.1
jeff mutonho
Ranch Hand

Joined: Apr 30, 2003
Posts: 271
Can you ping test2.dev.prodigy.net?Have you tried the ip address of that machine instead?
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
    
    5
Read the startup log files. When WebSphere starts it tells you what ports it is listening on.
Kyle


Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
Seema
Greenhorn

Joined: Aug 05, 2002
Posts: 15
Yaa I am able to ping on the same.Its fine.
Context.PROVIDER_URL,"iiop://test2.dev.prodigy.net:2809"
Now My this problem is resolved.It is resolved by keeping following file in classpath:
naming.jar;namingclient.jar;ras.jar;namingserver.jar
I have created Topic Connection Factory and Topic in Websphere using Websphere JMS provider option.
My code is like this :
try {
Hashtable hash = new Hashtable();
hash.put(Context.INITIAL_CONTEXT_FACTORY,"com.ibm.websphere.naming.WsnInitialContextFactory");
hash.put(Context.PROVIDER_URL,"iiop://hostname:2809");

jndiContext = new InitialContext(hash);
System.out.println("Got Initial Context : "+ jndiContext);
} catch (NamingException e) {

e.printStackTrace();
System.exit(1);
}

try {
System.out.println("Before Lookup Topic Factory");
topicConnectionFactory = (TopicConnectionFactory)jndiContext.lookup("TestTopicConnectionFactoryJNDI");
System.out.println("After Lookup Topic Factory");
topic = (Topic) jndiContext.lookup(topicName);
System.out.println("After Lookup TopicName ");
} catch (NamingException e) {
e.printStackTrace();
System.exit(1);
}
But when I do lookup with the JNDI name of my Topic Connection Factory ,Its giving me this error :
Got Initial Context : javax.naming.InitialContext@48bf9972
Before Lookup Topic Factory
javax.naming.NameNotFoundException: TestTopicConnectionFactoryJNDI
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1
504)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1
458)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookup(CNContextImpl.java:116
8)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:132)
at javax.naming.InitialContext.lookup(InitialContext.java:359)
at TopicPublisher.main(TopicPublisher.java:75)

Any idea , what wrong I am doing ..
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
    
    5
Do a dumpNamespace to make sure you really bound the TopicConnectionFactory to that name. Normally, BTW, such names start with "jms/".
Also, DO NOT try this by just randomly adding files to the classpath. Read the section in the InfoCenter on Java Application Clients and follow the directions there. My advice to you is to use the J2EE application client (e.g. the LaunchClient batch file) to avoid all of the headaches you WILL encounter in trying to get the classpath right.
Kyle
Tom John
Greenhorn

Joined: Apr 15, 2002
Posts: 29
Hi Kyle ,
You had said the users could read the startup log files to find which port was listening . Would you please tell it more clearly ? I had visited the log files . But I didn�t know which log files was the startup log .
And you adviced us to read the section in the InfoCenter on Java Application Clients and follow the directions . But in www.ibm.com , there are too many infocenters to find the appropriate the info . Would you please give me a clear url to let me visit the useful infocenter ?
Thanks in advance !
Best regard
Nagendra Prasad
Ranch Hand

Joined: Jul 11, 2002
Posts: 219
The URL For the websphere version 4 infocenter is:
Infocenter Version 4.0


Best Regards,<br />Nagendra Prasad.
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
    
    5
Actually, he's on 5.0. This link is what he's looking for. And also the file you're looking for is probably WebSphere/logs/server1/SystemOut.log.
That's the nice helpful, bartender part. Now comes the mean, but also helpful part for which I take off my bartender hat. Seema, there is an acronym in Computer Science that was invented to address questions like this. You may have heard it. It's called "RTFM" for (politely) "Read the Fine Manual".
Before asking questions in a public forum, it is EXPECTED that you had at least looked in the product documenation for the answer. The very fact that you didn't even know where the manual was means you have violated a trust that we all had of you. In which case, your very first question should have been "Where do I find the WebSphere product documentation"?
Please, in the future don't expect us to do your job for you. READ THE MANUAL FIRST. If you can't find an answer in the InfoCenter, then ask us... We don't get paid for this -- JavaRanch is a volunteer organization. You must do your part to allow us to effectively do ours.
Kyle
[ October 27, 2003: Message edited by: Kyle Brown ]
Mahesh Chalil
Ranch Hand

Joined: Jan 24, 2002
Posts: 147
Also Seema, there is no need to use PROVIDR_URL and CONTEXT_FACTORy. You will understand from the documentation that you can use the default InitialContext.
And as Kyle mentioned, no need to chnage anything with the jar files or so. Everything should work as it is if you use proper documentation to follow in a standard way.
Steps are simple:
1. Define your JMS Provider
2. Create your TopicFactory and Topic and with JNDI names
3. Find that these jndi names are local to each serverprocess now. So no need to depend on the global namespace anymore as in previous versions. Thats why we dont need to specify anymore details. But I would prefer you to give this details only if you control JNDi caching with websphere.
Dont worry. Just go through google.com and type what you want. You will be answered. But as Kyle said, this forum is more dedicated to problems which are not able to solve or share info which are time worth. So.. dont take it -vely, try ur part first and then lets help you out with the rest.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: On which port iiop protocol listens in Websphere application server 5.0.1