FWIW, I'll post my own recent crop of errors. 

Keep in mind that the same code runs flawlessly on Nukes with HSQL; these problems are 
for MySQL.


Main problem: MySQL "Too big column length for column 'pn_name' (max = 255). Use BLOB 
instead"


  | 2004-04-23 21:07:53,522 INFO  [org.jboss.system.server.Server] 
  | JBoss (MX MicroKernel) [3.2.3 (build: CVSTag=JBoss_3_2_3 date=200311301445)] 
Started in 36s:709ms
  | 2004-04-23 21:25:59,688 ERROR [org.jboss.ejb.EntityContainer] Starting failed
  |             org.jboss.deployment.DeploymentException: Error while creating table 
nuke_faq_categories; - nested throwable: 
  | (java.sql.SQLException: Invalid argument value,  message from server: "Too big 
column length for column 'pn_name' (max = 255). Use BLOB instead")
  |                             at 
org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.createTable(JDBCStartCommand.java:232)
  |                             at 
org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.execute(JDBCStartCommand.java:93)
  |                             at 
org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.startStoreManager(JDBCStoreManager.java:484)
  |                             at 
org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManager.java:388)
  |                             at 
org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManager.java:152)
  |                             at 
org.jboss.ejb.EntityContainer.startService(EntityContainer.java:342)
  |                             at 
org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:192)


The above problem was when I used xdoclet tags like this:
   /**
    * @ejb.interface-method
    * @ejb.persistence
    *    column-name="pn_name"
    */
   public abstract String getName();

   /**
    * @ejb.interface-method
    * @ejb.persistence
    *    column-name="pn_name"    
    */
   public abstract void setName(String name);

(same results w setter without @ejb.persistence)
-------------





After reading about an old xdoclet bug:
anonymous wrote : This was a known bug with 2.1. The description field in the 
CategoryEJB was set to 256 and not 255.http://www.mail-archive.com/[EMAIL 
PROTECTED]/msg04256.html

and seeing the recommendations at 
http://junlu.com/msg/36724.html

... I tried explicitly setting VARCHAR length in my xdoclet tags

   /**
    * @ejb.interface-method
    * @ejb.persistence
    *    column-name="pn_name"
    *    jdbc-type= "VARCHAR " 
    *    sql-type= "VARCHAR(255) "
    */
   public abstract String getName();

   /**
    * @ejb.interface-method
    * @ejb.persistence
    *    column-name="pn_name"    
    *    jdbc-type= "VARCHAR " 
    *    sql-type= "VARCHAR(255) "
    */
   public abstract void setName(String name);

(same results w setter without @ejb.persistence)





but got:

Caused by: java.sql.SQLException: Syntax error or access violation,  message from 
server: "You have an error in your SQL syntax.  Check the manual that corresponds to 
your MySQL server version for the right syntax to use near 'IDENTITY)' at line 1"
  |             at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1876)
  |             at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1098)
  |             at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1192)
  |             at com.mysql.jdbc.MysqlIO.sqlQuery(MysqlIO.java:1153)
  |             at com.mysql.jdbc.Connection.execSQL(Connection.java:2048)
  |             at com.mysql.jdbc.Connection.execSQL(Connection.java:2005)
  |             at com.mysql.jdbc.Statement.executeUpdate(Statement.java:1252)
  |             at com.mysql.jdbc.Statement.executeUpdate(Statement.java:1198)
  |             at 
org.jboss.resource.adapter.jdbc.WrappedStatement.executeUpdate(WrappedStatement.java:262)
  |             at 
org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.createTable(JDBCStartCommand.java:219)


My current guess is my initial approach was correct; there should be no need for 
explicit type mapping in the xdoclet tags for simple fields like strings. I suspect 
the mapping problem comes from interplay of the nukes entity command and MySQL, and 
thus is only seen on create-table=true.

This feels like something I should be able to figure out for myself, but I haven't had 
time to dive back in --- and now I'm totally out of time till Sunday.

--Howard

p.s. -- Thanks in advance for any insights.

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3832937#3832937

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3832937


-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE. 
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to