Okay I know that there were some typos in my original post, but did everyone
have to ignore them :-)

Just in case any one is wondering about the same issue, how to make the JNP
timeout, here is a follow-up. I have looked at the JBoss and jnp.org code
and this is what I think I have to do to get control jnp connection
timeouts. If someone has a better idea, can correct me, or tell me if I am
on track that would be great!

First, I could switch over to pure RMI, since it has a
sun.rmi.transport.connectionTimeout=10000 variable you can set in the
jndi.properties that it will honor.

I am on a solaris8 station, with a jnp connection to JBoss on another
solaris8 station. It takes 15 minutes for my jnp connections on the client
to die when I pull the network cable from the server. This is really
unacceptable when trying to detect a dead connection for fail over.

It appears that there are two connections to worry about. The connection
that jnp creates to fetch the interface object, and the connection the
interface object has to its remote self. The jnp fetch connection is created
in org.jnp.interfaces.NamingContext. It creates a standard socket:

              Socket s;
            try
                {
                    s = new Socket(host, port);
                }
            catch(IOException e2)
                {
                    NamingException ex = new
ServiceUnavailableException(e2.getMessage());
                    ex.setRootCause(e2);
                    throw ex;
                }
            
It uses this to load a MarshalledObject that is the server. If the server is
not active, timeout will take whatever your system is set-up to handle. The
default solaris8 is 4 minutes. This is really long on a high bandwidth
cluster.

The other connection, the one that the interface object uses to communicate
with its remote object is configurable as the RMIClientSocketFactory in
jboss.xml. 

 <container-configurations>
  <container-configuration>
    <container-name>Standard Stateless SessionBean</container-name>
    <container-invoker-conf>
      <Optimized>true</Optimized>
      <RMIObjectPort>9044</RMIObjectPort>
 
<RMIClientSocketFactory>my.custom.RMIClientSocketFactory</RMIClientSocketFac
tory>
    </container-invoker-conf>
  </container-configuration>
 </container-configurations>

This class will be used by JBoss to create client rmi connections for its
container classes. 

So to make the JNP timeout configurable, it appears that I have to 
1) Modify the org.jnp.interfaces.NamingContext class to use a SocketFactory
that creates sockets with a configurable timeout.
2) Configure jboss.xml to replace the default RMIClientSocketFactory class
with a modified version that will have configurable timeouts.

Am I way over-complicating the issue? Is there a cleaner way of doing this?
If I make these changes to NamingContext, is there a way to get this in the
source tree? Feedback? 

        Thanks,
        Lucas McGregor


-----Original Message-----
From: Lucas McGregor [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 10, 2002 11:30 AM
To: [EMAIL PROTECTED]
Subject: [JBoss-user] JNP Timeout?


Is their a JNP call timeout? And if so, can I set it?

This is what I am doing. I access all my beans via a facade class.

This class knows about all the possible Jboss servers to connect to. If it
gets a RemoteException due to a network problem, it will try the call on
another Jboss server.

So this facade gives me fail over and load balancing between my Jbosses.
When I shut down Jboss1, the facade quickly gets the "connection refused"
and fails over to Jboss2. But when I unplug Jboss1 from the network--all my
calls seem to hang on Jboss1. If I plug Jboss1 back into the network, the
facade picks up right where it left off. So none of my calls fail over. They
just hang.

I suspect that this is because the JNP connections are not timing out. Can
anyone confirm this? Is there a way to set the failed connections to die?

        Thanks,
        Lucas McGregor

_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to