3 Replies Latest reply on Mar 4, 2006 11:26 AM by Jérémy Goldschmidt

    Error storing objects with ejb3 entity

    Jérémy Goldschmidt Newbie


      I have trouble when trying to store objects with ejb3 entities. I follow the trailer (http://trailblazer.demo.jboss.com/EJB3Trail/) which is a very good support. However when I deploy my ear I have the following errors:

      FATAL [PersistenceXmlLoader] ejb3essaiPerst JTA

      and when I use the EntityManager to persist an object, an exception is throwned:

      00:09:25,872 WARN [JDBCExceptionReporter] SQL Error: -22, SQLState: S0002
      00:09:25,872 ERROR [JDBCExceptionReporter] Table not found in statement [insert into t_tech (prenom, nom) values (?, ?)]
      00:09:25,872 ERROR [AbstractFlushingEventListener] Could not synchronize database state with session
      org.hibernate.exception.SQLGrammarException: could not insert: [fr.aulnette.essai.ejb3.entity.TechnicienBOBean]
      at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:65)
      at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)

      Caused by: java.sql.SQLException: Table not found in statement [insert into t_tech (prenom, nom) values (?, ?)]
      at org.hsqldb.jdbc.Util.throwError(Unknown Source)

      In fact the table creation doesn't appear anymore in the hsqldb log but I don't know why.

      The Entity bean code:

      public class TechnicienBOBean implements Serializable {

      String nom;
      String prenom;
      //SiteBOBean site;

      public String getNom() {
      return nom;

      public void setNom(String nom) {
      this.nom = nom;

      The Session Stateless bean code:

      public class TechnicienBSBean implements TechnicienBSI, TechnicienRemoteBSI {
      protected EntityManager em;

      public void storeTechnicienInDB(String nom, String prenom) {
      TechnicienBOBean technicienEntity = new TechnicienBOBean();

      The persistence.xml file is embedded into the META-INF directory of my ejb findTechnicien-ejb.jar:

      <persistence-unit name="ejb3essaiPerst">

      The application.xml file is embedded into the META-INF directory of my ear:



      Some help would be very appreciated because i have no more ideas.

      thank you,

      Jeremy Goldschmidt