File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JBoss/WildFly and the fly likes CMP EJB Creation with id generated by an independent class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "CMP EJB Creation with id generated by an independent class" Watch "CMP EJB Creation with id generated by an independent class" New topic
Author

CMP EJB Creation with id generated by an independent class

adrian mills
Ranch Hand

Joined: Dec 09, 2004
Posts: 63
Hi All,
I have a HospitalBean which is called from a HospitalManagerBean which is a SessionBean.

The Manager code is as follows
public HospitalData addHospital(HospitalData hospitalData) throws EJBException,RemoteException{
HospitalData newHospitalData = new HospitalData();

try {
System.out.println("Debug in HospitalManager 1********");
InitialContext initialContext = new InitialContext();
System.out.println("Debug in HospitalManager 2********");
HospitalHome hospitalHome = (HospitalHome) initialContext.lookup(JNDINames.Hospital_Home);
System.out.println("Debug in HospitalManager 3********");
Hospital hospital = hospitalHome.create(hospitalData);
System.out.println("$$$$$$$Created Hospital$$$$$$$$$$$");
System.out.println("Hospital Primary Key" + hospital.getPrimaryKey().toString());
newHospitalData = hospital.getHospitalData();

return newHospitalData;
} catch (NamingException ne) {
throw new EJBException(ne.getMessage());
} catch (CreateException ce) {
throw new EJBException(ce.getMessage());
}
}

The Hospital Entity Bean is as follows
public abstract class HospitalEJB implements EntityBean {

private EntityContext context;
public Long hospitalid;
public String hospitalname;

public void ejbLoad() throws EJBException, RemoteException {

}
public void ejbActivate() throws EJBException, RemoteException {

}

public Long ejbCreate(HospitalData hospitalData) throws CreateException{
Long myid = new Long(UniqueIdGenerator.getId());
System.out.println("My id generated ====== "+myid);
this.hospitalid = myid;
System.out.println("My id generated ====== "+this.hospitalid);
System.out.println("Came in ejbCreate method of HospitalEJB");

this.hospitalname = hospitalData.getHospitalname();
return null;

}

public void ejbPostCreate(HospitalData hospitalData)throws CreateException,RemoteException{
System.out.println("$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$");
System.out.println("Came in EJB POSTCreate of HospitalEJB");
System.out.println("$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$");

}

public void ejbRemove()
throws RemoveException, RemoteException, EJBException {

}

public void setEntityContext(EntityContext context)
throws EJBException, RemoteException {

}

public void unsetEntityContext() throws EJBException, RemoteException {


}

public void ejbPassivate() throws EJBException, RemoteException {

}

public void ejbStore() throws EJBException, RemoteException {

}





/**
* @return
*/
public abstract Long getHospitalid();

/**
* @return
*/
public abstract String getHospitalname();

/**
* @param long1
*/
public abstract void setHospitalid(Long long1);

/**
* @param string
*/
public abstract void setHospitalname(String string);


public HospitalData getHospitalData(){
System.out.println("Came in get hospital data");
System.out.println("In Get method of HospitalEJB"+this.hospitalid);
System.out.println("In Get method of HospitalEJB"+this.hospitalname);

HospitalData hospitalData = new HospitalData();
hospitalData.setHospitalid(this.hospitalid);
hospitalData.setHospitalname(this.hospitalname);
System.out.println("In Get method of HospitalEJB"+hospitalData.getHospitalid());
System.out.println("In Get method of HospitalEJB"+hospitalData.getHospitalname());
return hospitalData;
}


public void setHospitalData(HospitalData hospitalData){
System.out.println("In Set method of HospitalEJB" + hospitalData.getHospitalname());
this.hospitalname = hospitalData.getHospitalname();
}

}


The bean is deployed properly.The tables are also created but when I run the application it gives the following error:

