Project WebSynergy Milestone 4 Administration Guide

ProcedureTo Enable UTF-8 Support for MySQL

You need to make changes to the portal-ext.properties file to enable UTF-8 support for MySQL. The WebSynergy evaluation bundle has a portal-ext.properties file in the GlassFish install-dir/domains/domain1/applications/j2ee-modules/websynergy/WEB-INF/classes. When you are using a WebSynergy bundle which is not including samples, you have to create a portal-ext.properties file. This task describes the process to create a portal-ext.properties file, and making changes to it to enable UTF-8 support for MySQL.

  1. Create a temporary folder. In this example, name the folder as test.

    Equivalent step in the command prompt or in the terminal window of a UNIX like OS:

    mkdir /tmp/test

  2. Copy the portal-impl.jar file to the temp folder.

    Equivalent step in the command prompt or in the terminal window of a UNIX like OS:

    cp GlassFish install-dir/domains/domain1/application/j2ee-modules/websynergy/WEB-INF/lib/portal-impl.jar /tmp/test

  3. Change directory to temp.

    Equivalent step in the command prompt or in the terminal window of SOLARIS or any UNIX like OS:

    cd /tmp/test

  4. Extract the portal-impl.jar file.

    Equivalent step in the command prompt or in the terminal window of a UNIX like OS:

    jar -xvf portal-impl.jar

    After unjar it will have portal.properties file in the same directory.

  5. Open portal.properties and copy the "JDBC" property.

  6. Create a text file (using any text editor) and name it as portal-ext.properties, and paste the "JDBC" property into it.

    #
        # Hypersonic
        #
        jdbc.default.driverClassName=org.hsqldb.jdbcDriver
        jdbc.default.url=jdbc:hsqldb:lportal
        jdbc.default.username=sa
        jdbc.default.password=
    
        #
        # MySQL
        #
        #jdbc.default.driverClassName=com.mysql.jdbc.Driver
        #jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=
    UTF-8&useFastDateParsing=false
        #jdbc.default.username=
        #jdbc.default.password=
  7. Comment Hypersonic (HSQL) and uncomment MySQL.

  8. Save the portal-ext.properties file.

  9. Copy the portal-ext.properties file and paste it to GlassFish install-dir/domains/domain1/applications/j2ee-modules/websynergy/WEB-INF/classes.

  10. Restart GlassFish server.