Hi Dain,

I tried this one with replacing createUser with create() in the
home interface. It calls ejbHomeCreate() instead of ejbCreate()
that was expected ! This seems to contradict section 10.6.4.
of the specification. Is it possible that this has been mixed up with
fulfilling
10.6.6 which define ejbHome<METHOD> methods for
every home method ?

And until now I always could use a "UserPK" instead of a Long ?
I did specify <prim-key-class/> as UserPK so I expected this
would also work, as this was so in CMP 1.1. (Section 10.8.2)

The bean will work when I replace the abstract accessors with
concrete ones and switch back to CMP 1.1 deployment descriptors,
but my idea is to learn this CMP 2.0 stuff.

Wei-ju

----- Original Message -----
From: "Dain Sundstrom" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 10, 2001 6:06 AM
Subject: RE: [JBoss-user] CMP 2.0 again (another bug ?)


> Wei-ju,
>
> The methods should be ejbCreate(...) and ejbPostCreate(...), and your
> primary key must be an object not a primative, EJB 2.0 pfd3 section 9.8
> (i.e., Long instead of long).
>
> Dain
>
>
> > -----Original Message-----
> > From: Wei-ju Wu [mailto:[EMAIL PROTECTED]]
> > Sent: Sunday, July 08, 2001 5:09 AM
> > To: [EMAIL PROTECTED]
> > Subject: [JBoss-user] CMP 2.0 again (another bug ?)
> >
> >
> > Hi,
> >
> > I managed to deploy my EJB 2.0 entity beans successfully -
> > at first sight. When I try to invoke a createX() it will crash with
> > a NullPointerException in the JDVCCMP2xFieldBridge, line 112,
> > method getFieldState().
> >
> > I found out that the EntityEnterpriseContext argument to this
> > method is null.
> >
> > Is it possible that my settings are wrong ? I am using
> > the current CVS sources.
> >
> > Thanx,
> >
> > Wei-ju Wu
> >
> > The code for the bean class does the following:
> >
> > // .......
> >
> > public abstract String getUserName();
> > public abstract void setUserName(String name);
> >
> > public abstract long getID();
> > public abstract void setID(long id);
> >
> > public UserPK ejbHomeCreateUser(long id, String name)
> >   throws CreateException
> > {
> >     // initialize cmp fields
> >       setID(id);
> >       setUserName(name);
> >     return null;
> > }
> >
> > // ......
> >
> > My jbosscmp-jdbc - descriptor:
> >
> > ........
> >
> > <datasource>java:/InterBaseDS</datasource>
> > <type-mapping>InterBase</type-mapping>
> > <debug>true</debug>
> >
> > ......
> >
> > <enterprise-beans>
> >   <entity>
> >     <ejb-name>User</ejb-name>
> >     <table-name>USERS</table-name>
> >     <create-table>false</create-table>
> >     <cmp-field>
> >       <field-name>iD</field-name>
> >       <column-name>ID</column-name>
> >     </cmp-field>
> >     <cmp-field>
> >       <field-name>userName</field-name>
> >       <column-name>USERNAME</column-name>
> >     </cmp-field>
> >   </entity>
> > </enterprise-beans>
> > ......
> >
> >
> >
> > _______________________________________________
> > JBoss-user mailing list
> > [EMAIL PROTECTED]
> > http://lists.sourceforge.net/lists/listinfo/jboss-user
> >
>
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-user


_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to