18:27:12,093 ERROR [LogInterceptor] TransactionRolledbackException in method: public abstract com.cygnet.medina.Hospital.Hospital com.cygnet.medina.Hospital.HospitalHome.create(com.cygnet.medina.Hospital.HospitalData) throws javax.ejb.CreateException,java.rmi.RemoteException, causedBy:
javax.ejb.EJBException: getGeneratedKeys returned an empty ResultSet
at org.jboss.ejb.plugins.cmp.jdbc.keygen.JDBCMySQLCreateCommand.executeInsert(JDBCMySQLCreateCommand.java:87)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractCreateCommand.performInsert(JDBCAbstractCreateCommand.java:308)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractCreateCommand.execute(JDBCAbstractCreateCommand.java:138)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.createEntity(JDBCStoreManager.java:572)
at org.jboss.ejb.plugins.CMPPersistenceManager.createEntity(CMPPersistenceManager.java:222)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.createEntity(CachedConnectionInterceptor.java:266)
at org.jboss.ejb.EntityContainer.createHome(EntityContainer.java:766)
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)

A 0 is entered in the hospitalid field and no value is entered in the hospital name field.

Here is my ejb-jar.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar>
<enterprise-beans>
<session>
<ejb-name>UserManager</ejb-name>
<home>com.cygnet.medina.UserManager.UserManagerHome</home>
<remote>com.cygnet.medina.UserManager.UserManager</remote>
<ejb-class>com.cygnet.medina.UserManager.UserManagerEJB</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>

<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>UserManager</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>


<session>
<ejb-name>HospitalManager</ejb-name>
<home>com.cygnet.medina.HospitalManager.HospitalManagerHome</home>
<remote>com.cygnet.medina.HospitalManager.HospitalManager</remote>
<ejb-class>com.cygnet.medina.HospitalManager.HospitalManagerEJB</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>

<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>HospitalManager</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>

<entity>
<ejb-name>AnesthesiaUser</ejb-name>
<home>com.cygnet.medina.user.AnesthesiaUserHome</home>
<remote>com.cygnet.medina.user.AnesthesiaUser</remote>
<ejb-class>com.cygnet.medina.user.AnesthesiaUserEJB</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Long</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>AnesthesiaUser</abstract-schema-name>
<cmp-field>
<field-name>userid</field-name>
<column-name>userid</column-name>
</cmp-field>
<cmp-field>
<field-name>username</field-name>
<column-name>username</column-name>
</cmp-field>
<cmp-field>
<field-name>password</field-name>
<column-name>password</column-name>
</cmp-field>
<cmp-field>
<field-name>usertype</field-name>
<column-name>usertype</column-name>
</cmp-field>
<cmp-field>
<field-name>createddate</field-name>
<column-name>createddate</column-name>
</cmp-field>
<cmp-field>
<field-name>updateddate</field-name>
<column-name>updateddate</column-name>
</cmp-field>
<primkey-field>userid</primkey-field>
<query>
<query-method>
<method-name>findByUsername</method-name>
<method-params>
<method-param>java.lang.String</method-param>
</method-params>
</query-method>
<ejb-ql></ejb-ql>
</query>

</entity>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>AnesthesiaUser</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>


<entity>
<ejb-name>Hospital</ejb-name>
<home>com.cygnet.medina.Hospital.HospitalHome</home>
<remote>com.cygnet.medina.Hospital.Hospital</remote>
<ejb-class>com.cygnet.medina.Hospital.HospitalEJB</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Long</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>Hospital</abstract-schema-name>
<cmp-field>
<field-name>hospitalid</field-name>
<column-name>hospitalid</column-name>
</cmp-field>
<cmp-field>
<field-name>hospitalname</field-name>
<column-name>hospitalname</column-name>
</cmp-field>
<primkey-field>hospitalid</primkey-field>
</entity>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>Hospital</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>


</enterprise-beans>
</ejb-jar>

Can anyone tell me what the problem is.I am struggling with it for the past 2 days.
Also FYI I am using Jboss 4.0.2 and MySQL 4.1.13 database
Ken Loh
Ranch Hand

Joined: Feb 16, 2005
Posts: 190
Hi Adrian,

Would it be possible for you to resubmit your codes in their original format with indentations and all ? It's 3:00 am where I live and reading your codes which all left-aligned is certainly an uphill task.

Thanks,
Ken
adrian mills
Ranch Hand

Joined: Dec 09, 2004
Posts: 63
Sorry Ken,
I am resubmitting the code I hope this is formatted properly.


This is my HospitalManagerEJB used to look up the Hospital EJB.


package com.cygnet.medina.HospitalManager;

import java.rmi.RemoteException;

