1 Reply Latest reply on Oct 28, 2004 11:53 AM by nguyenthehoa

    CMP entity bean works on Jboss 2.2.2, but does not work any

    nguyenthehoa

      Hi All,


      My application have CMP ejb that use MySQL data. The ejbs are ejb 1.0 and ejb1.1, that uses Jaws services from JBOSS to connect to the MySQL database. The configuration works ok on theJBoss 2.2.2. However, now I deploy on the JBoss 2.2.6, the ejbs show STRANG behavious.

      I don't receive sql exception. I receive finder excepition everytime I make a query findByPrimaryKey on the bean. Even, my database is full of data for the entity bean.

      I connect my application to a new database. I reload the application to have the CMP engine to au-create all table again. The tables of my entity beans are not created. But on the log, I saw these logs, which say confusely that table exists:
      ========================
      ....
      16:39:53,304 DEBUG [RegisteredUser] Added findByPrimaryKey query command for home interface
      16:39:53,304 DEBUG [RegisteredUser#findAll] SQL: SELECT id FROM REGISTEREDUSER
      16:39:53,305 DEBUG [RegisteredUser] Could not create the finder findByAddress, because no matching CMP field was found.
      16:39:53,305 DEBUG [RegisteredUser] Could not create the finder findByInvoiceAddress, because no matching CMP field was found.
      16:39:53,305 DEBUG [RegisteredUser] Could not create the finder findByInterestedServiceCategory, because no matching CMP field was found.
      16:39:53,305 DEBUG [RegisteredUser#findByNewsByMail] SQL: SELECT id FROM REGISTEREDUSER WHERE newsByMail=?
      16:39:53,308 DEBUG [Administrator] Insert Entity SQL: INSERT INTO ADMINISTRATOR (id, password, hintQuestion, hintAnswer, email) VALUES (?, ?, ?, ?, ?)
      16:39:53,308 DEBUG [Administrator] Entity Exists SQL: SELECT COUNT(*) FROM ADMINISTRATOR WHERE id=?
      16:39:53,308 DEBUG [Administrator] entity-command: [commandName=default,commandClass=class org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand,attributes={}]
      16:39:53,308 DEBUG [Administrator] Remove SQL: DELETE FROM ADMINISTRATOR WHERE id=?
      16:39:53,314 DEBUG [Administrator] Table 'ADMINISTRATOR' already exists
      16:39:53,314 DEBUG [Administrator] Indices for table ADMINISTRATORnot created as table existed
      16:39:53,314 DEBUG [Administrator#findByPrimaryKey] SQL: SELECT t0_Administrator.id FROM ADMINISTRATOR t0_Administrator WHERE t0_Administrator.id=?
      16:39:53,314 DEBUG [Administrator] Added findByPrimaryKey query command for home interface
      16:39:53,314 DEBUG [Administrator#findAll] SQL: SELECT id FROM ADMINISTRATOR
      ....

      ===================


      I check on my database, there is not table ADMINISTRATOR created.

      Anyone knows how to solve the problem, please help me.
      Thanks alot for any help,
      The Hoa