4 Replies Latest reply on Sep 11, 2002 1:48 PM by runningboy

    Error : java.io.StreamCorruptedException: Type code out of r

    bdturne

      Hi,

      I have a Web / EJB app which deploys fine on our development server, but when I moved it to our UAT server, I have been unable to look up one of the EJBs.

      The probelm comes from the initialContext.lookup("MyBean") command, which throws the following error :

      java.io.StreamCorruptedException: Type code out of range, is 125
      at java.io.ObjectInputStream.peekCode(Unknown Source)
      at java.io.ObjectInputStream.readObject(Unknown Source)
      at java.io.ObjectInputStream.readObject(Unknown Source)
      at java.io.ObjectInputStream.inputObject(Unknown Source)
      at java.io.ObjectInputStream.readObject(Unknown Source)
      at java.io.ObjectInputStream.readObject(Unknown Source)
      at java.rmi.MarshalledObject.get(Unknown Source)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java, Compiled Code)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:333)
      at javax.naming.InitialContext.lookup(InitialContext.java:349)
      at com.db.grt.webif.admin.server.LogManager.init(LogManager.java, Compiled Code)
      at com.db.grt.webif.admin.server.MainServlet.init(MainServlet.java:28)
      at javax.servlet.GenericServlet.init(GenericServlet.java:258)
      at allaire.jrun.servlet.JRunServletLoader.loadServletInstance(JRunServletLoader.java, Compiled Code)
      at allaire.jrun.servlet.JRunServletLoader.loadServletInstance(JRunServletLoader.java, Compiled Code)
      at allaire.jrun.servlet.JRunServletLoader.loadServlet(JRunServletLoader.java, Compiled Code)
      at allaire.jrun.servlet.JRunSE.getServletReference(JRunSE.java, Compiled Code)
      at allaire.jrun.servlet.JRunSE.runServlet(JRunSE.java, Compiled Code)
      at allaire.jrun.servlet.JRunRequestDispatcher.forward(JRunRequestDispatcher.java, Compiled Code)
      at allaire.jrun.servlet.JRunSE.service(JRunSE.java, Compiled Code)
      at allaire.jrun.servlet.JRunSE.service(JRunSE.java, Compiled Code)
      at allaire.jrun.servlet.JvmContext.dispatch(JvmContext.java, Compiled Code)
      at allaire.jrun.jrpp.ProxyEndpoint.run(ProxyEndpoint.java, Compiled Code)
      at allaire.jrun.ThreadPool.run(ThreadPool.java, Compiled Code)
      at allaire.jrun.WorkerThread.run(WorkerThread.java, Compiled Code)


      Not sure what I can offer in the way of information here - the code is quite involved - but essentially this part of the code is doing a simple bean lookup which works on a different deployment instance.

      So I think I am after one of two things here :
      * Firstly has anyone else experienced this problem before, and if so, did you find a way of fixing it ?
      * Secondly, does anyone know what a "Type code out of range, is 125" error might be referring to ?

      Thanks in advance,
      Ben

        • 1. Re: Error : java.io.StreamCorruptedException: Type code out
          bdturne

          As is always the way - I have managed to solve my problem today (from another forum ! Gasp...)

          It appeared to be linked to my installation of Jboss running from the Java 1.3.0-C java.exe file (which caused the error). We downgraded to the 1.2.2 JDK (as is running on our other working server) and everything works fine.

          I think this is either linked to JBoss not liking the 1.3.0-C java.exe OR to the fact my servlet engine (JRun) was running from the 1.2.2 java.exe

          Either way, that's how I got it working, and would still be interested to know exactly WHAT this problem is, and hope this post might still help others with this problem !

          Cheers,
          Ben

          • 2. Re: Error : java.io.StreamCorruptedException: Type code out
            jwkaltz

            I have witnessed this too as I am sure others have (hey, I think this qualifies as a FAQ ;) )

            As far as I know, the problem is the way Java 1.2 talks over the network is not compatible with the way Java 1.3 does it; at least for those components that the JBoss communication uses.
            This means that you must compile and execute your client code with the same Java level as your server code. Either both with 1.2, or both with 1.3 or upwards. But 1.3 is the recommended one and it definitely works; you just have to be sure that your JBoss client also uses 1.3 !

            • 3. Re: Error : java.io.StreamCorruptedException: Type code out
              pascalpt

              I encountered the exact same problem in another application., not running on JBoss, with a 1.1 VM talking to 1.3 VM.

              The problem was due to the fact that serialization did not handle strings longer than 64k prior to 1.3 so a new type code was created in 1.3 for long strings that older vms can't recognize and choke on.

              • 4. Re: Error : java.io.StreamCorruptedException: Type code out
                runningboy

                Has anyone seen a problem like this while running JVM 1.4 on Linux?