Tomcat client + JBOSS server

Regarding to JBossIDE-Tutorial.pdf I worked through this tutorial and I reached my first EJB

Now Im trying to deploy the application as clent and server using Tomcat 5.5 and JBOSS 4.2.0GA ( on two different host placed in the same lan )

I have the same project on the JBOSS and the new one in Tomcat

In Tomcat I copied only the interfaces and servlet because I want to call the EJB method from Tomcat application container

I modified the code of ComputeServlet.java in this way

Hashtable env =new Hashtable();

env.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingCotextFactory");

env.put(Context.PROVIDER_URL,"jnp://192.168.0.13:1099");

Context context =new InitialContext(env);

Object ref = context.lookup("ejb/Fibo");

home = (FiboHome) PortableRemoteObject.narrow(ref, FiboHome.class);

during the lookup method I reach the same error message

--javax.naming.CommunicationException: Could not obtain connection to any of these urls: 192.168.0.13:1099 and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] [Root exception is javax.naming.CommunicationException: Failed to connect to server 192.168.0.13:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server 192.168.0.13:1099 [Root exception is java.net.ConnectException: Connection refused: connect]]]

it seams that the Tomcat client doesnt reach the JBOSS server

I wonder if anyone could give me any suggestion

Many many thanks

[1778 byte] By [fausto_minottia] at [2007-11-27 11:05:51]
# 1

check whether jboss server is started?

HimSSSa at 2007-7-29 13:11:25 > top of Java-index,Core,Core APIs...
# 2

ok many thanks

now all work properly

the real problem was the ip address of JBOSS Server

I found interesting faq at this link

-> http://wiki.jboss.org/wiki/Wiki.jsp?page=JBoss42FAQ

Frequently Asked Questions about the JBoss4.2 Release

1. . Why can't I connect to the server remotely? All the services appear to be bound to localhost only.

* That's correct before 4.2.0.GA jboss always bound to the any address "0.0.0.0". You wouldn't believe how many people would put unprotected instances of JBoss on the internet, or even on their own local LAN. Now you have to explicitly choose to do that, so it takes some thinking about before you revert to the old default behaviour with the "-b' option of jboss. e.g.

./run.sh -b 0.0.0.0

For Windows, use

run.bat -b 0.0.0.0

fausto_minottia at 2007-7-29 13:11:25 > top of Java-index,Core,Core APIs...