3 Replies Latest reply on Sep 9, 2004 6:11 PM by darranl

    JBoss container didn't invoke ejbCreate method:

    ranjithpillai

      Hello All,
      I have deployed a stateless EJB into JBoss-3.2.3 application server. Though the bean got deployed successfully, during JBoss startup JBoss container neither create an instance of this EJB nor called ejbCreate method . But when I invoked a public method of this ejb, JBoss container created an instance at that time and invoked the public method, but again ejbCreate is neglected. Why this behaviour? or did I miss any configuration settings?

      Any response will be deeply appreciated.
      Thanks,
      Ranjith Pillai.

        • 1. Re: JBoss container didn't invoke ejbCreate method:
          darranl

          The ejb container can decide when it wants to instantiate your bean, some application servers could decide to do this on startup but this is not a requirement.

          JBoss instantiates the bean when it is required and keeps the instantiated bean in a pool, beans are then used from the pool to meet the demand from the clients.

          Are you really sure that ejbCreate was not called at some point between instantiation and the business method being called? I would be surprised if JBoss has missed calling ejbCreate()

          • 2. Re: JBoss container didn't invoke ejbCreate method:
            ranjithpillai

            Hello,
            I have a constructor, ejbCreate and myMethod in my EJB. I put System.out.println in constructor as well as ejbCreate method. When I called myMethod, JBoss prints out System.out.println which I gave in constructor and invoked myMethod. It didn't print what I gave in ejbCreate method.

            Did I miss any configuration or settings?

            Thanks,
            Ranjith Pillai

            • 3. Re: JBoss container didn't invoke ejbCreate method:
              darranl

              Could you post the code for your bean implementation, I have never seen JBoss miss a call to ejbCreate.

              Also could you post enough of the output from the console window from before the constructor is called to after the business method is called without removing enything else that might be in the middle.