aspose file tools*
The moose likes Websphere and the fly likes JNDI error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "JNDI error" Watch "JNDI error" New topic
Author

JNDI error

John McDonald
Ranch Hand

Joined: Jul 01, 2003
Posts: 112
Dear Gurus,
I am new to WAS. In fact I use Websphere Integration Developer 6. I created EJBProject and stateless HelloEJB

I also created an Enterprise Application and Application Project which have references to EJB Project

I deployed ejb by adding Enterprise Applcation to the server. I saw ejb.ar and its jndi in admin console but I don't see any of those on ibm universal test.

Here is my code:

final String JNDI = "ejb/ejbs/HelloEJBHome";
Properties properties = new java.util.Properties();

properties.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY,
"com.ibm.websphere.naming.WsnInitialContextFactory");
properties.put(javax.naming.Context.PROVIDER_URL, "iiop://localhost:2810/");
HelloEJBHome home = (HelloEJBHome)context.lookup(JNDI);

HelloEJB hello= home.create();
System.out.println(hello.greet("Blessing"));

I don't know whether I don't have the context properties right or I dont' have the jndi right. The jndi JNDI = "ejb/ejbs/HelloEJBHome" is exactly what is shown in the ibm-ebj-jar-bnd.xmi and in the admin console. Thank you very much.

John




Error is follow:
Aug 13, 2008 2:08:48 PM com.ibm.ws.naming.util.WsnInitCtxFactory
WARNING: jndiUnavailCommErr
javax.naming.ServiceUnavailableException: A communication failure occurred while attempting to obtain an initial context with the provider URL: "iiop://localhost:2810/". Make sure that any bootstrap address information in the URL is correct and that the target name server is running. A bootstrap address with no port specification defaults to port 2809. Possible causes other than an incorrect bootstrap address or unavailable name server include the network environment and workstation network configuration. [Root exception is org.omg.CORBA.TRANSIENT: initial and forwarded IOR inaccessible:
Forwarded IOR failed with: java.net.UnknownHostException: EIS745XP.customs.treas.gov:host=EIS745XP.customs.treas.gov,port=9101
Initial IOR failed with: java.net.UnknownHostException: EIS745XP.customs.treas.gov:host=EIS745XP.customs.treas.gov,port=9101 vmcid: IBM minor code: E07 completed: No]








WARNING: jndiUnavailCommErr
javax.naming.ServiceUnavailableException:
Andr�s Irmer
Greenhorn

Joined: Aug 27, 2008
Posts: 1
Same problem here... Any solution?
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Without knowing anything about WAS (I run on Jboss mostly) you might want to check that:

1.) The port isn't already bound or in use by something else

