InterestClient timeing out
xmanjava00 Mar 22, 2002 12:54 AMsorry if this has been answered / asked before but I can't find it anywhere.. here's the deal, I modified InterestClient.java so I could run it from another machine besided the JBoss server. below is a copy of the modified source
package ejbtest;
import javax.naming.*;
import javax.rmi.PortableRemoteObject;
import javax.ejb.*;
import java.util.*;
import org.jboss.docs.interest.Interest;
import org.jboss.docs.interest.InterestHome;
class InterestClient
{
public static void main(String[] args)
{
try
{
Properties env = new Properties();
env.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
env.setProperty(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
env.setProperty(Context.PROVIDER_URL, "jnp://scrumptioushiphop.com:1099");
System.out.println("debug_1");
// Get a naming context
System.out.println("Got context");
// Get a reference to the Interest Bean
System.err.println(jndiContext.toString());
Object ref = jndiContext.lookup("interest/Interest");
System.out.println("Got reference");
// Get a reference from this to the Bean's Home interface
InterestHome home = (InterestHome)
PortableRemoteObject.narrow(ref, InterestHome.class);
// Create an Interest object from the Home interface
Interest interest = home.create();
// call the calculateCompoundInterest() method to do the calculation
System.out.println("Interest on 1000 units, at 10% per period, compounded over 2 periods is:");
System.out.println(interest.calculateCompoundInterest(1000, 0.10, 2));
}
catch(Exception e)
{
System.out.println(e.toString());
}
}
}
I'm running JBoss-2.4.4_Tomcat-4.0.1 as the server ...
I'm getting this error
[java] Got context
[java] javax.naming.CommunicationException [Root exception is java.rmi.ConnectIOException: Exception creating connection to: scrumptioushiphop.com; nested exception is:
[java] java.net.NoRouteToHostException: Connection timed out]
however I get information comming in when doing a tcpdump on port 1099, my question is simply why does it time out? why does it fail on jndiContext.lookup(env); and time out, why dosn't it look up the Interest bean? Someone please help, I have been trying to debug this for a week now,... much thanks.