3 Replies Latest reply on Sep 6, 2002 12:15 AM by arich

    Command Pattern in JBoss3.0???

    arich

      Hi,
      I try to use Command Pattern on JBoss3.0(run java lightweight Command object in a CommandRunner Session Bean).
      But there are some Exceptions like NoClassDefFoundException
      or IncompatibleClassChangeError...
      (I even cant send the Command Object to my Session Bean)
      but the class is packaged in xx.jar

      Is there anythinge or classpath i dont set...
      or EJB(or JBoss) cant use Command Pattern ???

      Have any one use Command Pattern?


      thanks

      arich

        • 1. Re: Command Pattern in JBoss3.0???
          minamoto

          >But there are some Exceptions like >NoClassDefFoundException
          >or IncompatibleClassChangeError...

          When and where did you get those errors?
          At server console, your xx.jar may be imcomplete.
          At client console, you may need to add command classes to your client classpath.

          I recommend that you clean up the deploy directory and check the jar contents again.

          With JBoss 3, an obsolete package may be used if it's loaded earlier than a newer package.

          >Have any one use Command Pattern?

          I have no problem at all.

          Miki

          • 2. Re: Command Pattern in JBoss3.0???
            minamoto

            Last night I played around with my ejb program using the command pattern.

            Changing the package structure, I reproduced your situation easily.
            I thought you didn't add command classes to your ejb jar.

            In your case, a command class is a subclass of the abstract Command class.
            And the CommandRunner session bean only knows the Command class but doesn't know it's subclasses.

            I think the RMI dynamic stub loading works when an unknown server class is transferred to the client but doesn't in the other direction.

            I found the related page on EJB Design Pattern book (p.24). In a one of trade-offs, it states "Command Server ejb-jar tightly coupled command beans and other EJBs".

            You may add command classes to a war or an ear file.

            Miki

            • 3. Re: Command Pattern in JBoss3.0???
              arich

              minamoto,
              thank for your reply
              and i will try to put my subCommand class to war next time(because i have more other problem on JBoss now)

              Now i use ByteArrayStream to serialize my Command to server:-)
              and it work... maybe it will waste some execute time...


              and thanks for your help again :-)

              arich