0 Replies Latest reply on Aug 1, 2002 8:29 AM by Eoin Curran

    Cannot authenticate user / Option unsupported by protocol

    Eoin Curran Newbie

      Running JBoss server on J2SE 1.4, client on J2SE 1.3.1_01, both on windows 2000, same machine. I get the java.net.SocketException: Option unsupported by protocol: connect as the cause of 'Cannot authenticate user'.

      Debugging into it, It seems to be related to this bug on sun:
      http://developer.java.sun.com/developer/bugParade/bugs/4661534.html
      which they say is closed, fixed for 'hopper'? Is this codename for some upcoming release of the J2SE?

      The problem is that InetAddress objects serialized from j2se 1.4 have family=1, which corresponds to IPv4 on j2se 1.4, but on j2se 1.3 inetAddress objects only work with family=2.

      I've put a workaround into my OILServerIL, which seems to get it working for both 1.3 and 1.4 clients:

      private void createConnection()
      throws Exception
      {
      try
      {
      socket = new Socket(addr, port);
      }
      catch(SocketException e)
      {
      if(e.getMessage().startsWith("Option unsupported by protocol: connect"))
      {
      String address=addr.getHostAddress();
      if(address==null) address=addr.getHostName();
      InetAddress fixed = InetAddress.getByName(address);
      Logger.getLogger(getClass()).warn("Got Option unsupported by protocol: connect for address. Trying fix for jdk 1.4 interop. "+address+" -> "+fixed);
      socket = new Socket(fixed, port);
      }
      else
      {
      throw e;
      }
      }
      .
      .
      .
      }

      It's not very satisfactory, but it fixes the problem for me.

      Does anyone know anything about this? Should I submit this as a bug in jboss, java, or what?

      eoin.