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

Reply via email to