• Post Reply Bookmark Topic Watch Topic
  • New Topic

create Bean Class Instance Command  RSS feed

 
guenter krannich
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
my first steps with Entity EJBs in JBoss produced this:
RuntimeException in method: public abstract gk.office.ejb.Buchung gk.office.ejb.BuchungHome.create() throws java.rmi.RemoteException,javax.ejb.CreateException:
java.lang.IllegalStateException: createBeanClassInstanceCommand == null
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.createBeanClassInstance(JDBCStoreManager.java:560)

Any suggestions where to start fixing the problem?
Thanks for your help!
 
Valentin Tanase
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guenter,

You might like sharing some code with us.
Regards.
 
guenter krannich
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm sorry, I thought the error message would already point to a possible source of trouble! But I got over that hurdle by now, just to be confronted with the next:

Could not create entity:java.sql.SQLException: Try to insert null into a non-nullable column: column: ID table: BUCHUNG in statement [INSERT INTO BUCHUNG (id, datum, text, konto, betrag) VALUES (?, ?, ?, ?, ?)]

I don't see where the null-value of id comes from : any suggestion appreciated!

what I did:
===========

the client:
----------

String id = "0001";
String datum = "datum";
String betrag = "betrag";
String konto = "konto";
String text = "text";
Buchung buchung = buchungHome.create(id,datum ,betrag ,konto ,text);

the home:
--------
public interface BuchungHome extends EJBHome
{
public Buchung create(String newId, String newDatum, String newText, String newBetrag, String newKonto) throws RemoteException, CreateException;

the bean:
--------

public abstract class BuchungBean implements EntityBean {

private InitialContext ctx;
private String id;
private String datum;
private String text;
private String betrag;
private String konto;

public String ejbCreate(String newId, String newDatum, String newText, String newBetrag, String newKonto) throws CreateException {
id = newId;
datum = newDatum;
text = newText;
betrag = newBetrag;
konto = newKonto;
Debug.print("BuchungBean ejbCreate mit id= "+id);
return null;
}

the ejb-jar:
--------------
<entity>
<ejb-name>Buchung</ejb-name>
<home>gk.office.ejb.BuchungHome</home>
<remote>gk.office.ejb.Buchung</remote>
<ejb-class>gk.office.ejb.BuchungBean</ejb-class>
<transaction-type>Container</transaction-type>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.String</prim-key-class>
<reentrant>false</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>BuchungBean</abstract-schema-name>
<cmp-field>
<field-name>id</field-name>
</cmp-field>
<cmp-field>
<field-name>datum</field-name>
</cmp-field>
<cmp-field>
<field-name>text</field-name>
</cmp-field>
<cmp-field>
<field-name>konto</field-name>
</cmp-field>
<cmp-field>
<field-name>betrag</field-name>
</cmp-field>
<primkey-field>id</primkey-field>
<security-identity>
<use-caller-identity/>
</security-identity>
<query>
<query-method>
<method-name>findByKonto</method-name>
<method-params>
<method-param>java.lang.String</method-param>
</method-params>
</query-method>
<ejb-ql> select object(c) from BuchungBean c where c.konto=
?1</ejb-ql>
</query>
</entity>
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!