6 Replies Latest reply on Nov 8, 2001 5:01 AM by tom

    Examples from Richard Monson-Haefel JavaEnterpriseBeans3rd E

    saint1

      I can deploy the Entity-Bean, but after i start the
      Clientprogram i get the following errormessage:

      java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
      javax.transaction.TransactionRolledbackException: Could not instantiate bean; nested exception is:
      java.lang.InstantiationException: com.titan.cabin.CabinBean; nested exception is:
      java.rmi.ServerException: Could not instantiate bean; nested exception is:
      java.lang.InstantiationException: com.titan.cabin.CabinBean

      javax.transaction.TransactionRolledbackException: Could not instantiate bean; nested exception is:
      java.lang.InstantiationException: com.titan.cabin.CabinBean; nested exception is:
      java.rmi.ServerException: Could not instantiate bean; nested exception is:
      java.lang.InstantiationException: com.titan.cabin.CabinBean

      java.rmi.ServerException: Could not instantiate bean; nested exception is:
      java.lang.InstantiationException: com.titan.cabin.CabinBean

      java.lang.InstantiationException: com.titan.cabin.CabinBean

      at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:245)

      at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:220)

      at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)

      at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker_Stub.invokeHome(Unknown Source)

      at org.jboss.ejb.plugins.jrmp.interfaces.HomeProxy.invokeHome(HomeProxy.java:258)

      at org.jboss.ejb.plugins.jrmp.interfaces.HomeProxy.invoke(HomeProxy.java:182)

      at $Proxy0.create(Unknown Source)

      at com.titan.cabin.Client_1.main(Client_1.java:43)

      Please help!!!!!

      Pierre

        • 1. Re: Examples from Richard Monson-Haefel JavaEnterpriseBeans3
          colinthorburn

          Richard, post more detail please - ejbCreate etc

          • 2. Re: Examples from Richard Monson-Haefel JavaEnterpriseBeans3
            saint1

            I use the EJB2.0 standard. The Bean class is defined as abstract. Here is the Bean code

            public abstract class CabinBean implements EntityBean {

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

            public void ejbPostCreate(Integer id) {}

            public abstract void setId(Integer id);
            public abstract int getId();

            public abstract void setShipId(int ship);
            public abstract int getShipId();

            public abstract void setName(String name);
            public abstract String getName();

            public abstract void setBedCount(int bc);
            public abstract int getBedCount();

            as jndi Name i used the ejb-name. In this case it is CabinEJB. In the book he used CabinHomeRemote.

            Pierre

            • 3. Re: Examples from Richard Monson-Haefel JavaEnterpriseBeans3
              colinthorburn

              Hmm, not familiar with EJB2.0 (yet!) or this book. I think CMP definition for the bean is out of whack with the table you are trying to insert into.

              • 4. Re: Examples from Richard Monson-Haefel JavaEnterpriseBeans3
                saint1

                i try to instanstiate the bean. But he cant nest it.
                Perhaps jboss doesnt support EJB2.0 yet.

                I got some other messages from Jboss

                [Verifier]
                Bean : CabinEJB
                Section: 9.2.2
                Warning: The entity bean class must not be defined as abstract.

                [Verifier]
                Bean : CabinEJB
                Section: 9.2.2
                Warning: The entity bean class must define a public constructor that takes no ar
                guments.

                [Verifier]
                Bean : CabinEJB
                Section: 9.4.7.1
                Warning: The primkey-field element must name a public field in the bean implemen
                tation class.

                [Container factory] Deploying CabinEJB
                [JAWS] Table 'CabinEJB' already exists
                [ContainerManagement] Initializing
                [ContainerManagement] Initialized
                [ContainerManagement] Starting
                [ContainerManagement] Started

                Pierre

                • 5. Re: Examples from Richard Monson-Haefel JavaEnterpriseBeans3
                  lafr

                  which version of jboss are you running on ?
                  Seems to be a version which is not able to run ejb2.0 beans.

                  I use the current cvs-version which works fine so far.

                  • 6. Re: Examples from Richard Monson-Haefel JavaEnterpriseBeans3
                    tom

                    Hi,

                    you can deploy the examples, but only the 1.1 version as long as you are running the "normal" distribution.

                    I don't have any experience with the developer version which seems to be able to run the EJB 2.0 examples.

                    Thomas