8 Replies Latest reply on Dec 5, 2005 12:06 PM by p p

    Error: Data too long for column 'IS_COMPRESSED' at row 1

    p p Newbie

      Hi Every one, I am trying to make work the jbms, I think all is configured and running but when I try to send a mail like in the example of http://wiki.jboss.org/wiki/Wiki.jsp?page=HowToConfigureMozillaThunderbirdForUseWithJBossMailServer1.0M3

      I get this errors:

      2005-12-02 16:30:04,546 DEBUG [org.hibernate.util.JDBCExceptionReporter] Could not execute JDBC batch update [insert into STORE_ITEM_METADATA (IS_COMPRESSED, MAIL_SIZE, START_INDEX, PAGE_SIZE, HASH, ISHASHED, ID) values (?, ?, ?, ?, ?, ?, ?)]
      java.sql.BatchUpdateException: Data too long for column 'IS_COMPRESSED' at row 1
      at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1492)
      at org.jboss.resource.adapter.jdbc.WrappedStatement.executeBatch(WrappedStatement.java:484)
      at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:57)
      at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:175)

      The database is MySql, anyone knows what can be the problem?.
      Thanks.

        • 1. Re: Error: Data too long for column 'IS_COMPRESSED' at row 1
          Michael Barker Apprentice

          Could you post the schema for the STORE_ITEM_METADATA table? If this is not a production machine, you could try droping the table and allow hibernate to recreate it (you will lose data doing this though).

          Could post more of the stack trace? I.e. we can see where within the JBoss Mail code the exception comes from.

          Regards,
          Mike.

          • 2. Re: Error: Data too long for column 'IS_COMPRESSED' at row 1
            p p Newbie

            Thanks for your suggestion, I deleted all the tables to force to create them again, but the problem persists, here is the trace since the request:

            2005-12-02 22:00:14,247 INFO [org.jboss.mail.Server] Got request
            2005-12-02 22:00:14,247 INFO [org.jboss.mail.Server] waiting for request
            2005-12-02 22:00:15,215 DEBUG [org.jboss.mail.AbstractProtocol] ReadCommand outputting EHLO [127.0.0.1]

            2005-12-02 22:00:15,215 DEBUG [org.jboss.mail.smtp.SMTPProtocolInstance] HandleRequest called with request = false
            2005-12-02 22:00:15,215 DEBUG [org.jboss.mail.smtp.SMTPProtocolInstance] HandleRequest called with command = EHLO
            2005-12-02 22:00:15,215 DEBUG [org.jboss.mail.smtp.handlers.CmdEHLO] EHLO command handler called
            2005-12-02 22:00:15,309 DEBUG [org.jboss.mail.AbstractProtocol] ReadCommand outputting AUTH PLAIN AHNhbnRhZXVsYWxpYQB0ZXN0aW5nbWFpbA==

            2005-12-02 22:00:15,309 DEBUG [org.jboss.mail.smtp.SMTPProtocolInstance] HandleRequest called with request = false
            2005-12-02 22:00:15,309 DEBUG [org.jboss.mail.smtp.SMTPProtocolInstance] HandleRequest called with command = AUTH
            2005-12-02 22:00:15,309 DEBUG [org.jboss.mail.smtp.handlers.CmdAUTH] AUTH command handler called
            2005-12-02 22:00:15,309 DEBUG [org.jboss.mail.smtp.handlers.CmdAUTH] AuthType = PLAIN AHNhbnRhZXVsYWxpYQB0ZXN0aW5nbWFpbA==
            2005-12-02 22:00:15,325 DEBUG [org.jboss.mail.smtp.handlers.CmdAUTH] user=santaeulalia pass=testingmail
            2005-12-02 22:00:15,325 DEBUG [org.jboss.mail.smtp.handlers.CmdAUTH] AUTH method PLAIN succeeded
            2005-12-02 22:00:15,372 DEBUG [org.jboss.mail.AbstractProtocol] ReadCommand outputting MAIL FROM:<santaeulalia@localhost>

            2005-12-02 22:00:15,372 DEBUG [org.jboss.mail.smtp.SMTPProtocolInstance] HandleRequest called with request = false
            2005-12-02 22:00:15,372 DEBUG [org.jboss.mail.smtp.SMTPProtocolInstance] HandleRequest called with command = MAIL
            2005-12-02 22:00:15,372 DEBUG [org.jboss.mail.smtp.handlers.CmdMAIL] MAIL command handler called
            2005-12-02 22:00:15,372 DEBUG [org.jboss.mail.smtp.handlers.CmdMAIL] arg = FROM:<santaeulalia@localhost>
            2005-12-02 22:00:15,372 DEBUG [org.jboss.mail.smtp.handlers.CmdMAIL] arg wasn't null
            2005-12-02 22:00:15,372 DEBUG [org.jboss.mail.smtp.handlers.CmdMAIL] colonIndex=4
            2005-12-02 22:00:15,372 DEBUG [org.jboss.mail.smtp.handlers.CmdMAIL] sender=<santaeulalia@localhost>
            2005-12-02 22:00:15,372 DEBUG [org.jboss.mail.smtp.handlers.CmdMAIL] arg=FROM
            2005-12-02 22:00:15,372 DEBUG [org.jboss.mail.smtp.handlers.CmdMAIL] Sender= <santaeulalia@localhost> **arg = FROM
            2005-12-02 22:00:15,418 DEBUG [org.jboss.mail.AbstractProtocol] ReadCommand outputting RCPT TO:<sa@pppoviedo.no-ip.info>

            2005-12-02 22:00:15,418 DEBUG [org.jboss.mail.smtp.SMTPProtocolInstance] HandleRequest called with request = false
            2005-12-02 22:00:15,418 DEBUG [org.jboss.mail.smtp.SMTPProtocolInstance] HandleRequest called with command = RCPT
            2005-12-02 22:00:15,418 DEBUG [org.jboss.mail.smtp.handlers.CmdRCPT] RCPT command handler called
            2005-12-02 22:00:15,434 DEBUG [org.jboss.mail.smtp.SMTPProtocolInstance] HANDLE AUTH
            2005-12-02 22:00:15,481 DEBUG [org.jboss.mail.AbstractProtocol] ReadCommand outputting DATA

            2005-12-02 22:00:15,481 DEBUG [org.jboss.mail.smtp.SMTPProtocolInstance] HandleRequest called with request = false
            2005-12-02 22:00:15,481 DEBUG [org.jboss.mail.smtp.SMTPProtocolInstance] HandleRequest called with command = DATA
            2005-12-02 22:00:15,481 DEBUG [org.jboss.mail.smtp.handlers.CmdDATA] DATA command handler called
            2005-12-02 22:00:15,559 DEBUG [org.jboss.mail.message.Mail] MAIL constructor called
            2005-12-02 22:00:15,606 INFO [org.jboss.mail.message.Mail] all headers after loading: MailHeadersImpl (12): [hdr(Return-Path = 'Return-Path: <santaeulalia@localhost>'), hdr(Received = 'Received: from [127.0.0.1] (localhost 127.0.0.1) by pppoviedo.no-ip.info/JBossMail 1.0M3 (127.0.0.1)
            with SMTP id 1133557215606455.9478394853538; Fri, 2 Dec 2005 22:00:15 +0100 (CET)'), hdr(Message-ID = 'Message-ID: <4390B5DE.1090101@localhost>'), hdr(Date = 'Date: Fri, 02 Dec 2005 22:00:14 +0100'), hdr(From = 'From: Pedro <santaeulalia@localhost>'), hdr(User-Agent = 'User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)'), hdr(X-Accept-Language = 'X-Accept-Language: es-es, es'), hdr(MIME-Version = 'MIME-Version: 1.0'), hdr(To = 'To: sa@pppoviedo.no-ip.info'), hdr(Subject = 'Subject: prueba'), hdr(Content-Type = 'Content-Type: text/plain; charset=ISO-8859-1; format=flowed'), hdr(Content-Transfer-Encoding = 'Content-Transfer-Encoding: 7bit')]
            2005-12-02 22:00:15,637 INFO [org.jboss.mail.store.AbstractStore] Creating store item
            2005-12-02 22:00:15,637 DEBUG [org.jboss.mail.store.paged.PagedStore] Creating Store Item
            2005-12-02 22:00:15,653 INFO [org.jboss.mail.store.paged.PagedStore] Current Transaction: TransactionImpl:XidImpl[FormatId=257, GlobalId=BICHO/23, BranchQual=, localId=23]
            2005-12-02 22:00:15,668 DEBUG [org.hibernate.impl.SessionFactoryObjectFactory] JNDI lookup: jbossmail.HibernateSessionFactory
            2005-12-02 22:00:15,668 DEBUG [org.hibernate.impl.SessionFactoryObjectFactory] lookup: uid=4028828207ed45b80107ed45be330000
            2005-12-02 22:00:15,793 DEBUG [org.hibernate.jdbc.JDBCContext] successfully registered Synchronization
            2005-12-02 22:00:15,793 DEBUG [org.hibernate.impl.SessionImpl] opened session at timestamp: 4643050355699712
            2005-12-02 22:00:16,465 DEBUG [org.hibernate.event.def.DefaultSaveOrUpdateEventListener] saving transient instance
            2005-12-02 22:00:16,481 DEBUG [org.hibernate.event.def.AbstractSaveEventListener] saving [org.jboss.mail.store.paged.Blob#]
            2005-12-02 22:00:16,481 DEBUG [org.hibernate.event.def.AbstractSaveEventListener] executing insertions
            2005-12-02 22:00:16,512 DEBUG [org.hibernate.persister.entity.AbstractEntityPersister] Inserting entity: org.jboss.mail.store.paged.Blob (native id)
            2005-12-02 22:00:16,512 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
            2005-12-02 22:00:16,512 DEBUG [org.hibernate.jdbc.ConnectionManager] opening JDBC connection
            2005-12-02 22:00:16,528 DEBUG [org.hibernate.SQL] insert into PAGED_MAIL_STORE (LENGTH, PAGESIZE, NUMPAGES) values (?, ?, ?)
            2005-12-02 22:00:16,528 DEBUG [org.hibernate.jdbc.AbstractBatcher] preparing statement
            2005-12-02 22:00:16,543 DEBUG [org.hibernate.persister.entity.AbstractEntityPersister] Dehydrating entity: [org.jboss.mail.store.paged.Blob#]
            2005-12-02 22:00:16,543 DEBUG [org.hibernate.type.LongType] binding '0' to parameter: 1
            2005-12-02 22:00:16,543 DEBUG [org.hibernate.type.IntegerType] binding '65536' to parameter: 2
            2005-12-02 22:00:16,543 DEBUG [org.hibernate.type.IntegerType] binding '0' to parameter: 3
            2005-12-02 22:00:16,559 DEBUG [org.hibernate.id.IdentifierGeneratorFactory] Natively generated identity: 1
            2005-12-02 22:00:16,559 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
            2005-12-02 22:00:16,559 DEBUG [org.hibernate.jdbc.AbstractBatcher] closing statement
            2005-12-02 22:00:16,559 DEBUG [org.hibernate.jdbc.ConnectionManager] aggressively releasing JDBC connection
            2005-12-02 22:00:16,559 DEBUG [org.hibernate.jdbc.ConnectionManager] closing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
            2005-12-02 22:00:16,575 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] flushing session
            2005-12-02 22:00:16,575 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] processing flush-time cascades
            2005-12-02 22:00:16,575 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] dirty checking collections
            2005-12-02 22:00:16,575 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] Flushing entities and processing referenced collections
            2005-12-02 22:00:16,590 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] Processing unreferenced collections
            2005-12-02 22:00:16,590 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] Scheduling collection removes/(re)creates/updates
            2005-12-02 22:00:16,590 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] Flushed: 0 insertions, 0 updates, 0 deletions to 1 objects
            2005-12-02 22:00:16,590 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
            2005-12-02 22:00:16,590 DEBUG [org.hibernate.pretty.Printer] listing entities:
            2005-12-02 22:00:16,590 DEBUG [org.hibernate.pretty.Printer] org.jboss.mail.store.paged.Blob{length=0, numPages=0, pageSize=65536, id=1}
            2005-12-02 22:00:16,590 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] executing flush
            2005-12-02 22:00:16,590 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] post flush
            2005-12-02 22:00:16,684 DEBUG [org.hibernate.impl.SessionFactoryObjectFactory] JNDI lookup: jbossmail.HibernateSessionFactory
            2005-12-02 22:00:16,684 DEBUG [org.hibernate.impl.SessionFactoryObjectFactory] lookup: uid=4028828207ed45b80107ed45be330000
            2005-12-02 22:00:16,684 DEBUG [org.hibernate.event.def.DefaultSaveOrUpdateEventListener] saving transient instance
            2005-12-02 22:00:16,684 DEBUG [org.hibernate.event.def.AbstractSaveEventListener] generated identifier: 1, using strategy: org.hibernate.id.Assigned
            2005-12-02 22:00:16,684 DEBUG [org.hibernate.event.def.AbstractSaveEventListener] saving [org.jboss.mail.store.StoreItemMetaData#1]
            2005-12-02 22:00:16,684 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] flushing session
            2005-12-02 22:00:16,684 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] processing flush-time cascades
            2005-12-02 22:00:16,684 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] dirty checking collections
            2005-12-02 22:00:16,684 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] Flushing entities and processing referenced collections
            2005-12-02 22:00:16,684 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] Processing unreferenced collections
            2005-12-02 22:00:16,684 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] Scheduling collection removes/(re)creates/updates
            2005-12-02 22:00:16,684 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] Flushed: 1 insertions, 0 updates, 0 deletions to 2 objects
            2005-12-02 22:00:16,684 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
            2005-12-02 22:00:16,684 DEBUG [org.hibernate.pretty.Printer] listing entities:
            2005-12-02 22:00:16,684 DEBUG [org.hibernate.pretty.Printer] org.jboss.mail.store.paged.Blob{length=0, numPages=0, pageSize=65536, id=1}
            2005-12-02 22:00:16,684 DEBUG [org.hibernate.pretty.Printer] org.jboss.mail.store.StoreItemMetaData{hashed=false, pageSize=65536, size=0, compressed=true, hash=null, startIndex=0, id=1}
            2005-12-02 22:00:16,684 DEBUG [org.hibernate.event.def.AbstractFlushingEventListener] executing flush
            2005-12-02 22:00:16,684 DEBUG [org.hibernate.persister.entity.AbstractEntityPersister] Inserting entity: [org.jboss.mail.store.StoreItemMetaData#1]
            2005-12-02 22:00:16,684 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
            2005-12-02 22:00:16,684 DEBUG [org.hibernate.jdbc.ConnectionManager] opening JDBC connection
            2005-12-02 22:00:16,684 DEBUG [org.hibernate.SQL] insert into STORE_ITEM_METADATA (IS_COMPRESSED, MAIL_SIZE, START_INDEX, PAGE_SIZE, HASH, ISHASHED, ID) values (?, ?, ?, ?, ?, ?, ?)
            2005-12-02 22:00:16,684 DEBUG [org.hibernate.jdbc.AbstractBatcher] preparing statement
            2005-12-02 22:00:16,684 DEBUG [org.hibernate.persister.entity.AbstractEntityPersister] Dehydrating entity: [org.jboss.mail.store.StoreItemMetaData#1]
            2005-12-02 22:00:16,684 DEBUG [org.hibernate.type.BooleanType] binding 'true' to parameter: 1
            2005-12-02 22:00:16,684 DEBUG [org.hibernate.type.LongType] binding '0' to parameter: 2
            2005-12-02 22:00:16,684 DEBUG [org.hibernate.type.LongType] binding '0' to parameter: 3
            2005-12-02 22:00:16,684 DEBUG [org.hibernate.type.IntegerType] binding '65536' to parameter: 4
            2005-12-02 22:00:16,684 DEBUG [org.hibernate.type.BinaryType] binding null to parameter: 5
            2005-12-02 22:00:16,684 DEBUG [org.hibernate.type.BooleanType] binding 'false' to parameter: 6
            2005-12-02 22:00:16,684 DEBUG [org.hibernate.type.LongType] binding '1' to parameter: 7
            2005-12-02 22:00:16,684 DEBUG [org.hibernate.jdbc.AbstractBatcher] Adding to batch
            2005-12-02 22:00:16,700 DEBUG [org.hibernate.jdbc.AbstractBatcher] Executing batch size: 1
            2005-12-02 22:00:16,715 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
            2005-12-02 22:00:16,715 DEBUG [org.hibernate.jdbc.AbstractBatcher] closing statement
            2005-12-02 22:00:16,715 DEBUG [org.hibernate.jdbc.ConnectionManager] aggressively releasing JDBC connection
            2005-12-02 22:00:16,715 DEBUG [org.hibernate.jdbc.ConnectionManager] closing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
            2005-12-02 22:00:16,715 DEBUG [org.hibernate.util.JDBCExceptionReporter] Could not execute JDBC batch update [insert into STORE_ITEM_METADATA (IS_COMPRESSED, MAIL_SIZE, START_INDEX, PAGE_SIZE, HASH, ISHASHED, ID) values (?, ?, ?, ?, ?, ?, ?)]
            java.sql.BatchUpdateException: Data too long for column 'IS_COMPRESSED' at row 1
            at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1492)
            at org.jboss.resource.adapter.jdbc.WrappedStatement.executeBatch(WrappedStatement.java:484)
            at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:57)
            at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:175)
            at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:230)
            at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:140)
            at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:284)
            at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
            at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:750)
            at org.jboss.mail.store.AbstractStore.org$jboss$mail$store$AbstractStore$createMetaData$aop(AbstractStore.java:109)

            There are more lines under this, but I think that are irrelevants.

            I think that maybe is a problem of mysql, maybe tomorrow I will try with Oracle and I'll tell you.
            Thanks again for your help.

            • 3. Re: Error: Data too long for column 'IS_COMPRESSED' at row 1
              Michael Barker Apprentice

              Can you post the schema for the STORE_ITEM_METADATA table:

              mysql> DESCRIBE STORE_ITEM_METADATA;

              This very weird as the table is created by hibernate and written to by hibernate. It almost suggests a hibernate bug with the MySQL dialect, however I believe others have used JBMS M3 & MySQL successfully.

              Mike.

              • 4. Re: Error: Data too long for column 'IS_COMPRESSED' at row 1
                p p Newbie

                Well, now I know what is the problem, the fields of some tables in mysql are "bit" type and when jbms try to write a "true" or "false" value on them there comes the error.

                Field Type Collation Null Key Default
                ------------- ---------- --------- ------ ------ -------
                ID bigint(20) (NULL) NO PRI
                IS_COMPRESSED bit(1) (NULL) YES (NULL)
                MAIL_SIZE bigint(20) (NULL) YES (NULL)
                START_INDEX bigint(20) (NULL) YES (NULL)
                PAGE_SIZE int(11) (NULL) YES (NULL)
                HASH tinyblob (NULL) YES (NULL)
                ISHASHED bit(1) (NULL) YES (NULL)
                


                Somebody knows in what file is stored the information to create the db's structure to modify it?

                I have tried to manually modify the fields to a varchar type and then it works, do you think that I should keep it like that?
                Thanks again.

                • 5. Re: Error: Data too long for column 'IS_COMPRESSED' at row 1
                  Michael Barker Apprentice

                  Can you post the contents of your datasource configuration and the hibernate-service.xml file within your jbms deployment.

                  The database schema is not in a file as such, but is generated by hibernate at deployment time. Hibernate by default writes either a 1 or a 0 for a boolean field (including the MySQL dialect). Why it is trying to write a value of 'true' is beyond me. Do you have any custom type mapping set up for your datasource?

                  Mike.

                  • 6. Re: Error: Data too long for column 'IS_COMPRESSED' at row 1
                    p p Newbie

                    Here is the content of the hibernate-service.xml, where can I see the datasource configuration? if you mean the values I put in the install assistant are these:
                    Generate Data Source (selected)
                    Datasource name: mailDS
                    Database type: mysql
                    Database user: root
                    Database password: the password
                    Database host to connect to: 127.0.0.1
                    Database name: JBMSDB

                    And I haven't any custom type mapping.
                    Thanks Mike.

                    <jboss>
                     <mbean code="org.jboss.hibernate.jmx.Hibernate"
                     name="jboss.mail:service=Hibernate">
                    
                     <depends>jboss.har:service=HARDeployer</depends>
                     <depends>jboss.jca:service=LocalTxCM,name=mailDS</depends>
                    
                     <attribute name="DatasourceName">java:/mailDS</attribute>
                     <attribute name="SessionFactoryName">java:/jbossmail.HibernateSessionFactory</attribute>
                     <attribute name="Dialect">org.hibernate.dialect.MySQLDialect</attribute>
                     <attribute name="Hbm2ddlAuto">update</attribute>
                     <attribute name="ShowSqlEnabled">false</attribute>
                    
                     <!--attribute name="CacheProviderClass">
                     net.sf.hibernate.cache.TreeCacheProvider
                     </attribute-->
                     <attribute name="CacheProviderClass">org.hibernate.cache.HashtableCacheProvider</attribute>
                     </mbean>
                    </jboss>
                    
                    
                    


                    • 7. Re: Error: Data too long for column 'IS_COMPRESSED' at row 1
                      Andrew Oliver Master

                      what version of mysql???????

                      • 8. Re: Error: Data too long for column 'IS_COMPRESSED' at row 1
                        p p Newbie

                        Wow, I've got it, whe you asked me about the version of mysql I thought that I was using the last version (5), and I was using a connector driver from an older version, and I was right, I upgraded to the last version of the driver and voilá, it works.

                        Thanks for your help Mike, and I hope that this post can help somebody else.