JBoss says bean is not a jbosscmp-jdbc-managed cmp entity
tjclifford Oct 13, 2004 11:41 PMHello:
As part of my own self-education in EJB, I am trying to get
some of Brett McLaughlin's code from
Java Enterprise Applications, Vol I (O'Reilly, 2002)
to work in JBoss.
I have implemented only the Office part of his mySql database,
that part of his bean code, and have tried to implement his
stateless session bean 'SequenceBean' to look up the next key
available to add offices.
I have set up the jbosscmp-jdbc.xml and ejb-jar.xml, I believe,
according to examples I have seen, but I still get the following error
when I deploy the jar file:
-----------------------------------------
22:38:56,971 INFO [EjbModule] Deploying Office
22:38:56,981 INFO [EjbModule] Deploying SequenceBean
22:38:57,351 ERROR [EntityContainer] Starting failed jboss.j2ee:jndiName=Office,
service=EJB
org.jboss.deployment.DeploymentException: Configuration found in jbosscmp-jdbc.x
ml for entity SequenceBean but bean is not a jbosscmp-jdbc-managed cmp entity in
ejb-jar.xml
at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCApplicationMetaData.(JDBCApplicationMetaData.java:358)
at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCXmlFileLoader.load(JDBCXm
lFileLoader.java:75)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadJDBCEntityMetaDat
a(JDBCStoreManager.java:726)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.initStoreManager(JDBC
StoreManager.java:419)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManage
r.java:363)
at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManag
er.java:157)
at org.jboss.ejb.EntityContainer.startService(EntityContainer.java:340)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanS
upport.java:271)
......et. cetera......
-----------------------------------------
when I try to leave out the jbosscmp-ejb.xml file completely,
the jar file deploys without errors, but when I run the client,
it gives me an error that jdbc is not bound:
------------------------------------------
>java com.sample.client.EntityCreator
Clifford IT Services EntityCreator program.
setting security policy...
got InitialContext...
...is: [javax.naming.InitialContext@291aff]
Looking up the Office bean.
got context...
refobj = OfficeHome
create DallasOffice...
Error in EntityCreator: OfficeBean: Error getting primary key value: Sequence Be
an Exception: Error getting JDBC resources: jdbc not bound: jdbc not bound
c:\Dl\Coding\Java\Ejb\Jboss\Db1
>
-------------------------------------------
I can email a zip file with the pertinent files included,
if anyone might be interested in this issue. Maybe it's just
my limited educational resources, but this has me puzzled.
I've checked the JBoss forums and do not see anything
that helps much. A google search does not come up
with much, either.
Thanks for anything that you might point out.
I'm running JBoss v4.0.0RC2, and have tried the same with
RC1, and with JBoss v2.4.2.
I'm running Apache 2.0.48 and Tomcat V5 on the same machine.
Tom C.