I am creating and deploying a CMP Entity Bean into jBoss using the
example in chapter 7 of Mastering EJBs, 2nd edition (Roman). I am
getting error messages (see below). What am I doing wrong?
Here's what's in the jar:
remote interface: Product.class - contains getters and setters that
throw RemoteException
home interface: ProductHome.class - a create method and 7 finder methods
local interface: ProductLocal.class - contains getters and setters
local home interface: ProductLocalHome.class - a create method and 7
finder methods
primary key class: ProductPK - a wrapper class for the primary key
the entity bean: ProductBean.class -
*the class is abstract (and implements EntityBean of course)
*EntityContexts is the only member variable
*an empty constructor is declared with no arguments
*the getters and setters are declared as abstract methods
*the container methods: ejbActivate(), ejbRemove(), ejbPassivate(),
ejbLoad(), ejbStore(), setEntityContext(EntityContext ctx),
unsetEntityContext(EntityContext ctx) are all included, but of course
have no database calls (its CMP)
*ejbCreate is included with appropriate calls to the abstract set
methods and returning the primary key class
*ejbPostCreate is included
ejb-jar.xml - lists the enterprise-beans/entity values: home, remove,
local-home, local, ejb-class, persistence, prim-key-class,
re-entrant, cmp-version (2.x), abstract-schema-name, and all 4
cmp-field entries. Also lists 6 queries including their ejb-ql
declared as CDATA. Also includes the assembly-descriptor.
jaws.xml - lists the (tested and working) MySQL datasource as
java:/MySQLDS and typmapping of mySQL. After default entity I have
created a new entity named Product, table name product, and done O-R
mapping of all 4 fields to the 4 database columns. The rest of the
file is the default type-mappings list from standardjaws.xml (which
of course include mySQL).
jboss.xml - under enterprise-beans I have an entity entry, named by
the bean name (Product) and the jndi-name: product/Product and
configuration name set to Standard CMP EntityBean. resource-managers
is empty, enforce-ejb-restrictions is false, and
container-configurations are just the usual from standardjboss.xml
HERE'S THE ERROR:
When I copy the jar to the deploy directory, I get two errors:
[ERROR,ContainerFactory]
Bean : Product
Section: 9.2.2
Warning: The entity bean class must not be defined as abstract.
[ERROR,ContainerFactory]
Bean : Product
Section: 9.2.2
Warning: The entity bean class must define a public constructor that
takes no arguments.
The first one makes no sense. According to the book I'm studying, the
whole way a CMP Entity Bean works is that you declare it as abstract
so that the container can subclass it and provide its own code for
the subclassed abstract methods.
I don't understand the second error because my abstract entity bean
includes the constructor exactly as suggested in the manual, and
matching the above requirements:
public ProductBean() {}
Can anyone see what I have missed? Or does jBoss handle CMP's
differently than the expectations of the practise CMP entity bean I
am setting up from chapter 7 of Mastering EJB's?
Thanks very much,
David Gadd
http://www.gaddzeit.com
--
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development