Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

jndi & tomcat ....

Status
Not open for further replies.

iza

Programmer
Apr 4, 2000
1,804
FR
hi :)
if anyone has any idea, i'll be glad to hear them ! i'm stuck !!!!
---
on the server side, i start my name server (jndi) and my app, everything is going fine
on the client side, i start tomcat, fine ... i have some servlets and ejb, fine ... one of the servlet then tries to access the name server and it crashes :
javax.naming.CommunicationException [Root exception is java.rmi.ConnectException: Connection refused to host: 127.0.0.1;]
---
what is weird is :
* when i run server & client on the same machine, everything is going fine
* i'm sure the name server is correctly listening (netstat and telnet told me !)
* i'm sure the naming.factory.initial and naming.provider.url are correctly set ...
* all my policy files grant all accesses to everyone (....... i shouldn't !)
---
so WHY does this servlet try to access localhost (127.0.0.1) instead of accessing its provider.url ??? why do i get an access denied on my own machine ???

i've double-double-double checked the web.xml and server.xml files ....

please help !!! any advice appreciated :))))

 
Hi,

The most possible reason for that is because you forgot to change the url of your html, jsp, servlets etc.

For example, within your html or jsp or servlets, you might forgot to change from to the appropriate url

Although the naming.provider.url might be set, you might have missed it out on some other portions of the codes, which maybe you forgot to edit/set. If you are certain that you have set all of them, another thing is are they working properly??

Since you encountered the error
javax.naming.CommunicationException [Root exception is
java.rmi.ConnectException: Connection refused to host: 127.0.0.1;]
this shows that somewhere in your codes you are still connecting to yourself so of course when running this program on the same pc, it will definately work.

So maybe you might want to do a find on 'localhost' or '127.0.0.1' in your codes to prevent you missing out any parts of the program.

Hope this helps,
Leon If you need additional help, you can email to me at zaoliang@hotmail.com I don't guaranty that I will be able to solve your problems but I will try my best :)
 
ok, sorry i didn't post earlier : the problem is not solved, but i know where it comes from. Leon, thank you very much for your help, but i had tripled checked those and they were correct (i've spend days looking for these values in any file on my machine!!!!). The problem is with my unix machine, because when i use the server on any other machine, and the client on any other one (not the same as the server tho !), it all works perfectly well. Now if i move either the client or the server on my machine, then i've got bunches of access denied (to myself !!! i mean, to localhost whereas i ask to connect to another host) - but those are linked to a unix misconfiguration problem i think ...
anyway, thanx again Leon :]
and i'll try to let you know when it is really solved (even if it'd go better on the linux forum ;-)) - for my needs, it IS solved, as it's perfectly working on any machine but mine !!!
 
Question that may solve your problem. If your servlet is unable to load/find a property file (that contains the server IP address, does your servlet default to local host?

Cheers :)
 
thanx drit, but still, no .. it didn't come from any servlet or jsp, it was about user's id in unix file system ... tricky !!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top