• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

create Bean Class Instance Command

 
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!
 
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>
    Bookmark Topic Watch Topic
  • New Topic