I'm still having severe problems with ConnectionException using jBoss Beta Prod 1.  I've done some research also as described below.

Here are the results so far:

Test 1: TestBeanClient (the one in the JBoss install)
===============
Local on Win NT   -Works OK
Local on Linux  - Works OK
Remote from WinNT to Linux:    - ConnectionException at step 2  (See Note below)
Remote from WinNT to Solaris:  - ConnectionException at step 2 (See Note below)
Remote from WinNT to WinNT: - ConnectionException at step 2 (See Note below)

Test 2: Our Account Bean
===============
Local on Win NT - OK
Local on Linus - ConnectionException during upcast (see Note below)
Remote from WinNT to WinNt: ConnectionException during upcast (see Note below)

Research:
===========
1. According to a recent message in comp.lang.java.programmer:
2000-10-20 Deja.com: Solution for: RMI "Connection refused to host" error
the java.net.ConnectionException can occur if the RMI server uses "localhost" as its hostname.  The writer suggests using:
-Djava.rmi.server.hostname=myhostname

I tried entering this on the java command when starting JBoss, but the results were identical.  Would this have any effect on JBoss's RMI identity?
 

2. I also tried checking the client to ensure that it has permission to create a connection using:
import java.rmi.*;

public class CkCon {
   public static void main (String[] args) {
     String conn=args[0];
     int port = new Integer(args[1]).intValue();
    try {
     RMISecurityManager sm = new RMISecurityManager();
     System.out.println("Checking connect");
     sm.checkConnect(conn, port);
     System.out.println("Returned OK");
    } catch (Exception e) {
      System.out.println("Exception: "+e);
    }
    System.out.println("Done");
  } // End main
}

This program runs with no errors.

3.  Changes to java.policy

Originally, I added the following line to <jdk13>\jre\lib\security\java.policy on all clients and servers:
        permission java.net.SocketPermission "*", "connect";

I haven't tried taking this line out.  Should I?

4.  In our account client, (doesn't affect the JBoss client) I changed the upcast to look like this:

       System.out.println("Account EJB Test: getting accountEJB ref");

        Object ref = (Account) jndiContext.lookup("accountEJB");

Is there a different upcast that should be used?

Any help greatly appreciated!!

Many thanks!

Rich Katz

Note  Errors received on TestBeanClient:
============================...
Welcome to the test Suite v1.2
_____________________________________________

1- Trying the context...OK

Test Stateless Bean
===================

2- Looking up the home nextgen.StatelessSession...javax.naming.ServiceUnavailableException: Connection refused: no furth
er information.  Root exception is java.net.ConnectException: Connection refused: no further information
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:312)
        at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:125)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:112)
        at java.net.Socket.<init>(Socket.java:273)
        at java.net.Socket.<init>(Socket.java:100)
        at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:88)
        at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:617)
        at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:272)
        at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:265)
        at javax.naming.InitialContext.lookup(InitialContext.java:350)
        at org.jboss.zol.testbean.client.EjbossClient.doSomeTesting(EjbossClient.java:75)
        at org.jboss.zol.testbean.client.EjbossClient.main(EjbossClient.java:783)
 

The error when testing our account bean looks exactly llike the one above. It fails when doing the upcast.
  -- -------------------------------------------------------------- To subscribe: [EMAIL PROTECTED] To unsubscribe: [EMAIL PROTECTED] Problems?: [EMAIL PROTECTED]

Reply via email to