import javax.ejb.CreateException;
import javax.ejb.EJBException;
import javax.ejb.SessionBean;
import javax.ejb.SessionContext;
import javax.naming.InitialContext;
import javax.naming.NamingException;

import com.cygnet.medina.Hospital.Hospital;
import com.cygnet.medina.Hospital.HospitalData;
import com.cygnet.medina.Hospital.HospitalHome;
import com.cygnet.medina.user.UserData;
import com.cygnet.medina.util.JNDINames;


public class HospitalManagerEJB implements SessionBean {

private SessionContext ctx;

public void ejbCreate() {
//do nothing
}

public void ejbRemove() {
}

public void ejbActivate() {
}

public void ejbPassivate() {
}

public void setSessionContext(SessionContext sessionContext) {
ctx = sessionContext;
}

public HospitalData addHospital(HospitalData hospitalData)
throws EJBException, RemoteException {
HospitalData newHospitalData = new HospitalData();

try {
System.out.println("Debug in HospitalManager 1********");
InitialContext initialContext = new InitialContext();
System.out.println("Debug in HospitalManager 2********");
HospitalHome hospitalHome =
(HospitalHome) initialContext.lookup(JNDINames.Hospital_Home);
System.out.println("Debug in HospitalManager 3********");
Hospital hospital = hospitalHome.create(hospitalData);
System.out.println("$$$$$$$Created Hospital$$$$$$$$$$$");
System.out.println(
"Hospital Primary Key" + hospital.getPrimaryKey().toString());
newHospitalData = hospital.getHospitalData();

return newHospitalData;
} catch (NamingException ne) {
throw new EJBException(ne.getMessage());
} catch (CreateException ce) {
throw new EJBException(ce.getMessage());
}
}

}


This is my HospitalEJB.java used to enter data in the MySQL database

package com.cygnet.medina.Hospital;

import java.rmi.RemoteException;

import javax.ejb.CreateException;
import javax.ejb.EJBException;
import javax.ejb.EntityBean;
import javax.ejb.EntityContext;
import javax.ejb.RemoveException;
import com.cygnet.medina.util.UniqueIdGenerator;

public abstract class HospitalEJB implements EntityBean {

private EntityContext context;
public Long hospitalid;
public String hospitalname;

public void ejbLoad() throws EJBException, RemoteException {

}
public void ejbActivate() throws EJBException, RemoteException {

}

public Long ejbCreate(HospitalData hospitalData) throws CreateException {
Long myid = new Long(UniqueIdGenerator.getId());
System.out.println("My id generated ====== " + myid);
this.hospitalid = myid;
System.out.println("My id generated ====== " + this.hospitalid);
System.out.println("Came in ejbCreate method of HospitalEJB");

this.hospitalname = hospitalData.getHospitalname();
return null;

}

public void ejbPostCreate(HospitalData hospitalData)
throws CreateException, RemoteException {
System.out.println("$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$");
System.out.println("Came in EJB POSTCreate of HospitalEJB");
System.out.println("$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$");

}

public void ejbRemove()
throws RemoveException, RemoteException, EJBException {

}

public void setEntityContext(EntityContext context)
throws EJBException, RemoteException {

}

public void unsetEntityContext() throws EJBException, RemoteException {

}

public void ejbPassivate() throws EJBException, RemoteException {

}

public void ejbStore() throws EJBException, RemoteException {

}

/**
* @return
*/
public abstract Long getHospitalid();

/**
* @return
*/
public abstract String getHospitalname();

/**
* @param long1
*/
public abstract void setHospitalid(Long long1);

/**
* @param string
*/
public abstract void setHospitalname(String string);

public HospitalData getHospitalData() {
System.out.println("Came in get hospital data");
System.out.println("In Get method of HospitalEJB" + this.hospitalid);
System.out.println("In Get method of HospitalEJB" + this.hospitalname);

HospitalData hospitalData = new HospitalData();
hospitalData.setHospitalid(this.hospitalid);
hospitalData.setHospitalname(this.hospitalname);
System.out.println(
"In Get method of HospitalEJB" + hospitalData.getHospitalid());
System.out.println(
"In Get method of HospitalEJB" + hospitalData.getHospitalname());
return hospitalData;
}

public void setHospitalData(HospitalData hospitalData) {
System.out.println(
"In Set method of HospitalEJB" + hospitalData.getHospitalname());
this.hospitalname = hospitalData.getHospitalname();
}

}


