• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Standalone Java EJB client

 
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Having yet another problem with the configuration in WebSphere.

I have a Standalone java client that looks up and EJB - well that's what it's supposed to do anyway. The lookup fails. I have m ORB Bootstrap running on port 2809. Here's the code I use to get the initial context:



I get the following exception:



Why, at the bottom of this message, is it showing my port as 9100?

[ November 10, 2005: Message edited by: Michael Valentino ]
[ November 10, 2005: Message edited by: Michael Valentino ]
 
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The 9100 port is used as ORB_LISTENER_ADDRESS in webspshere. It looks like your ORB was not started succesfully.

Thanks

Lin
 
author
Posts: 4107
28
Google Web Toolkit Eclipse IDE Flex
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The ports are configurable in WS HTML Admin Console. Click on a server instance and select ports to see all assigned ports.

If you setup a second instance (via a new server or profile) WAS will automatically increment all port numbers by 1 unless otherwise specified.
 
Michael Valentino
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
websphere...

Ok - I was able to get a reference to the EJB using the UTC, which has the following properties:

INITIAL_CONTEXT_FACTORY = com.ibm.websphere.naming.WsnInitialContextFactory
Provider URL = iiop://localhost:2809/

But when I try to do the lookup from a stand-alone Java client, i get the same error message displayed in the first message in this Topic. What kind of black magic is this UTC doing that I'm not doing in my client?
 
Scott Selikoff
author
Posts: 4107
28
Google Web Toolkit Eclipse IDE Flex
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
LOL, the UTC is an excellent test of whether a service is working, especially for JNDI objects, so congrats that at least works.

I'm thinking your missing something quite obvious with your test code, but I can't say for sure I know what it is without being deep in your setup. Just try removing and scaling back the data until you get something that works is the best I can tell you.

Sorry!
[ November 10, 2005: Message edited by: Scott Selikoff ]
 
Michael Valentino
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm starting to think that the issue here is a network issue. If I access an EJB web service from a Servlet or another EJB client, all works well. It's only when I try to access the EJB from a client running in another instance of the JVM - servlet, or standalone client - does the JNDI lookup fail.

When you install the WAS test environment, did you put for the server name "localhost" or "computername.domainname" ?
 
author
Posts: 181
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to make sure you are using the thin client correctly:

From client machine: http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/com.ibm.websphere.base.doc/info/aes/ae/tcli_developthinclient.html

Running from server machine http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/topic/com.ibm.websphere.base.doc/info/aes/ae/tcli_developthinserver.html

Also, I see you are using java/comp to do the lookup. From a stand alone client, you need to use the fully qualified JNDI name. If you want to use a J2EE applicaiton client, then you need to run the client container:

http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/com.ibm.websphere.base.doc/info/aes/ae/ccli_javaclient.html
[ November 16, 2005: Message edited by: Roland Barcia ]
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had the same problem. I fixed it by setting the host of the ORB server to be my machine name instead of localhost... After that, I could do the lookup on that jdni server from another JVM instance.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!