0 Replies Latest reply on Feb 15, 2005 11:06 AM by Al Morris

    Problem with Entity Bean in JBOSS

    Al Morris Newbie

      Good Morning

      Im having a problem with deploying an Entity bean in JBOSS 3.2.3.
      It's a very simple bean that is compiled in xdoclet, here is the code:
      the code is compile successfully and all the correct deployment descriptors are generated correctly

      /**
       * @version $Revision: 1.9 $ $Date: 2003/09/07 22:08:47 $
       * @author <strong>Al Morris</strong>
       *
       * This entity represents an Article
       *
       * @ejb.bean
       * name="ArticleEJB"
       * displayContent-name="article"
       * type="CMP"
       * cmp-version="2.x"
       * view-type="local"
       * local-jndi-name="nukes/smartstrong/Article"
       * schema="article"
       * primkey-field="id"
       *
       * @ejb.finder
       * signature="org.jboss.nukes.core.ejb.ArticleEJBLocal findByPrimaryKey(java.lang.Integer id)"
       *
       * @ejb.persistence
       * table-name="t_article"
       *
       * @jboss.persistence
       * create-table="false"
       * remove-table="false"
       *
       * @jboss.entity-command
       * name="nukes-entity-command"
       */
      public abstract class ArticleEJB
       implements EntityBean
      {
      
       /**
       * @ejb.create-method
       */
       public Integer ejbCreate(String title, Date creationDate) throws CreateException
       {
       setCreationDate(new Date());
       setTitle(title);
       return null;
       }
      
       /**
       * @param story
       */
       public void ejbPostCreate(String title,Date creationDate)
       { setCreationDate(new Date());
       setTitle(title);
      
       }
      
       /**
       * @ejb.interface-method
       * @ejb.persistence
       * column-name="id"
       * @jboss.persistence
       * auto-increment="true"
       * @jboss.method-attributes
       * read-only="true"
       */
       public abstract Integer getId();
       public abstract void setId(Integer id);
      
      
      
       /**
       * @ejb.interface-method
       * @ejb.persistence
       * column-name="t_creation_date"
       */
       public abstract Date getCreationDate();
      
       /**
       * @ejb.interface-method
       */
       public abstract void setCreationDate(Date creationDate);
      
      
      
       /**
       * @ejb.interface-method
       * @ejb.persistence
       * column-name="t_article_name"
       */
       public abstract String getTitle();
      
       /**
       * @ejb.interface-method
       */
       public abstract void setTitle(String title);
      
       // ejb callbacks ------------------------------------------------------------
      
       public void ejbActivate() { }
       public void ejbPassivate() { }
       public void ejbRemove() { }
       public void setEntityContext(EntityContext entityContext) { System.out.println("Hi");}
       public void unsetEntityContext() { }
       public void ejbLoad() { }
       public void ejbStore() { }
      
       // --------------------------------------------------------------------------
      
      }



      the problem is when i move the ejb into the deploy directory, i get this stack trace.

      org.jboss.deployment.DeploymentException: Could not load class:
       at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCEntityCommandMetaData.<init>(JDBCEntityCommandMetaData.java:61)
       at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCEntityMetaData.<init>(JDBCEntityMetaData.java:782)
       at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCApplicationMetaData.<init>(JDBCApplicationMetaData.java:362)
       at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCXmlFileLoader.load(JDBCXmlFileLoader.java:75)
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadJDBCEntityMetaData(JDBCStoreManager.java:706)
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.initStoreManager(JDBCStoreManager.java:409)
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManager.java:357)
       at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManager.java:152)
       at org.jboss.ejb.EntityContainer.startService(EntityContainer.java:342)
       at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:192)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
       at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:976)
       at $Proxy14.start(Unknown Source)
       at org.jboss.system.ServiceController.start(ServiceController.java:394)
       at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
       at $Proxy152.start(Unknown Source)
       at org.jboss.ejb.EjbModule.startService(EjbModule.java:331)
       at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:192)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
       at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:976)
       at $Proxy14.start(Unknown Source)
       at org.jboss.system.ServiceController.start(ServiceController.java:394)
       at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
       at $Proxy12.start(Unknown Source)
       at org.jboss.ejb.EJBDeployer.start(EJBDeployer.java:544)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:832)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:642)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:605)
       at sun.reflect.GeneratedMethodAccessor22.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
       at $Proxy6.deploy(Unknown Source)
       at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:302)
       at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:476)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:201)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:212)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:191)
      10:46:56,566 WARN [ServiceController] Problem starting service jboss.j2ee:jndiName=nukes/smartstrong/Article,service=EJB
      org.jboss.deployment.DeploymentException: Could not load class:
       at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCEntityCommandMetaData.<init>(JDBCEntityCommandMetaData.java:61)
       at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCEntityMetaData.<init>(JDBCEntityMetaData.java:782)
       at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCApplicationMetaData.<init>(JDBCApplicationMetaData.java:362)
       at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCXmlFileLoader.load(JDBCXmlFileLoader.java:75)
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadJDBCEntityMetaData(JDBCStoreManager.java:706)
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.initStoreManager(JDBCStoreManager.java:409)
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManager.java:357)
       at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManager.java:152)
       at org.jboss.ejb.EntityContainer.startService(EntityContainer.java:342)
       at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:192)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
       at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:976)
       at $Proxy14.start(Unknown Source)
       at org.jboss.system.ServiceController.start(ServiceController.java:394)
       at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
       at $Proxy152.start(Unknown Source)
       at org.jboss.ejb.EjbModule.startService(EjbModule.java:331)
       at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:192)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
       at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:976)
       at $Proxy14.start(Unknown Source)
       at org.jboss.system.ServiceController.start(ServiceController.java:394)
       at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
       at $Proxy12.start(Unknown Source)
       at org.jboss.ejb.EJBDeployer.start(EJBDeployer.java:544)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:832)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:642)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:605)
       at sun.reflect.GeneratedMethodAccessor22.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
       at $Proxy6.deploy(Unknown Source)
       at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:302)
       at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:476)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:201)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:212)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:191)
      10:46:56,757 INFO [EjbModule] Started jboss.j2ee:module=nukes-ss-ejb.jar,service=EjbModule
      10:46:56,757 INFO [EJBDeployer] Deployed: file:/C:/jboss-3.2.3/server/default/nukes/nukes-ss-ejb.jar
      10:46:56,797 INFO [MainDeployer] Deployed package: file:/C:/jboss-3.2.3/server/default/nukes/nukes-ss-ejb.jar
      10:46:56,797 INFO [MainDeployer] Starting deployment of package: file:/C:/jboss-3.2.3/server/default/nukes/nukes-ss-lib.jar
      10:46:56,897 INFO [MainDeployer] Deployed package: file:/C:/jboss-3.2.3/server/default/nukes/nukes-ss-lib.jar
      10:46:56,907 ERROR [URLDeploymentScanner] MBeanException: Exception in MBean operation 'checkIncompleteDeployments()'



      I've also follow the example of other entity beans that i've found (that work fine) and still cannot figure out what the problem is. Please help