2 Replies Latest reply on Feb 26, 2006 1:42 AM by Bruce Link

    Jboss CMP creating tables with mysql datasource and create-t

    Bruce Link Newbie

      I have a simple example I am trying to get working using myeclipse with XDoclet. I am using a mysql datasource that I have set up under java:/InfosysDS (it is there in JNDI). I have all of the CMP beans set up to use the mysql tables which are in the database. In all the beans, I have create-table false, such as:

      <entity>
       <ejb-name>Review</ejb-name>
       <datasource>java:/InfosysDS</datasource>
       <datasource-mapping></datasource-mapping>
       <create-table>false</create-table>
       <table-name>review</table-name>
      

      But when I try to start the server, it dies loading one of the beans with an exception
      20:49:46,930 ERROR [URLDeploymentScanner] Incomplete Deployment listing:
      
      --- MBeans waiting for other MBeans ---
      ObjectName: jboss.j2ee:jndiName=local/Student@1461621,service=EJB
       State: FAILED
       Reason: org.jboss.deployment.DeploymentException: Error while creating table REVIEW; - nested throwable: (java.sql.SQLException: Unexpected token: POSITION in statement [CREATE TABLE REVIEW (id VARCHAR(256) NOT NULL, position])
      
      --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
      ObjectName: jboss.j2ee:jndiName=local/Student@1461621,service=EJB
       State: FAILED
       Reason: org.jboss.deployment.DeploymentException: Error while creating table REVIEW; - nested throwable: (java.sql.SQLException: Unexpected token: POSITION in statement [CREATE TABLE REVIEW (id VARCHAR(256) NOT NULL, position])


      Obviously I am doing something wrong, but I do not see why it is trying to create a table when I have turned that off in the jbosscmp-jdbc.xml file. I am using the same DS for the security domain, which works on the web side (I am not using security yet on the ejb side, besides having a security domain set up)