• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

remote JNDI lookup fails

 
Heiner Lamprecht
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm rather new to JBoss and Java EE. At the moment, I'm trying to make a remote JNDI lookup. The following code is used in the client to perform the lookup:



If I run this on the host "server", everything works fine. But when I run in on a different host, I get an exception:



What surprises me, is that the client seems to try to connect to localhost, even though the provider URL points to a different maschine. There is no firewall inbetween, I can reach the URL via telnet.

The server is a JBoss 4.2.2GA.

Any idea what's going wrong here?


Thanks,

Heiner
 
John Gregory
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Heiner,

Hi, I'm fairly new, myself. Whenever I do a jndi look-up, I get a
different exception thrown, a NoInitialContextException. I think one
time, I noticed I had placed the jboss jnp.jar file in my netbeans
library and everything seemed to work fine. Since then, I've not
been able to replicate success......

When you built your app, did you place the jar file in your classpath?

John
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Heiner,

Welcome to JavaRanch

How are you starting JBoss? Do you use the -b option with the run.bat(or run.sh) file? Also which operating system are you using?

Also, see if this is of any help.
[ February 26, 2008: Message edited by: Jaikiran Pai ]
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by John Gregory:


Whenever I do a jndi look-up, I get a different exception thrown, a NoInitialContextException.


John,

The NoInitialContextException is because of this, unless the exception stacktrace has some other root cause.
 
Heiner Lamprecht
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jaikirian,

Originally posted by Jaikiran Pai:
How are you starting JBoss? Do you use the -b option with the run.bat(or run.sh) file? Also which operating system are you using?


Sorry, I forgot to mention that I'm using Linux.

Yes, I'm using the -b option. But there was a problem in jboss-service.xml. The IP for port 8083 was hardcoded

Now it works perfectly.

thanks,

Heiner
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic