1 2 Previous Next 20 Replies Latest reply on May 14, 2004 5:56 PM by Howard Pearlmutter

    MySQL & Pure-CMP --- issues w News & FAQ modules

    Howard Pearlmutter Novice

      Jae --

      "hxp" wrote:

      "jae77" wrote:
      i don't have oracle, mysql, or postgres running at home, so while i haven't had any issues creating tables in hsqldb, i don't know if someone else may have an issue. (i know for hsqldb, i have to set the pk-constraint to false, but this may not be necessary for the other dbs).

      I have hsql on my home dev nukes inst, but have mysql on my rh9 linux box colo'd at the datacenter. Early tests show a bug with mysql and the nukes entity command; you'll see something more about this from me by the time you get back from Las Vegas.



      "jae77" wrote:

      i'm curious to know what the issue w/ the entity command is and how it relates to creating the tables themselves. i know hsqldb has an issue where you can't enable the pk-constraint when creating the tables. are you sure you're not missing something w/ the xdoclet/ant "config/setup?" i ask b/c we are generating successful deployments for other components and mysql.


      I thought it might be quicker to see if your News code ran ok on MySQL before I try to describe the problem I was facing. I thought it would help me know whether my problems were limited to my way of doing things. And since you dont have MySQL handy, it might give you some good feedback.

      I grabbed last nites CVS and built and deployed the News module and tested. I found different problems than the ones I've been seeing.

      Since I know you have little time before flying to LV, here are the results, raw without me taking time to do analysis.


      To start fresh, I bounced JBoss with these server.log results:

      
      2004-04-28 15:44:37,994 INFO [STDOUT] Apache Tomcat/4.1.29
      2004-04-28 15:44:38,114 INFO [org.apache.coyote.http11.Http11Protocol] Initializing Coyote HTTP/1.1 on port 8080
      2004-04-28 15:44:38,138 INFO [org.apache.coyote.http11.Http11Protocol] Starting Coyote HTTP/1.1 on port 8080
      2004-04-28 15:44:38,214 INFO [org.apache.jk.common.ChannelSocket] JK2: ajp13 listening on
       /0.0.0.0:8009
      2004-04-28 15:44:38,339 INFO [org.apache.jk.server.JkMain] Jk running ID=0 time=1/144 config=null
      2004-04-28 15:45:06,720 ERROR [org.jboss.nukes.system.JDBCPersistenceManager] Cannot sync attribute
      org.jboss.nukes.utils.ConversionException: A property editor has not been found for type java.util.Map
       at org.jboss.nukes.utils.Tools.findEditor(Tools.java:777)
       at org.jboss.nukes.utils.Tools.fromObject(Tools.java:831)
       at org.jboss.nukes.system.JDBCPersistenceManager.syncAttribute(JDBCPersistenceManager.java:102)
       at org.jboss.nukes.system.JDBCPersistenceManager.load(JDBCPersistenceManager.java:289)
       at org.jboss.nukes.system.JDBCPersistenceManager.load(JDBCPersistenceManager.java:320)
       at org.jboss.mx.modelmbean.ModelMBeanInvoker.load(ModelMBeanInvoker.java:237)
       at org.jboss.mx.modelmbean.ModelMBeanInvoker.initPersistence(ModelMBeanInvoker.java:413)
       at org.jboss.mx.modelmbean.ModelMBeanInvoker.preRegister(ModelMBeanInvoker.java:294)
       at org.jboss.mx.server.registry.BasicMBeanRegistry.registerMBean(BasicMBeanRegistry.java:148)
       at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
       at org.jboss.mx.interceptor.ObjectReferenceInterceptor.invoke(ObjectReferenceInterceptor.java:59)
       at org.jboss.mx.interceptor.MBeanAttributeInterceptor.invoke(MBeanAttributeInterceptor.java:43)
       at org.jboss.mx.interceptor.PersistenceInterceptor2.invoke(PersistenceInterceptor2.java:93)
      ...
      2004-04-28 15:45:07,175 WARN [javax.management.modelmbean.ModelMBeanAttributeInfo] WARNING: supplied isIS=true, set to false
      2004-04-28 15:45:07,540 WARN [javax.management.modelmbean.ModelMBeanAttributeInfo] WARNING: supplied isIS=true, set to false
      
      2004-04-28 15:45:10,157 INFO [org.jboss.system.server.Server] JBoss (MX MicroKernel)
      [3.2.3 (build: CVSTag=JBoss_3_2_3 date=200311301445)] Started in 37s:768ms
      
      2004-04-28 15:45:16,176 ERROR [org.jboss.ejb.EntityContainer] Starting failed
      org.jboss.deployment.DeploymentException: Error while creating table nuke_news_topics; - nested throwable: (java.sql.SQLException: Invalid argument value, message from server: "Incorrect table definition; There can only be one auto column and it must be defined as a key")
       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)
      
      ...
      
      Caused by: java.sql.SQLException: Invalid argument value, message from server: "Incorrect
       table definition; There can only be one auto column and it must be defined as a key"
       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)
       ... 55 more











      "Cannot invoke the operation : the module threw an exception " or "An error has occured" was the response for most News related invocations.

      After click on "News" item in menu block:

      2004-04-28 16:06:43,752 ERROR [org.jboss.ejb.plugins.LogInterceptor] TransactionRolledbackLocalException in method: public abstract java.util.Collection org.jboss.nukes.addons.modules.news.ejb.StoryEJBLocalHome.findByState(java.lang.Integer) throws javax.ejb.FinderException, causedBy:
      java.lang.IllegalStateException: createBeanClassInstanceCommand == null
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.createBeanClassInstance(JDBCStoreManager.java:542)
       at org.jboss.ejb.plugins.CMPPersistenceManager.createBeanClassInstance(CMPPersistenceManager.java:119)
       at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.createBeanClassInstance(CachedConnectionInterceptor.java:250)
       at org.jboss.ejb.EntityContainer.createBeanClassInstance(EntityContainer.java:226)
       at org.jboss.ejb.plugins.AbstractInstancePool.get(AbstractInstancePool.java:168)
       at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:77)
       at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:61)
       at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:28)
       at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:88)
       at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:267)
       at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:98)
       at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:92)
       at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:120)
       at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:93)
       at org.jboss.ejb.EntityContainer.internalInvokeHome(EntityContainer.java:483)
       at org.jboss.ejb.Container.invoke(Container.java:720)
       at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invokeHome(BaseLocalProxyFactory.java:293)
       at org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:110)
       at $Proxy171.findByState(Unknown Source)
       at org.jboss.nukes.addons.modules.news.NewsModule.getStories(NewsModule.java:1382)
       at org.jboss.nukes.addons.modules.news.NewsModule.main(NewsModule.java:406)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.nukes.module.ModuleSupport.operation(ModuleSupport.java:117)
       at org.jboss.nukes.module.ModuleSupport.process(ModuleSupport.java:91)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
       at org.jboss.mx.interceptor.ObjectReferenceInterceptor.invoke(ObjectReferenceInterceptor.java:59)
       at org.jboss.mx.interceptor.MBeanAttributeInterceptor.invoke(MBeanAttributeInterceptor.java:43)
       at org.jboss.mx.interceptor.PersistenceInterceptor2.invoke(PersistenceInterceptor2.java:93)
       at org.jboss.nukes.mx.LifeCycleInterceptor.invoke(LifeCycleInterceptor.java:93)
       at org.jboss.mx.server.MBeanInvoker.invoke(MBeanInvoker.java:76)
      ...
      2004-04-28 16:06:43,776 ERROR [org.jboss.nukes.component.Component.news] Cannot invoke operation
      javax.ejb.TransactionRolledbackLocalException: createBeanClassInstanceCommand == null; CausedByException is:
       createBeanClassInstanceCommand == null
       at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:204)
       at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:267)
       at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:98)
       at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:92)
       at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:120)
       at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:93)
       at org.jboss.ejb.EntityContainer.internalInvokeHome(EntityContainer.java:483)
       at org.jboss.ejb.Container.invoke(Container.java:720)
      ...
      java.lang.IllegalStateException: createBeanClassInstanceCommand == null
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.createBeanClassInstance(JDBCStoreManager.java:542)
       at org.jboss.ejb.plugins.CMPPersistenceManager.createBeanClassInstance(CMPPersistenceManager.java:119)
      ....
      
      




      NewsAdmin link successfully brought up
      http://www.glassroutes.com:8080/nukes/index.html?module=news&op=admin
      manage topics brought up
      http://www.glassroutes.com:8080/nukes/index.html?module=news&op=topicadmin

      but log shows:

      2004-04-28 16:18:53,668 ERROR [org.jboss.nukes.component.Component.news]
      javax.ejb.FinderException: Unknown query: public abstract java.util.Collection org.jboss.nukes.addons.modules.news.ejb.TopicEJBLocalHome.findAll() throws javax.ejb.FinderException
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCQueryManager.getQueryCommand(JDBCQueryManager.java:60)
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCFindEntitiesCommand.execute(JDBCFindEntitiesCommand.java:37)
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.findEntities(JDBCStoreManager.java:579)
       at org.jboss.ejb.plugins.CMPPersistenceManager.findEntities(CMPPersistenceManager.java:311)
       at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.findEntities(CachedConnectionInterceptor.java:322)
       at org.jboss.ejb.EntityContainer.findLocal(EntityContainer.java:613)



      Add Topic button >>> "An error occured"
      log:



      2004-04-28 16:21:25,800 ERROR [org.jboss.ejb.plugins.cmp.jdbc.keygen.JDBCMySQLCreateCommand.TopicEJB] Could not create entity
      java.sql.SQLException: General error, message from server: "Table 'nukes.nuke_news_topics' doesn't exist"
       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.Connection.execSQL(Connection.java:2051)
       at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1680)
       at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1527)
       at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:324)
       at org.jboss.ejb.plugins.cmp.jdbc.keygen.JDBCMySQLCreateCommand.executeInsert(JDBCMySQLCreateCommand.java:66)
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractCreateCommand.performInsert(JDBCAbstractCreateCommand.java:287)
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractCreateCommand.execute(JDBCAbstractCreateCommand.java:138)
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.createEntity(JDBCStoreManager.java:554)
       at org.jboss.ejb.plugins.CMPPersistenceManager.createEntity(CMPPersistenceManager.java:208)
      ...





      Sorry for not giving more, but I'm racing against the clock; client's flying in from Mexico City in a few hours; signing off till the weekend.
      -- Howard

        • 1. Re: MySQL & Pure-CMP --- issues w News & FAQ modules
          Howard Pearlmutter Novice

          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:
          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/xdocletuser@lists.sourceforge.net/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.

          • 2. Re: MySQL & Pure-CMP --- issues w News & FAQ modules
            lcb Newbie

            You must set pk-constraint to true for mysql to fix the problem with creating the tables.
            I have done it manually in the jbosscmp-jdbc.xml and it works fine.

            • 3. Re: MySQL & Pure-CMP --- issues w News & FAQ modules
              Howard Pearlmutter Novice

              LCB --


              "LCB" wrote:
              You must set pk-constraint to true for mysql to fix the problem with creating the tables.
              I have done it manually in the jbosscmp-jdbc.xml and it works fine.


              Thanks for your reply, but it doesn't seem to be the solution.

              1) From my tests, setting pk-constraint to true does not fix the MySQL "Too big column length for column 'pn_name' (max = 255). Use BLOB instead".
              If I'm missing something, such as maybe a bug in xdoclet that means you have to go and hack the jbosscmp-jdbc.xml manually, please let me know.

              2) Setting pk-constraint to true prevents the Entity from being deployed to HSQL.

              org.jboss.deployment.DeploymentException:
              Error while creating table NUKE_FAQ_CATEGORIES;
              - nested throwable: (java.sql.SQLException:
              Attempt to define a second primary key in statement
              [CREATE TABLE NUKE_FAQ_CATEGORIES (pn_name VARCHAR(256),
              pn_language VARCHAR(256), pn_id INTEGER NOT NULL IDENTITY,
              pn_parent_id INTEGER,
              CONSTRAINT PK_NUKE_FAQ_CATEGORIES PRIMARY KEY (pn_id))])
               at org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.createTable(JDBCStartCommand.java:232)
               at org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.execute(JDBCStartCommand.java:93)
              ...


              Others have also seen this behavior...

              "jae77" wrote:
              i know hsqldb has an issue where you can't enable the pk-constraint when creating the tables.


              3) So even if pk-constraint="true" fixed the MySQL column length mapping problem (which it doesnt seem to), it isn't portable across DBMS's.

              It would be good to get people's opinion here about how it is supposed to work; whether it's the HSQL or the MySQL mapping that's to blame; and where the fix needs to be made.

              But it is even more important to me to figure out how we can make a pure-CMP xdoclet-based template that works across all the DBMS's, transparently.

              4) IMHO, this column length issue is not a PK-related problem...
              it seems the problem lies in the Nukes entity command (or the deeper JBoss o/r code) that generates the SQL phrase for VARCHAR as 256 rather than 255:

              CREATE TABLE NUKE_FAQ_CATEGORIES (pn_name VARCHAR(256) ....
              does not work for MySQL which has a 255 limit on VARCHARs ---
              "Too big column length for column 'pn_name' (max = 255). Use BLOB instead"

              Anybody have any insights/comments on this one?

              -- Howard

              • 4. Re: MySQL & Pure-CMP --- issues w News & FAQ modules
                lcb Newbie

                I think you have the wrong mapping in jbosscmp-jdbc.xml
                it must look like this:

                <?xml version="1.0" encoding="UTF-8"?>
                <!DOCTYPE jbosscmp-jdbc PUBLIC "-//JBoss//DTD JBOSSCMP-JDBC 3.2//EN" "http://www.jboss.org/j2ee/dtd/jbosscmp-jdbc_3_2.dtd">
                
                <jbosscmp-jdbc>
                 <defaults>
                 <datasource>java:NukesDS</datasource>
                 <datasource-mapping>Hypersonic SQL</datasource-mapping>
                 </defaults>
                


                • 5. Re: MySQL & Pure-CMP --- issues w News & FAQ modules
                  lcb Newbie

                  Sorry, wrong code, mapping must be mySQL

                  <?xml version="1.0" encoding="UTF-8"?>
                  <!DOCTYPE jbosscmp-jdbc PUBLIC "-//JBoss//DTD JBOSSCMP-JDBC 3.2//EN" "http://www.jboss.org/j2ee/dtd/jbosscmp-jdbc_3_2.dtd">
                  
                  <jbosscmp-jdbc>
                   <defaults>
                   <datasource>java:NukesDS</datasource>
                   <datasource-mapping>mySQL</datasource-mapping>
                   </defaults>
                  


                  • 6. Re: MySQL & Pure-CMP --- issues w News & FAQ modules
                    sesques Novice

                    Hi Howard, Hi LCB,

                    As you ask me on the "Persistence & CMP/JBoss" forum, I'm pleased to have a look on your debates. I don't know Nukes and I don't want to investigate on this project. The reason is that I'm enough busy with my job to participate on such a project.

                    Anyway, I can say that LCB gives the solution before me. Effectively, You don't have to rely on database specific tags for the mapping, all the mappings are described in the standardjbosscmp-jdbc.xml file. For MySQL, the mapping for Strings is VARCHAR(250).
                    So, you just have to specify the datasource mapping type in jbosscmp-jdbc like LCB says (the second version for mySQL).
                    I think that it will solve all your problems.
                    Please, let me know.
                    Pascal

                    • 7. Re: MySQL & Pure-CMP --- issues w News & FAQ modules
                      jae Master

                      ok - i'm back from vegas, a little bit poorer (howard, you owe me some noodles) and married (YAY!!!)

                      i am going to update mapping propery files (the ones used by the local.properties file) to have the pk-constraint settting automatically defined. this should handle that issue (if anyone knows the proper oracle setting, pls let me know - i'm guessing it's true).

                      as for the other issues, i will have to d/l and install mysql to see if get this problems. i know i've accidently forgotten to change the mapping in the local.properties file and had these same types of errors.

                      on a completely diffferent side note, it's a bitch to read this post - we should update the forums to do "hard" line breaks after "x" amount of characters - or perhaps enable wrapping on the table columns?

                      • 8. Re: MySQL & Pure-CMP --- issues w News & FAQ modules
                        Howard Pearlmutter Novice

                        Hi Pascal, Hi LCB --

                        Thanks for your suggestions.

                        Your standardjbosscmp-jdbc.xml / jbosscmp-jdbc.xml analysis has the ring of truth to it;
                        we need to check into it to determine for sure.

                        Your analysis also explains why this is not a general problem for JBoss,
                        but is a general problem for Nukes....
                        all Nukes modules share the faulty configuration file(s).

                        These faulty configuration files would have been manually administered in a typical JBoss app environment,
                        but instead they are automatically generated or fixed in CVS
                        and automatically included in the Nukes build process.

                        Because Nukes modules have never used pure-CMP prior to now (in particular,
                        using the create-table xdoclet tag to generate the xml to get the container to create the tables),
                        this problem has never shown up before now.


                        The next question is where to put the fix(es) into Nukes --
                        * in the nukes installer?
                        * in the ant build process...
                        the build.xml? the local.properties file? the mapping propery files?
                        Jae's post begins to go into this question;
                        looks like we're hot on the trail of a good solution.

                        Thanks again for helping us get pure-CMP going for Nukes.

                        --Howard


                        • 9. Re: MySQL & Pure-CMP --- issues w News & FAQ modules
                          Howard Pearlmutter Novice

                          Hi Jae --

                          Welcome back -- and congratulations on your wedding !!

                          Re: noodles; lets continue that thread back on

                          "Pure-CMP & FAQ Module revamp"
                          http://www.jboss.org/index.html?module=bb&op=posting&mode=quote&p=3832929

                          Also on that thread we discussed...

                          "hxp" wrote:
                          "jae77" wrote:

                          i ask b/c we are generating successful deployments for other components and mysql.


                          Careful, careful... those were not pure-CMP deployments... weren't relying on create-table....

                          I suspect we'll find something wrong with the interaction of create-table and nukes and mysql....


                          which relate to what I just said to Pascal & LCB on this thread.

                          Let's continue the general discussion on the other
                          (easier to read) "Pure-CMP & FAQ Module revamp"thread;
                          and lets leave this thread for posting wide ugly bug listing logs and implem details.

                          Your comment about breaking/wrapping wide posts is right on,
                          so I started a thread quoting you
                          titled "Forums should enforce width constraint on wide posts"
                          http://www.jboss.org/index.html?module=bb&op=viewtopic&t=49308
                          ((Trying to keep these Forum topics even a little bit organized is a bitch ;)))


                          --- Howard

                          • 10. Re: MySQL & Pure-CMP --- issues w News & FAQ modules
                            Howard Pearlmutter Novice

                            Hi Jae, Hi Pascal, Hi LCB --

                            Good news ---

                            Setting nukes.database=mysql in local.properties
                            and
                            setting pk-constraint="true" in each entity EJB's @jboss.persistence tag
                            and then building as usual
                            WORKS!

                            So now my pure-CMP FAQ module deploys flawlessly
                            on Nukes/JBoss/MySQL/Linux
                            :)


                            Bad news ---

                            Have to set everything back
                            to build my pure-CMP FAQ module
                            so that it deploys on Nukes/JBoss/HSQL/Windows.
                            :(


                            Getting much closer to genuine DB transparency... but not there quite yet.

                            --Howard

                            • 11. Re: MySQL & Pure-CMP --- issues w News & FAQ modules
                              lcb Newbie

                              Howard,
                              take a look at the news module. The setting for pk-constraint is declared there in the build file
                              , so there ist no need to do it manually in each EJB. Only problem is, the changes only occur when making clean build.

                              Next step is to make these settings in the database specific properties for the howle project.

                              • 12. Re: MySQL & Pure-CMP --- issues w News & FAQ modules
                                jae Master

                                i'll be taking care of making this global adjustment in the coming days.

                                • 13. Re: MySQL & Pure-CMP --- issues w News & FAQ modules
                                  Howard Pearlmutter Novice

                                  Jae, LCB --

                                  Good news, thanks.

                                  Where will this "global adjustment" be made?

                                  -- Howard

                                  • 14. Re: MySQL & Pure-CMP --- issues w News & FAQ modules
                                    Howard Pearlmutter Novice

                                    Anybody have an idea about the non-fatal startup exception reported at the beginning of this thread:

                                    org.jboss.nukes.utils.ConversionException:
                                    A property editor has not been found for type java.util.Map
                                     at org.jboss.nukes.utils.Tools.findEditor(Tools.java:777)


                                    ???

                                    -- Howard

                                    1 2 Previous Next