2.) That your app server understands the concept of localhost (try using a domain name or actual IP address to see if that's the problem)

Cheers,
Martijn


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
Sibi Joseph
Greenhorn

Joined: Jan 31, 2007
Posts: 7
hi

DID anyine get a solution. i am facing the same problem with WAS 7.0.0.7 running on a redhat enterprise linux 5.5

please share

thanks and Regards
sibi
Andr�s Irmer wrote:Same problem here... Any solution?
Sibi Joseph
Greenhorn

Joined: Jan 31, 2007
Posts: 7
hi Saw the following post
http://www.ecmplace.com/viewtopic.php?f=39&t=9906&start=0

I was experiencing this problem, and after running an ethernet trace found that my WebSphere server was responding with a redirect to itself using it's host name, which was not resolvable from the client.

Once I added the hostname into the <windows>\system32\drivers\etc\hosts file, it worked just fine.

So check to make sure the name ( not ip) that your host thinks it is can be resolved by anybody trying to lookup jndi resources on it.




Sibi Joseph wrote:hi

DID anyine get a solution. i am facing the same problem with WAS 7.0.0.7 running on a redhat enterprise linux 5.5

please share

thanks and Regards
sibi
Andr�s Irmer wrote:Same problem here... Any solution?
Sibi Joseph
Greenhorn

Joined: Jan 31, 2007
Posts: 7
Hi Just to update.. that did not work either..

please help if any of you have an answer


sibi

Sibi Joseph wrote:hi Saw the following post
http://www.ecmplace.com/viewtopic.php?f=39&t=9906&start=0

I was experiencing this problem, and after running an ethernet trace found that my WebSphere server was responding with a redirect to itself using it's host name, which was not resolvable from the client.

Once I added the hostname into the <windows>\system32\drivers\etc\hosts file, it worked just fine.

So check to make sure the name ( not ip) that your host thinks it is can be resolved by anybody trying to lookup jndi resources on it.




Sibi Joseph wrote:hi

DID anyine get a solution. i am facing the same problem with WAS 7.0.0.7 running on a redhat enterprise linux 5.5

please share

thanks and Regards
sibi
Andr�s Irmer wrote:Same problem here... Any solution?
Askar Akhmerov
Greenhorn

Joined: Apr 13, 2010
Posts: 20

try to check port number.
as long as I understand 2810 is a port number of some node(on my installation it's the port number of the app server which was created along with installation). Make sure you have deployed your EjB on that node.
2809 - default port
2811, 2812, and so on are the port numbers of the AppSrv's that you have created on your own.

You should look for the correct port number in you admin console.
Sibi Joseph
Greenhorn

Joined: Jan 31, 2007
Posts: 7
Hi Askar

Thank you for the reply.. I have the issue resolved. It was indeed the problem of client not able to look-up the server by name. First my WAS server did not have a fully qualified domain name. I gave the linux box a fully qualified domain name. http://www-01.ibm.com/support/docview.wss?uid=swg21315802

Apart from this i have added the port and host name to the sas.client.props file (not actually necessary).

Additional Info i have gathered.


A good way to debug IIOP issues is to add the following arguments to java when you start the client

-Dcom.ibm.CORBA.Debug=true -Dcom.ibm.CORBA.CommTrace=true -Dcom.ibm.CORBA.Debug.Output= client.log

IIOP data gets logged into client.log file.

it is also seen that at times the sas.client.props file is not being read properly. Set the values in the file problematically and try its seen to work.

Thanks and Regards
sibi


Askar Akhmerov wrote:try to check port number.
as long as I understand 2810 is a port number of some node(on my installation it's the port number of the app server which was created along with installation). Make sure you have deployed your EjB on that node.
2809 - default port
2811, 2812, and so on are the port numbers of the AppSrv's that you have created on your own.

You should look for the correct port number in you admin console.
sandy moh
Greenhorn

Joined: May 11, 2010
Posts: 3
hi All,

Facing the same issue in WAS v7.0 while calling the remote application using iiop port.

Chk the hostname, its coming with full domain name.
Make the entry or username and password in sas.client.properties.

But still facing the same issue.

@ Sibi,

Can you please let me know-

1. Where in java that you put folowing argument:

-Dcom.ibm.CORBA.Debug=true -Dcom.ibm.CORBA.CommTrace=true -Dcom.ibm.CORBA.Debug.Output= client.log

2. Which port name and hostname did you added in sas.client.properties file....is it remote or local machine??

Thanks;
Sandy
Andy Thompson
Greenhorn

Joined: Aug 31, 2010
Posts: 1
on the server locate your serverIndex.xml file, should be in something like:
/opt/IBM/Websphere/appserver/profiles/filenet/config/cells/filenetnodecell/nodes/filenetnode01/serverindex.xml

if you have host names for the host variable i.e. host=FILENETSERVER

do a replace and change these to IP ie host=192.168.0.1 then restart the websphere server.
(backup the file first!!)

There is a bug in whatever version you have and this is a workaround you can download fixpacks for WAS to resolve this properly in the long term.

Hope this helps...

Andy Thompson
Entity Ltd
http://www.entity.co.uk/entity.html
sandy moh
Greenhorn

Joined: May 11, 2010
Posts: 3
thanks Andy, actually the problem was something else and has been resolved. The problem was with the cell name and node name, while installing WAS it was picking the wrong name because of wrong entries in system hosts file.
This is silly but can be very tiring problem to get resolve.
Manpreet Kaur Chandna
Greenhorn

Joined: Aug 11, 2009
Posts: 3
Sibi Joseph wrote:hi Saw the following post
http://www.ecmplace.com/viewtopic.php?f=39&t=9906&start=0

I was experiencing this problem, and after running an ethernet trace found that my WebSphere server was responding with a redirect to itself using it's host name, which was not resolvable from the client.

Once I added the hostname into the <windows>\system32\drivers\etc\hosts file, it worked just fine.

So check to make sure the name ( not ip) that your host thinks it is can be resolved by anybody trying to lookup jndi resources on it.




Thanks a lot for this solution. Worked for me as well.


Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rich Cook
Vy Doan Khoa
Greenhorn

Joined: Jul 08, 2013
Posts: 1
After i add this line to debug -Dcom.ibm.CORBA.Debug=true -Dcom.ibm.CORBA.CommTrace=true -Dcom.ibm.CORBA.Debug.Output=d:\\client.log

The log file has written unknow host so i add host name in the host file window so the problem is resolved

Thanks everyone so much.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JNDI error
 
Similar Threads
calling EJB from another server, very weard problem, please come in really need help
Websphere - Datasource Connection communication failure
Standalone Java EJB client
Datasource lookup on remote Websphere Application Server
JNDI exception