2 Replies Latest reply on Feb 19, 2003 9:42 AM by Brad Leupen

    calling a findAll on CMP fails

    floyd lewis Newbie

      Hi,
      I used a tutorial to create a simple CMP. The following code fails at the findAll. I am using mySQL as the db with mysql-connector-java-2.0.14.OS is redhat 8.0. I am running JBoss from Eclipse and using the Genuitec plugin.

      PartgroupLocalHome thePartGroupHome = PartgroupUtil.getLocalHome();
      thePartGroups = thePartGroupHome.findAll();
      Iterator theIterator = thePartGroups.iterator();

      I have noticed in JBoss start up I get the following stdout..

      13:40:13,768 INFO [MainDeployer] Starting deployment of package: file:/usr/local/jboss/jboss-3.0.6/server/default/deploy/HelloServer.jar
      13:40:14,970 INFO [EJBDeployer]
      Bean : Partgroup
      Section: 9.2.2
      Warning: The entity bean class must not be defined as abstract.

      13:40:14,998 INFO [EJBDeployer]
      Bean : Part
      Section: 9.2.2
      Warning: The entity bean class must not be defined as abstract.

      13:40:15,380 INFO [EjbModule] Creating
      13:40:15,490 INFO [EjbModule] Deploying Partgroup
      13:40:15,916 INFO [EjbModule] Deploying Part
      13:40:16,022 INFO [EjbModule] Deploying HelloWorldServer
      13:40:17,310 INFO [JDBCInitCommand] Table 'Part' already exists
      13:40:17,401 INFO [JDBCInitCommand] Table 'Partgroup' already exists.


      The error I get when iI debug through the finAll method is....

      14:07:50,318 ERROR [LogInterceptor] TransactionRolledbackLocalException, causedBy:
      java.lang.InstantiationException
      at sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(InstantiationExceptionConstructorAccessorImpl.java:30)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
      at java.lang.Class.newInstance0(Class.java:296)
      at java.lang.Class.newInstance(Class.java:249)
      at org.jboss.ejb.plugins.jaws.JAWSPersistenceManager.createBeanClassInstance(JAWSPersistenceManager.java:165)
      at org.jboss.ejb.plugins.CMPPersistenceManager.createBeanClassInstance(CMPPersistenceManager.java:165)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.createBeanClassInstance(CachedConnectionInterceptor.java:251)
      at org.jboss.ejb.EntityContainer.createBeanClassInstance(EntityContainer.java:294)
      at org.jboss.ejb.plugins.AbstractInstancePool.get(AbstractInstancePool.java:184)
      at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:78)
      at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:79)
      at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:44)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:111)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:228)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:62)
      at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:105)
      at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:129)
      at org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:487)
      at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invokeHome(BaseLocalContainerInvoker.java:230)
      at org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:110)
      at $Proxy25.findAll(Unknown Source)
      at org.gems.tutorialserver.HelloServerBean.getPartCatalog(HelloServerBean.java:46)
      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.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:660)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:77)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:107)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:228)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:92)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:204)
      at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:313)
      at org.jboss.ejb.Container.invoke(Container.java:712)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
      at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:382)
      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 sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
      at sun.rmi.transport.Transport$1.run(Transport.java:148)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
      at java.lang.Thread.run(Thread.java:536)


      I suspect JBoss (3-0-6) does not understand the EJB 2.0 abstract class spec for the bean class.
      PS: The DTD appears fine in the ejb-jar.xml...

      <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems,Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">

      Can someone help.

      Thanks,

      Floyd