Discussions

EJB programming & troubleshooting: CMP EJB Create Exception

  1. CMP EJB Create Exception (1 messages)

    Hi, I'm trying to test a CMP EJB with JBoss AS using a MySQL DB. But I've got an exception I don't understand : --------------------------------------------------------- javax.ejb.CreateException: Error checking if entity exists:com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table 'tss.xuser' doesn't exist at org.jboss.ejb.plugins.cmp.jdbc.JDBCInsertPKCreateCommand.beforeInsert(JDBCInsertPKCreateCommand.java:92) at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractCreateCommand.execute(JDBCAbstractCreateCommand.java:136) 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.createLocalHome(EntityContainer.java:612) etc etc... --------------------------------------------------------- My table is named "user" and not "xuser". I checked it all up but don't find any reference to "xuser" in any files (ejb-jar.xml, xdoclet notations etc...). So I don't understand.... Could anybody help please ? Thanx. Here is my ejb-jar.xml concerning this user bean : ------------ <![CDATA[]]> User com.mystore.bean.user.UserLocalHome com.mystore.bean.user.UserLocal com.mystore.bean.user.UserBean Container java.lang.Long false 2.x User <![CDATA[]]> usrId <![CDATA[]]> usrEmail <![CDATA[]]> usrPassword <![CDATA[]]> usrDateOfBirth usrId findByEmailAndPassword java.lang.String java.lang.String <![CDATA[select object(usr) from User usr where usr.usrEmail = ?1 and usr.usrPassword = ?2]]> ------------

    Threaded Messages (1)

  2. configuration issue[ Go to top ]

    in standardjbosscmp-jdbc.xml you'll find near the end that "user" is a reserved word then they prepended by x. I suggest that you change the name of your field rather than "user", but maybe a modification of the configuration file is solution too. I didn't try to solve such a problem though.