10 Replies Latest reply on Sep 16, 2002 1:01 AM by muradhak

    Problem only with ENtity Bean!!!

    muradhak

      Hi,
      I am facing the following error while deplying an entity bean. The rest of session Beans are deployed successfully. The problem persit with all the EntityBeans.

      Error
      ==========================================================
      Home Method public abstract com.cisco.nm.qpm.server.inventory.ejb.SourceDestPairRemote
      com.cisco.nm.qpm.server.inventory.ejb.SourceDestPairHome.create com.cisco.nm.qpm.server.inventory.SourceDestPairValueObject) throws java.rmi.RemoteException,javax.ejb.CreateException not implemented in bean class class com.cisco.nm.qpm.server.inventory.ejb.SourceDestPairBean looking for method named: ejbCreate

      ==========================================================

      The same jar deploys successfully with JOnAs.

      The above said ejbCreate method is present in the bean. Still dont understand why it persist and only with EntityBeans.

      Reagrds
      Muraly.

        • 1. Re: Problem only with ENtity Bean!!!

          make sure for each create method in your home interface you have implemented corresponding ejbCreate and ejbPostCreate methods in your entity bean implementation

          • 2. Re: Problem only with ENtity Bean!!!
            muradhak

            Hi Juha,
            Thanks....:)

            But do I need to have ejbPostCreate for EACH create in home interface.
            can you please give me an outline of code.

            • 3. Re: Problem only with ENtity Bean!!!
              alexb

              Hi,

              To answer your question on ejbPostCreate. You need to match every ejbCreate with a ejbPostCreate a small example

              public Integer ejbCreate(Integer id) throws CreateException
              {
              this.setId(id);
              return null;
              }

              public void ejbPostCreate(Integer id){
              }

              hope this helps
              Alex

              • 4. Re: Problem only with ENtity Bean!!!
                muradhak

                Hi Alex

                EJB
                ===

                public MyPK ejbCreate(MyValueObject vlan) throws RemoteException, CreateException {
                // My Code.
                }

                public void ejbPostCreate(BaseValueObject baseData) throws RemoteException, CreateException{
                logger.debug("SourceDestPairBean: ejbPostCreate( baseData ) called.");
                }

                Error
                =====

                ERROR 12/Sep/2002 20:21:39 [main] (Logger.java:185): plugins.BMPPersistenceManager - Home Method public abstract com.MyRemote com.MyHome.create(com.MyValueObject) throws java.rmi.RemoteException,javax.ejb.CreateException not implemented in bean class class com.MtBean looking for method named: ejbCreate

                What is happening here???!!!

                • 5. Re: Problem only with ENtity Bean!!!
                  muradhak

                  Hi Alex

                  EJB
                  ===

                  public MyPK ejbCreate(MyValueObject vlan) throws RemoteException, CreateException {
                  // My Code.
                  }

                  public void ejbPostCreate(BaseValueObject baseData) throws RemoteException, CreateException{
                  logger.debug("SourceDestPairBean: ejbPostCreate( baseData ) called.");
                  }

                  Error
                  =====

                  ERROR 12/Sep/2002 20:21:39 [main] (Logger.java:185): plugins.BMPPersistenceManager - Home Method public abstract com.MyRemote com.MyHome.create(com.MyValueObject) throws java.rmi.RemoteException,javax.ejb.CreateException not implemented in bean class class com.MtBean looking for method named: ejbCreate

                  What is happening here???!!!

                  • 6. Re: Problem only with ENtity Bean!!!
                    muradhak

                    Hi Alex

                    EJB
                    ===

                    public MyPK ejbCreate(MyValueObject vlan) throws RemoteException, CreateException {
                    // My Code.
                    }

                    public void ejbPostCreate(BaseValueObject baseData) throws RemoteException, CreateException{
                    logger.debug("SourceDestPairBean: ejbPostCreate( baseData ) called.");
                    }

                    Error
                    =====

                    ERROR 12/Sep/2002 20:21:39 [main] (Logger.java:185): plugins.BMPPersistenceManager - Home Method public abstract com.MyRemote com.MyHome.create(com.MyValueObject) throws java.rmi.RemoteException,javax.ejb.CreateException not implemented in bean class class com.MtBean looking for method named: ejbCreate

                    What is happening here???!!!

                    • 7. Re: Problem only with ENtity Bean!!!
                      muradhak

                      Hi Alex

                      EJB
                      ===

                      public MyPK ejbCreate(MyValueObject vlan) throws RemoteException, CreateException {
                      // My Code.
                      }

                      public void ejbPostCreate(MyObject baseData) throws RemoteException, CreateException{
                      // My Code.
                      }

                      Error
                      =====

                      ERROR 12/Sep/2002 20:21:39 [main] (Logger.java:185): plugins.BMPPersistenceManager - Home Method public abstract com.MyRemote com.MyHome.create(com.MyValueObject) throws java.rmi.RemoteException,javax.ejb.CreateException not implemented in bean class class com.MyBean looking for method named: ejbCreate

                      What is happening here???!!!

                      • 8. Re: Problem only with ENtity Bean!!!
                        muradhak

                        Hi,
                        Sorry for the continous thread....
                        When I pasted it I got the error page....
                        SO I had to try 3-4 times...
                        I never thought all would have got updated...

                        Regards
                        Muraly

                        • 9. Re: Problem only with ENtity Bean!!!
                          alexb

                          Muraly,

                          Look at this example

                          public Integer ejbCreate(Integer id) throws CreateException
                          {
                          this.setId(id);
                          return null;
                          }
                          public void ejbPostCreate(Integer id)
                          {
                          }

                          This is in the bean class so try losing the RemoteException and keep the ejbPostCreate just like this example No createException or Remote exception can you also post your xml files i will try to look at them
                          hope this helps

                          • 10. Re: Problem only with ENtity Bean!!!
                            muradhak

                            Hi Alex,
                            Thanks a ton...
                            The code snippet was really helpfulll. Problem with my bean was the argument was not of same type. ie in the bean I had the recieving argument as the parent class(e.g. Object). But I think JBoss doesn't allow this. But this works fine with JOnAs.

                            Anyway now the prob is solved....:)

                            Cheers
                            Muraly