Here is my Uniqueid generator class

public class UniqueIdGenerator {



private static long id = System.currentTimeMillis();

public static synchronized long getId() {
return id++;

}

}


Here are my configuration files

Here is the ejb-jar.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar>
<enterprise-beans>
<session>
<ejb-name>UserManager</ejb-name>
<home>com.cygnet.medina.UserManager.UserManagerHome</home>
<remote>com.cygnet.medina.UserManager.UserManager</remote>
<ejb-class>com.cygnet.medina.UserManager.UserManagerEJB</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>

<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>UserManager</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>


<session>
<ejb-name>HospitalManager</ejb-name>
<home>com.cygnet.medina.HospitalManager.HospitalManagerHome</home>
<remote>com.cygnet.medina.HospitalManager.HospitalManager</remote>
<ejb-class>com.cygnet.medina.HospitalManager.HospitalManagerEJB</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>

<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>HospitalManager</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>

<entity>
<ejb-name>AnesthesiaUser</ejb-name>
<home>com.cygnet.medina.user.AnesthesiaUserHome</home>
<remote>com.cygnet.medina.user.AnesthesiaUser</remote>
<ejb-class>com.cygnet.medina.user.AnesthesiaUserEJB</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Long</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>AnesthesiaUser</abstract-schema-name>
<cmp-field>
<field-name>userid</field-name>
<column-name>userid</column-name>
</cmp-field>
<cmp-field>
<field-name>username</field-name>
<column-name>username</column-name>
</cmp-field>
<cmp-field>
<field-name>password</field-name>
<column-name>password</column-name>
</cmp-field>
<cmp-field>
<field-name>usertype</field-name>
<column-name>usertype</column-name>
</cmp-field>
<cmp-field>
<field-name>createddate</field-name>
<column-name>createddate</column-name>
</cmp-field>
<cmp-field>
<field-name>updateddate</field-name>
<column-name>updateddate</column-name>
</cmp-field>
<primkey-field>userid</primkey-field>
<query>
<query-method>
<method-name>findByUsername</method-name>
<method-params>
<method-param>java.lang.String</method-param>
</method-params>
</query-method>
<ejb-ql></ejb-ql>
</query>

</entity>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>AnesthesiaUser</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
<!-- Added -->

<entity>
<ejb-name>Hospital</ejb-name>
<home>com.cygnet.medina.Hospital.HospitalHome</home>
<remote>com.cygnet.medina.Hospital.Hospital</remote>
<ejb-class>com.cygnet.medina.Hospital.HospitalEJB</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Long</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>Hospital</abstract-schema-name>
<cmp-field>
<field-name>hospitalid</field-name>
<column-name>hospitalid</column-name>
</cmp-field>
<cmp-field>
<field-name>hospitalname</field-name>
<column-name>hospitalname</column-name>
</cmp-field>
<primkey-field>hospitalid</primkey-field>
</entity>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>Hospital</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
<!-- End -->

</enterprise-beans>
</ejb-jar>

Here is my jbosscmp-jdbc.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jbosscmp-jdbc PUBLIC
"-//JBoss//DTD JBOSSCMP-JDBC 4.0//EN"
"http://www.jboss.org/j2ee/dtd/jbosscmp-jdbc_4_0.dtd">

<!-- ===================================================================== -->
<!-- -->
<!-- Standard JBossCMP-JDBC Configuration -->
<!-- -->
<!-- ===================================================================== -->

<!-- $Id: standardjbosscmp-jdbc.xml,v 1.84.2.6 2005/01/26 18:51:35 starksm Exp $ -->

<jbosscmp-jdbc>

<defaults>
<datasource>java:/MySqlDS</datasource>
<!-- <datasource-mapping>MySQL</datasource-mapping> -->
<create-table>true</create-table>
<remove-table>true</remove-table>
<read-only>false</read-only>
<read-time-out>300000</read-time-out>
<row-locking>false</row-locking>
<pk-constraint>true</pk-constraint>
<fk-constraint>false</fk-constraint>
</defaults>

