Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem in accessing a distributed EJB through a servlet

 
mara thamizhan
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all,
I'm a trying to call a stateless session bean which has its home and component interfaces, which prints the name it receives from the servlet client.
I'm trying to access a remote server EJB beans, which has been registered with JNDI & when deploying the EJB beans onto the Jboss server which operates in localhost: 8081 it has shown




This is my servlet which is there in tomcat container which runs in localhost:8082 to access the bean:



Then in my tomcat container console it's showing exception like:



Could anyone encountered this problem & could anyone say how to fix this issue.
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
java.net.SocketTimeoutException


It appears your client is unable to talk with the server. Do you have a firewall ? Are you able to access the JBoss console ? Does the target JBoss server have your bean deployed ?

You will have to change your name. namma thamizhan translates to our tamilian and it is not a valid name.
 
Marco Ehrentreich
best scout
Bartender
Posts: 1294
IntelliJ IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Namma,

it seems to be a problem with the JNDI lookup. Are you using JBoss with a default configuration? Then localhost and port 8081 would be wrong. The default options for the JNDI lookup with JBoss are as follows:

You should first try to set the port to 1099 in your properties for this is the default port a client (here: your servlet) has to use to get a JNDI lookup from JBoss.

Marco
 
Anoopp Thakur
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to access a remote server EJB beans...


And also as it is a remote server, in place of localhost it should be

 
mara thamizhan
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when i change the properties url to jnp:localhost

again it's throwing Unmarshal exception

The full stack trace of the exception is:
 
mara thamizhan
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've found out the solution and i need to install my webapplication in a tomcat directory without whitepsaces i.e. c:\program files\apache\.....\tomcat5.5 is the cause of these exception.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic