3 Replies Latest reply on Oct 25, 2005 5:42 PM by evrim ulu

    How to create Session Beans??

    Marcus Schmidke Newbie

      Hello!

      Excuse me, this seems to be a very very silly question, but I really didn't manage to find an answer for a couple of hours now ...

      How can a session bean method create and return another session bean?

      @Stateful class B {
      ...
      }

      @Stateless class A {
      ...
      public B createB() {
      ...
      }
      }


      I've simply tried "return new B();", but this cleary was no good idea. Instead of creating a remote reference, JBoss serializes the entire bean and sends it to the client. Not that good.

      What's wrong? Surely there is only missing a secret Annotation. But I did not find any example!

      Can anyone help?

      Thank you very much!

      Marcus.