<enterprise-beans>
<entity>
<ejb-name>AnesthesiaUser</ejb-name>
<pk-constraint>false</pk-constraint>
<table-name>AnesthesiaUser</table-name>
<cmp-field>
<field-name>userid</field-name>
<column-name>userid</column-name>
<jdbc-type>BIGINT</jdbc-type>
<sql-type>BIGINT</sql-type>
</cmp-field>
<cmp-field>
<field-name>username</field-name>
<column-name>username</column-name>
<jdbc-type>VARCHAR</jdbc-type>
<sql-type>VARCHAR(50)</sql-type>
</cmp-field>
<cmp-field>
<field-name>password</field-name>
<column-name>password</column-name>
<jdbc-type>VARCHAR</jdbc-type>
<sql-type>VARCHAR(50)</sql-type>
</cmp-field>
<cmp-field>
<field-name>usertype</field-name>
<column-name>usertype</column-name>
<jdbc-type>VARCHAR</jdbc-type>
<sql-type>VARCHAR(50)</sql-type>
</cmp-field>
<cmp-field>
<field-name>createddate</field-name>
<column-name>createddate</column-name>
<jdbc-type>TIMESTAMP</jdbc-type>
<sql-type>DATETIME</sql-type>
</cmp-field>
<cmp-field>
<field-name>updateddate</field-name>
<column-name>updateddate</column-name>
<jdbc-type>TIMESTAMP</jdbc-type>
<sql-type>DATETIME</sql-type>
</cmp-field>
<query>
<query-method>
<method-name>findByUsername</method-name>
<method-params>
<method-param>java.lang.String</method-param>
</method-params>
</query-method>
<jboss-ql><![CDATA[
SELECT OBJECT(u)
FROM AnesthesiaUser u
WHERE u.username = ?1 ]]></jboss-ql>
</query>
<entity-command name="mysql-get-generated-keys"/>



</entity>

<!-- Added -->
<entity>
<ejb-name>Hospital</ejb-name>
<pk-constraint>false</pk-constraint>
<table-name>Hospital</table-name>
<cmp-field>
<field-name>hospitalid</field-name>
<column-name>hospitalid</column-name>
<jdbc-type>BIGINT</jdbc-type>
<sql-type>BIGINT</sql-type>
</cmp-field>
<cmp-field>
<field-name>hospitalname</field-name>
<column-name>hospitalname</column-name>
<jdbc-type>VARCHAR</jdbc-type>
<sql-type>VARCHAR(50)</sql-type>
</cmp-field>
<entity-command name="mysql-get-generated-keys"/>

</entity>

<!-- End -->
</enterprise-beans>

</jbosscmp-jdbc>


I am getting the following error.
The bean is deployed properly.The tables are also created but when I run the application it gives the following error:

18:27:12,093 ERROR [LogInterceptor] TransactionRolledbackException in method: public abstract com.cygnet.medina.Hospital.Hospital com.cygnet.medina.Hospital.HospitalHome.create(com.cygnet.medina.Hospital.HospitalData) throws javax.ejb.CreateException,java.rmi.RemoteException, causedBy:
javax.ejb.EJBException: getGeneratedKeys returned an empty ResultSet
at org.jboss.ejb.plugins.cmp.jdbc.keygen.JDBCMySQLCreateCommand.executeInsert(JDBCMySQLCreateCommand.java:87)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractCreateCommand.performInsert(JDBCAbstractCreateCommand.java:308)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractCreateCommand.execute(JDBCAbstractCreateCommand.java:138)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.createEntity(JDBCStoreManager.java:572)
at org.jboss.ejb.plugins.CMPPersistenceManager.createEntity(CMPPersistenceManager.java:222)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.createEntity(CachedConnectionInterceptor.java:266)
at org.jboss.ejb.EntityContainer.createHome(EntityContainer.java:766)
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)

A 0 is entered in the hospitalid field and no value is entered in the hospital name field.


I hope the indentation is properly shown on the forum.
I am struggling with this set up for the past 2 days.

I am using JBoss 4.0.2 and MySQL 4.1.13 as I had told you earlier.

Thanks
With Regards
Adrian
adrian mills
Ranch Hand

Joined: Dec 09, 2004
Posts: 63
Oops the indentation does not remain when I submit my question ken.
I am sorry can u tell me how do we enable this.
I am really sorry to cause this inconvinience to you.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: CMP EJB Creation with id generated by an independent class