3 Replies Latest reply on Dec 4, 2005 10:15 AM by tzwoenn

    unexpected block data - fetching EJB3 Remote Interface in JN

    jmont

      Hi there,

      I'm having a problem with JUnit / JBoss 4.0.3SP1 / EJB 3.

      I'm using JUnit to test an application with EJB2 and EJB3 Sessionbeans. When I'm fetching a Session Bean's Remote Interface in the JUnit test class from JNDI i'm getting the following error:

      javax.naming.CommunicationException [Root exception is java.io.StreamCorruptedException: unexpected block data]
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:707)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
       at javax.naming.InitialContext.lookup(InitialContext.java:351)
      


      I have no problems with EJB2..

      Regards
      Joao

        • 1. Re: unexpected block data - fetching EJB3 Remote Interface i
          jmont

          By the way, I'm using non-clustered JBoss (all the threads about this refer something about clustering, but it is not the case)...

          • 2. Re: unexpected block data - fetching EJB3 Remote Interface i
            starksm64

            Create a bug report with the example unit test and ejb3 deployment which demonstrates this.

            http://jira.jboss.com/jira/browse/EJBTHREE

            • 3. Re: unexpected block data - fetching EJB3 Remote Interface i
              tzwoenn

               

              javax.naming.CommunicationException [Root exception is java.io.StreamCorruptedException: unexpected block data]
               at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:707)
               at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
               at javax.naming.InitialContext.lookup(InitialContext.java:351)
              


              I've had a similiar problem, when starting to use ejb3. as far as i remember this happens due to a missing library in classpath of your client application. Please try to add the following libraries:

              compile-time dependencies
              - ejb3-persistence.jar
              - jboss-ejb3x.jar
              - jbossall-client.jar

              runtime dependencies:
              - jboss-ejb3.jar
              - jboss-aspect-library-jdk50.jar

              The last two ones are necessary to be able to make a remote connection to JBoss. I dont remember which one it was, but without one of them i got the exception mentioned above.