10 Replies Latest reply on Jul 26, 2007 5:33 AM by Thomas Heute

    unicode settings for mysql 5.0 database

    dssa das Newbie

      I am using jboss AS 4.0.5 and jboss Portal 2.4.2 and jboss forums for this version and I can't see my national characters. If I write some text with national charecters i.e in the forum its converts for ??? and other unidentified ones.
      I already changed languague in my profile for my national.
      What should I do?

        • 1. Re: unicode settings for mysql 5.0 database
          dssa das Newbie

          I change in database coding to latin2 and in forums language properties to ISO8859_2 and now I don't have problems with chars in database but forums applications sends chars in latin1.
          When I write national chars in topic and click preview I see %$^#$#%^, so I think I must configure forums portlet, but where?

          • 2. Re: unicode settings for mysql 5.0 database
            dssa das Newbie

            I checked character encoding in test page and everything is ok, so whats can be the reason?

            • 3. Re: unicode settings for mysql 5.0 database
              dssa das Newbie

              This is exception when I try to post new topic with national characters

              type Exception report
              
              message
              
              description The server encountered an internal error () that prevented it from fulfilling this request.
              
              exception
              
              javax.servlet.ServletException: null id in org.jboss.portlet.forums.impl.PostImpl entry (don't flush the Session after an exception occurs)
               org.jboss.portal.server.servlet.PortalServlet.process(PortalServlet.java:321)
               org.jboss.portal.server.servlet.PortalServlet.doPost(PortalServlet.java:168)
               javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
               javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
               org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
              
              
              root cause
              
              org.hibernate.AssertionFailure: null id in org.jboss.portlet.forums.impl.PostImpl entry (don't flush the Session after an exception occurs)
               org.hibernate.event.def.DefaultFlushEntityEventListener.checkId(DefaultFlushEntityEventListener.java:55)
               org.hibernate.event.def.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:157)
               org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:113)
               org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:196)
               org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:76)
               org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
               org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
               org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
               org.hibernate.transaction.CacheSynchronization.beforeCompletion(CacheSynchronization.java:59)
               org.jboss.tm.TransactionImpl.doBeforeCompletion(TransactionImpl.java:1491)
               org.jboss.tm.TransactionImpl.beforePrepare(TransactionImpl.java:1110)
               org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:324)
               org.jboss.tm.TxManager.commit(TxManager.java:240)
               org.jboss.aspects.tx.TxPolicy.endTransaction(TxPolicy.java:175)
               org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:87)
               org.jboss.aspects.tx.TxInterceptor$RequiresNew.invoke(TxInterceptor.java:262)
               org.jboss.portal.core.aspects.server.TransactionInterceptor$invoke_N5143606530999904530.invokeNext(TransactionInterceptor$invoke_N5143606530999904530.java)
               org.jboss.portal.core.aspects.server.TransactionInterceptor.invoke(TransactionInterceptor.java)
               org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
               org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:131)
               org.jboss.portal.common.invocation.Invocation.invoke(Invocation.java:171)
               org.jboss.portal.server.servlet.PortalServlet.process(PortalServlet.java:295)
               org.jboss.portal.server.servlet.PortalServlet.doPost(PortalServlet.java:168)
               javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
               javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
               org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
              
              
              note The full stack trace of the root cause is available in the Apache Tomcat/5.5.20 logs.
              
              


              • 4. Re: unicode settings for mysql 5.0 database
                dssa das Newbie

                If I edit datas in database and change &%^&% to national chars, portlet read it sucessfull. Problem is only where I send chars from portlet to database becouse portlet convert it to UTF-8

                • 5. Re: unicode settings for mysql 5.0 database
                  dssa das Newbie

                  If I replay for topic chars are ok, the problem is only when I post a new topic

                  • 6. Re: unicode settings for mysql 5.0 database
                    dssa das Newbie

                    Sorry might be I shoud post this in jboss forums, but I dont know where is a problem - in portal or in a forums portlet

                    • 7. Re: unicode settings for mysql 5.0 database
                      Thomas Heute Master

                      set the correct encoding on your database, see the mysql documentation

                      • 8. Re: unicode settings for mysql 5.0 database
                        dssa das Newbie

                        I already set correct encoding in my database, and If I manually add some national chars to jbp_forum_posts and jbp_forum_topics, jboss forums sucessfull read it, but if I write some national chars in my browser and try to send it to database I have got error. If I don't send it to database but only click preview (button in bottom of the post) I see ^%#^&#%^%^#. The problem is only when I create new topic, when I replay from existing topic everything is ok.

                        • 9. Re: unicode settings for mysql 5.0 database
                          dssa das Newbie

                          I found where its broken but I don't know how Can I repair that. Look at the error:

                          2007-07-26 10:13:23,441 DEBUG [org.hibernate.util.JDBCExceptionReporter] could not insert: [org.jboss.portlet.forums.impl.PostImpl] [insert into jbp_forums_posts (jbp_topic_id, jbp_edit_count, jbp_edit_date, jbp_create_date, jbp_subject, jbp_text, jbp_poster_id) values (?, ?, ?, ?, ?, ?, ?)]
                          java.sql.SQLException: Incorrect string value: '\xC3\xB3\xC4?\xC5?...' for column 'jbp_subject' at row 1
                           at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:946)
                           at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2934)
                           at
                          


                          In my database I configured charset to latin2 in all forum tables, and in forum I have problem if I put special chars from latin2. Futhermore I added charset to my jdbc configuration

                          <connection-url>jdbc:mysql://localhost:3306/jboss?charSet=iso-8895-2</connection-url>
                          

                          in mysql and portal mysql .xml files.

                          What else should I do?

                          • 10. Re: unicode settings for mysql 5.0 database
                            Thomas Heute Master

                            You should ask in the JBoss Forums forum (Not in JBoss Portal)