4 Replies Latest reply on Sep 11, 2002 1:58 PM by Mark Bennett

    JBoss3.0 JNDI lookup gives unexpected block data ??

    Dan Connelly Newbie

      I am very new to JBoss. I have been running Sun's J2EE RI Rlease 1.3.1.

      I am running boss-3.0.0RC2 on Red Hat Linux 7.1 (dual processor PII) and Sun's JDK 1.4.0 for Linux.

      JBoss comes up whistle-clean using the jboss_init_redhat.sh script (although I do see why RHL requires a special launch).

      When I run a simple client, I will get a strange error on my first attempt to access the JNDI ENC.

      Note, I do get the InitialContext OK. I set NameService sysprops on the command line.

      But when I do the following lookup

      Object env = initial.lookup("java:comp/env");

      ... then I get:
      javax.naming.CommunicationException: unexpected block data. Root exception is java.io.StreamCorruptedException: unexpected block data

      I found that when I use telnet to look at port 1099, then I was getting disconnected by the Linux host (explicitly). Same behavior on localhost as from a Solaris machine telneting to the JBoss host.

      I changed "jboss-service.xml" so that the Naming Service runs on 1098, and changed the sysprop for the client accordingly. Same result on running the client, but the telnet no longer says disconnected by host (explicitly).

      This nameService port change is the ONLY change I have made to the default setup.

      The telnet does give me some strange output when I connect to 1098. I believe that this normal, based on FAQ examples. Then the telnet does return to my Linux prompt. In other words, it does disconnect, but it no longer says so for the operation on port 1098. This difference is probably not significant.

      I am too new to JBoss to know if the telnet behavior is entirely as expected.

      When I check the MBean View for


      then I do see "env" in the "java:comp" namespace of the MEJB bean, but not in "java:" namespace (of what?) nor the Global JNDI namespace.

      My current suspicions are focused on JDK 1.4.0 socket management on RHL, but I have no other indications of problems in this area. (I do not want to have to go back to JDK 1.3.1 if I can avoid it.)

      Any other ideas???

      Dan Connelly
      South Burlington, Vermont

        • 1. Re: JBoss3.0 JNDI lookup gives unexpected block data ??
          Dan Connelly Newbie

          Replying to myself here:

          You shouldn't use JDK 1.4.0 on RHL 7.1 for JBoss3.0.

          My unfounded hunch was right. I switched downlevel from JDK 1.4.0 to JDK 1.3.1_03 and the strange exception went away.

          Now I just get NameNotFoundException in the client, which is reasonable if not exactly what I wanted.

          BTW: In my original post, I meant to say that I do NOT see why RHL requires a special launch.

          Still don't.

          So, OK, that's the work-around.

          Whose bug is this that the JBoss NamingService does not handle its socket correctly if one runs JDK 1.4.0 on RHL 7.1. My guess is that its a Sun bug. Does anyone know if its reported.

          And it is quite the showstopper for JBoss, so a big warning should be posted here. (I certainly didn't see one when I was trying to scope out the problem.)

          Dan Connelly
          South Burlington, Vermont

          • 2. Re: JBoss3.0 JNDI lookup gives unexpected block data ??
            Adrian Brock Master

            Not sure about the 1.4 behaviour.

            The java: namespace for inside the same VM.
            The java:comp is for inside the deployed component (jar).
            NameNotFoundException is what I would expect from
            a client.

            The redhat init script is maintained for the
            automated testsuite. It runs everynight on a redhat box.
            You should be able to use run.sh


            • 3. Re: JBoss3.0 JNDI lookup gives unexpected block data ??
              Richard Newbie

              Does anyone know more about this?

              I'm getting the same problem,

              [java] Got context
              [java] javax.naming.CommunicationException: unexpected block data
              [Root exception is java.io.StreamCorruptedException: unexpected block data]

              but there are features of Java 1.4 I need, so I can't afford to simple roll back to 1.3.......???

              Help most appreciated,


              p.s - JBoss 3.0.0, Redhat 7.2, Java 1.4.0

              • 4. Re: JBoss3.0 JNDI lookup gives unexpected block data ??
                Mark Bennett Newbie

                Has anyone managed to solve this problem? I have jdk 1.4 installed with JBoss 3.0.2 and am still having this problem. Is there anyway to run JVM 1.4 with JBoss?