Menu

MySQL problem with UTF-8

Help
jerry6
2006-06-08
2013-02-18
  • jerry6

    jerry6 - 2006-06-08

    Hi,

    I am using UTF-8 encoding with MySQL. According to the EJBCA document, I use the database-url like this

    database.url=jdbc:mysql://localhost:3306/ejbca?useUnicode=true&characterEncoding=UTF-8

    When I tries to ant bootstrap, I got following exception from JBoss log:

    19:29:46,714 WARN  [ServiceController] Problem starting service jboss.j2ee:service=EjbModule,module=ejbca-ejb.jar
    org.jboss.deployment.DeploymentException: Error: can't find data source: java:/EjbcaDS; - nested throwable: (javax.naming.NameNotFoundException: EjbcaDS not bound)
            at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCEntityBridge.init(JDBCEntityBridge.java:153)
            at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.initStoreManager(JDBCStoreManager.java:435)
            at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManager.java:368)
            at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManager.java:172)

    Any idea?

    Thanks
    Jerry

     
    • jerry6

      jerry6 - 2006-06-08

      Here is the first occurence of the exception:

      19:29:32,285 INFO  [MailService] Mail Service bound to java:/EjbcaMail
      19:29:32,351 ERROR [MainDeployer] Could not initialise deployment: file:/data/home/ware/src/jboss/4.0.4/server/default/deploy/ejbca-ds.xml
      org.jboss.deployment.DeploymentException: Could not parse dd; - nested throwable: (org.xml.sax.SAXParseException: The reference to entity "characterEncoding" must end with the ';' delimiter.)
              at org.jboss.deployment.XSLSubDeployer.findDd(XSLSubDeployer.java:231)
              at org.jboss.deployment.XSLSubDeployer.init(XSLSubDeployer.java:161)
              at org.jboss.deployment.MainDeployer.init(MainDeployer.java:861)
              at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:798)
              at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)

      Which indicate the database url is not correct.
      Any idea?

      Thanks
      Jerry

       
      • Tomas Gustavsson

        I have recently changed to information htere it seems useUnicode should not be there, simply use this connection string:
        mysql://localhost:3306/ejbca?characterEncoding=UTF-8

        Cheers,
        Tomas Gustavsson
        PrimeKey Solutions AB
        -----
        PrimeKey Solutions also offers a commercial EJBCA-subscription, including support and new extensions for EJBCA. Please see www.primekey.se or contact info@primekey.se for more information.

         
    • jerry6

      jerry6 - 2006-06-08

      Have you test this with any real UTF-8 characters, such as chinese characters?

      By the way, If change the connection url and run ant deploy again, will my current data in the database be losted?

      Thanks,
      Jerry

       
      • Tomas Gustavsson

        Yes, it's been tested with for example turkish characters.
        The data will not be lost when changing the connect string.

        Cheers,
        Tomas

         
    • jerry6

      jerry6 - 2006-06-09

      Thanks. -- Jerry

       

Log in to post a comment.