2 Replies Latest reply on Nov 11, 2002 7:51 PM by overzealous

    Incorrect SQL Generated

    overzealous

      I'm running JBoss 3.0.3/Jetty as a standalone test on a WinXP box.

      I've created a relatively simple CMP/CMR bean to store information in a PostgreSQL database (running on a different machine.)

      I'm using XDoclet to generate all the EJB/JAWS/JBoss-CMP information.

      Everytime I try to deploy the bean, JBoss is creating queries with an extra, unnamed (and therefore illegal) column. ex:

      2002-11-11 18:36:50,157 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.ets/SiteLayout] Executing SQL: CREATE TABLE sitelayout (name TEXT NOT NULL, defaultsidebar TEXT, description TEXT, layoutorder INT4 NOT NULL, title TEXT, url TEXT, TEXT, CONSTRAINT pk_sitelayout PRIMARY KEY (name))
      2002-11-11 18:36:50,157 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.ets/SiteLayout] Could not create table sitelayout
      2002-11-11 18:36:50,157 WARN [org.jboss.system.ServiceController] Problem starting service jboss.j2ee:jndiName=ejb/ets/SiteLayout,service=EJB
      org.jboss.deployment.DeploymentException: Error while creating table; - nested throwable: (java.sql.SQLException: ERROR: parser: parse error at or near ","
      )
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.createTable(JDBCStartCommand.java:175)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.execute(JDBCStartCommand.java:84)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.startStoreManager(JDBCStoreManager.java:457)


      Notice how just before the constraint (in the bold section), there's an extra column. This shows up in every SQL query.