#1 2016-06-08 02:21:58

gerry
Member
Registered: 2016-05-10

Chinese with Datasource FolderName and SQL-alias Name

Hi,
I use RS3.0.1 & RS3.0.2 on Linux Platform. I encountered the following problem, please help me:
1. datasource folder in Chinesename will be displayed: '????'  (main.cf,default encoding is UTF8.)
2. In the Dynamic List, the alias column name(Chinese) can not be displayed correctly, this can be display normal from metadata ways. But "case ... when ... then 'chinese_character' " in SQL statement can not be displayed.
3. PDF does not show Chinese after export, but excel export is OK.


THX

Offline

#2 2016-06-08 08:12:22

Arno Mittelbach
datenwerke
Registered: 2012-02-14

Re: Chinese with Datasource FolderName and SQL-alias Name

Hi Gerry,

there is good and bad news. The good news is, it is working, when configured correctly. The bad news, tracing configuration errors concerning fonts is not always easy and parts of the configuration changes requires ReportServer Enterprise Edition (see below).

If I am not mistaken, then there are two problems with your setup. The datasource folder and alias problem seem to indicate that the database you are using does not store data in UTF-8. I've tested both with the test string "你好,世界" (which google translate tells me should mean "hello world") and it worked in both cases (see screenshot)

LRYCDZ.jpg

What database are you ReportServer on? To ensure the data is stored correctly in the database, you can use the following query

SELECT *  FROM RS_DATASOURCE_FOLDER

My guess is that the database does not store UTF-8 values and hence you already have the ???? in the database.

As to the second problem, that is, the PDF export of a Dynamic List. Here we need to make ReportServer aware of a font that supports Chinese characters. The default font used by ReportServer is DejaVu Sans which does not support Chinese characters. In order to change the font, you need to adapt two configuration files in ReportServer's internal file server.

/fileserver/etc/exportfilemd/pdfexport.cf: To make ReportServer aware of a font that supports Chinese characters
/fileserver/etc/dynamiclists/pdfexport.cf: To use the font when exporting Dynamic Lists to PDF (this change requires ReportServer Enterprise Edition)

For testing I used Google's Noto Fonts. The first configuration file could look as follows:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
   <pdf>
      <fontDirectories registerDefaultDirectories="false">
      	  <dir></dir>
       </fontDirectories>
       <fonts>
      	<font>
      		<path>PATH_TO_FONT/NotoSansCJKtc-Regular.otf</path>
  	</font>
      </fonts>
   </pdf>
</configuration>

This makes ReportServer aware of the NotoSansCJK Regular font. Now we need to adapt the second config file for ReportServer to use the font. Behind the scenes when generating PDF for a Dynamic List we are transforming HTML into PDF, that is, we can use standard CSS in order to select the font. All that needs changing is the <style> tag in the config file.

<style><![CDATA[
         @page {
        	size: A4 landscape;
         	@top-left { 
        		content: "${report.name}"; 
        		font-family: Noto Sans CJK TC Regular, Sans-Serif; 
        		font-size: 8pt; 
       		}
            @top-right {
        		content: "${now}"; 
                font-family: Noto Sans CJK TC Regular, Sans-Serif; 
                font-size: 8pt; 
            }
            @bottom-right { 
        		content: "${page} " counter(page) " ${of} " counter(pages); 
        	    font-family: Noto Sans CJK TC Regular, Sans-Serif; 
               font-size: 8pt; 
            }
          }
		* {
       		font-family: Noto Sans CJK TC Regular, Sans-Serif; 
		}
          ]]>
 </style>

Here I've replaced the DejaVu Font with the Noto Sans CJK TC Regular and added the section

* {
       	font-family: Noto Sans CJK TC Regular, Sans-Serif; 
}

telling the converter to use the font throughout the entire Document.

Once you've implemented the changes in the config files, be sure to run the config reload command on the terminal.

For testing, I've create a simple dynamic list and added the "你好,世界" as alias of a single column. Following is a screenshot from the PDF export.

M13cbw.jpg

I hope this helps.

Cheers,
Arno

Offline

#3 2016-06-12 05:55:40

gerry
Member
Registered: 2016-05-10

Re: Chinese with Datasource FolderName and SQL-alias Name

Hi Arno,
  Thanks for your reply.
   ReportServer is work on 'Linux+MySQL+Tomcat', the database character set is UTF-8

mysql> use reportserver
Database changed
mysql> select * from RS_DATASOURCE_FOLDER;
+-------------+----------------------+-------+
| description | NAME_FIELD           | id    |
+-------------+----------------------+-------+
| NULL        | Datasource Root      |    10 |
| NULL        | internal datasources |    88 |
| NULL        | sample data          |   757 |
| NULL        | ??                   | 59932 |
+-------------+----------------------+-------+
4 rows in set (0.00 sec)

mysql> select @@character_set_database,@@collation_database;
+--------------------------+----------------------+
| @@character_set_database | @@collation_database |
+--------------------------+----------------------+
| utf8                     | utf8_general_ci      |
+--------------------------+----------------------+
1 row in set (0.00 sec)


I can use follow SQL statement to change the foldername  big_smile


mysql> update RS_DATASOURCE_FOLDER set NAME_FIELD = '测试' where id = '59932';
Query OK, 1 row affected (0.15 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> select * from RS_DATASOURCE_FOLDER;
+-------------+----------------------+-------+
| description | NAME_FIELD           | id    |
+-------------+----------------------+-------+
| NULL        | Datasource Root      |    10 |
| NULL        | internal datasources |    88 |
| NULL        | sample data          |   757 |
| NULL        | 测试                 | 59932 |
+-------------+----------------------+-------+
4 rows in set (0.00 sec)

Offline

#4 2016-06-12 09:03:05

Arno Mittelbach
datenwerke
Registered: 2012-02-14

Re: Chinese with Datasource FolderName and SQL-alias Name

Hi Gerry,

that would be a workaround, although not really a satisfactory one big_smile If you change the field in the database manually, does it correctly display in ReportServer?

Regrettably, there are many places where the encoding could be mixed up. For starters, have you configured Tomcat to start with -Dfile.encoding=UTF-8?

Could you post the log messages ReportServer outputs during startup? These contain the most important external configuration options.

Cheers,
Arno

Offline

#5 2016-06-12 09:44:41

gerry
Member
Registered: 2016-05-10

Re: Chinese with Datasource FolderName and SQL-alias Name

Hi Arno,
Many thanks for your advice. smile
I change the FolderName in Database, It correctly displayed in ReportServer, but referenced to TeamSpace, it display '????'.
I ensure that the tomcat is start with -Dfile.encoding=UTF8. Following is the systemd tomcat.service configuration:

[Unit]
Description=Apache Tomcat Web Application Container
After=network.target

[Service]
Type=forking

Environment=JAVA_HOME=/usr/lib/jvm/jdk1.8.0_92
Environment=CATALINA_PID=/usr/share/Tomcat/temp/tomcat.pid
Environment=CATALINA_HOME=/usr/share/Tomcat
Environment=CATALINA_BASE=/usr/share/Tomcat
Environment='CATALINA_OPTS=-Xms512M -Xmx4096M -server -XX:+UseParallelGC'
Environment='JAVA_OPTS=-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom -Dfile.encoding=UTF-8'

ExecStart=/usr/share/Tomcat/bin/startup.sh
ExecStop=/usr/share/Tomcat/bin/shutdown.sh

User=tomcat
Group=tomcat
RestartSec=10
Restart=always

[Install]
WantedBy=multi-user.target

                                                                                         
"/etc/systemd/system/tomcat.service" 25L, 665C



Tomcat Startup loginfo as following:
12-Jun-2016 17:23:29.107 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version:        Apache Tomcat/8.0.24
12-Jun-2016 17:23:29.109 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          Jul 1 2015 20:19:55 UTC
12-Jun-2016 17:23:29.110 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number:         8.0.24.0
12-Jun-2016 17:23:29.110 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Linux
12-Jun-2016 17:23:29.110 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            4.4.0-22-generic
12-Jun-2016 17:23:29.110 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          amd64
12-Jun-2016 17:23:29.111 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             /usr/lib/jvm/jdk1.8.0_92/jre
12-Jun-2016 17:23:29.112 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           1.8.0_92-b14
12-Jun-2016 17:23:29.112 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Oracle Corporation
12-Jun-2016 17:23:29.112 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         /usr/share/Tomcat
12-Jun-2016 17:23:29.119 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         /usr/share/Tomcat
12-Jun-2016 17:23:29.120 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/usr/share/Tomcat/conf/logging.properties
12-Jun-2016 17:23:29.121 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
12-Jun-2016 17:23:29.121 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.awt.headless=true
12-Jun-2016 17:23:29.121 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.security.egd=file:/dev/./urandom
12-Jun-2016 17:23:29.121 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dfile.encoding=UTF-8
12-Jun-2016 17:23:29.122 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xms512M
12-Jun-2016 17:23:29.122 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xmx4096M
12-Jun-2016 17:23:29.122 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:+UseParallelGC
12-Jun-2016 17:23:29.123 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.net.preferIPv4Stack=true
12-Jun-2016 17:23:29.123 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.endorsed.dirs=/usr/share/Tomcat/endorsed
12-Jun-2016 17:23:29.124 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/usr/share/Tomcat
12-Jun-2016 17:23:29.124 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/usr/share/Tomcat
12-Jun-2016 17:23:29.124 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/usr/share/Tomcat/temp
12-Jun-2016 17:23:29.125 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
12-Jun-2016 17:23:29.728 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-80"]
12-Jun-2016 17:23:29.812 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
12-Jun-2016 17:23:29.817 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
12-Jun-2016 17:23:29.827 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
12-Jun-2016 17:23:29.828 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 1943 ms
12-Jun-2016 17:23:29.896 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina
12-Jun-2016 17:23:29.897 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.24
12-Jun-2016 17:23:29.923 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /usr/share/Tomcat/webapps/examples
12-Jun-2016 17:23:31.403 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /usr/share/Tomcat/webapps/examples has finished in 1,467 ms
12-Jun-2016 17:23:31.404 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /usr/share/Tomcat/webapps/manager
12-Jun-2016 17:23:31.488 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /usr/share/Tomcat/webapps/manager has finished in 84 ms
12-Jun-2016 17:23:31.489 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /usr/share/Tomcat/webapps/docs
12-Jun-2016 17:23:31.544 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /usr/share/Tomcat/webapps/docs has finished in 55 ms
12-Jun-2016 17:23:31.545 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /usr/share/Tomcat/webapps/ROOT
12-Jun-2016 17:24:02.074 INFO [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
12-Jun-2016 17:25:05.716 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /usr/share/Tomcat/webapps/ROOT has finished in 94,171 ms
12-Jun-2016 17:25:05.718 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /usr/share/Tomcat/webapps/host-manager
12-Jun-2016 17:25:05.795 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /usr/share/Tomcat/webapps/host-manager has finished in 76 ms
12-Jun-2016 17:25:05.803 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-80"]
12-Jun-2016 17:25:05.823 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
12-Jun-2016 17:25:05.824 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 95995 ms

Offline

#6 2016-06-12 13:05:04

Arno Mittelbach
datenwerke
Registered: 2012-02-14

Re: Chinese with Datasource FolderName and SQL-alias Name

Did you configure logging to use a special reportserver.log file? If so, could you post that? The ReportServer specific logs are not included in the above output.

Offline

#7 2016-06-13 02:38:27

gerry
Member
Registered: 2016-05-10

Re: Chinese with Datasource FolderName and SQL-alias Name

Hi Arrno,

  Here is reportserver logging Info:
13-Jun-2016 10:31:14.668 INFO [localhost-startStop-1] net.datenwerke.rs.EnvironmentValidator.startup




  _____                       _    _____                         
|  __ \                     | |  / ____|                         
| |__) |___ _ __   ___  _ __| |_| (___   ___ _ ____   _____ _ __
|  _  // _ \ '_ \ / _ \| '__| __|\___ \ / _ \ '__\ \ / / _ \ '__|
| | \ \  __/ |_) | (_) | |  | |_ ____) |  __/ |   \ V /  __/ |   
|_|  \_\___| .__/ \___/|_|   \__|_____/ \___|_|    \_/ \___|_|   
            | |                                                   
            |_|                                                   

Version: RS3.0.2-5855 2016-05-29-17-55-24
Code Version: 2016-05-29-17-55-24
Java Version: Oracle Corporation Java HotSpot(TM) 64-Bit Server VM 25.92-b14 (1.8)
VM Args: -Djava.util.logging.config.file=/usr/share/Tomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom -Dfile.encoding=UTF-8 -Xms512M -Xmx4096M -XX:+UseParallelGC -Djava.net.preferIPv4Stack=true -Djava.endorsed.dirs=/usr/share/Tomcat/endorsed -Dcatalina.base=/usr/share/Tomcat -Dcatalina.home=/usr/share/Tomcat -Djava.io.tmpdir=/usr/share/Tomcat/temp
rs.configdir: Not Configured

### DB Config ###
hibernate.dialect: net.datenwerke.rs.utils.hibernate.MySQL5Dialect (OK)
hibernate.connection.driver_class: com.mysql.jdbc.Driver (OK)
hibernate.connection.url: jdbc:mysql://10.204.28.45:3306/ReportServer (OK)
hibernate.connection.username: rpt
hibernate.connection.password: **********
hibernate.default_schema:

Connection Test: OK
Schema Version: RS3.0-8

13-Jun-2016 10:31:14.691 INFO [localhost-startStop-1] net.datenwerke.rs.EnvironmentValidator.startup Validating database schema...
13-Jun-2016 10:31:28.970 INFO [localhost-startStop-1] net.datenwerke.rs.EnvironmentValidator.hibernateValidateSchema Schema validation completed
13-Jun-2016 10:31:39.074 WARNING [localhost-startStop-1] net.datenwerke.rs.configservice.service.configservice.ConfigServiceImpl.getConfigFailsafe Configfile scheduler/scheduler.cf could not be loaded. Default values are in effect.
13-Jun-2016 10:31:39.078 WARNING [localhost-startStop-1] net.datenwerke.rs.configservice.service.configservice.ConfigServiceImpl.getConfigFailsafe Configfile exportfilemd/pdfexport.cf could not be loaded. Default values are in effect.
13-Jun-2016 10:31:39.085 WARNING [localhost-startStop-1] net.datenwerke.rs.configservice.service.configservice.ConfigServiceImpl.getConfigFailsafe Configfile exportfilemd/pdfexport.cf could not be loaded. Default values are in effect.
13-Jun-2016 10:31:40.395 SEVERE [localhost-startStop-1] org.apache.catalina.session.StandardManager.doLoad standardManager.loading.cnfe
java.lang.ClassNotFoundException: ch.qos.logback.classic.Logger
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1313)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1164)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:348)
    at org.apache.catalina.util.CustomObjectInputStream.resolveClass(CustomObjectInputStream.java:74)
    at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1620)
    at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1521)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1781)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1353)
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2018)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1942)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1808)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1353)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:373)
    at org.apache.catalina.session.StandardSession.doReadObject(StandardSession.java:1634)
    at org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:1099)
    at org.apache.catalina.session.StandardManager.doLoad(StandardManager.java:261)
    at org.apache.catalina.session.StandardManager.load(StandardManager.java:180)
    at org.apache.catalina.session.StandardManager.startInternal(StandardManager.java:460)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5184)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1101)
    at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1786)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

13-Jun-2016 10:31:40.407 SEVERE [localhost-startStop-1] org.apache.catalina.session.StandardManager.startInternal Exception loading sessions from persistent storage
java.lang.ClassNotFoundException: ch.qos.logback.classic.Logger
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1313)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1164)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:348)
    at org.apache.catalina.util.CustomObjectInputStream.resolveClass(CustomObjectInputStream.java:74)
    at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1620)
    at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1521)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1781)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1353)
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2018)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1942)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1808)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1353)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:373)
    at org.apache.catalina.session.StandardSession.doReadObject(StandardSession.java:1634)
    at org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:1099)
    at org.apache.catalina.session.StandardManager.doLoad(StandardManager.java:261)
    at org.apache.catalina.session.StandardManager.load(StandardManager.java:180)
    at org.apache.catalina.session.StandardManager.startInternal(StandardManager.java:460)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5184)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1101)
    at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1786)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

13-Jun-2016 10:31:55.171 INFO [localhost-startStop-1] net.datenwerke.rs.core.service.i18ntools.RemoteMessageServiceImpl.<init> Loading messages...
13-Jun-2016 10:31:55.435 INFO [Thread-11] net.datenwerke.rs.core.service.jarextension.hookers.ReportServerExtenderHooker.initialize Start loading ReportServer extensions.
13-Jun-2016 10:32:00.020 INFO [Thread-11] net.datenwerke.rs.search.service.search.SearchServiceImpl.rebuildIndex Rebuilding search index...
13-Jun-2016 10:32:12.824 INFO [localhost-startStop-1] net.datenwerke.rs.core.service.i18ntools.RemoteMessageServiceImpl.<init> Available locales: de, ru, fi, pt, bg, keys, lt, hr, lv, fr, hu, zh-CN, sk, sl, ga, sv, zh-TW, el, mt, en, it, es, et, cs, pl, da, ro, nl
13-Jun-2016 10:32:14.555 INFO [Thread-11] net.datenwerke.gf.service.lateinit.LateInitStartup$1.run Startup completed

Offline

#8 2016-06-14 06:07:56

Arno Mittelbach
datenwerke
Registered: 2012-02-14

Re: Chinese with Datasource FolderName and SQL-alias Name

Hi Gerry,

one idea is that your MySQL configuration is such that connections are not UTF-8 by default. To force connections to use UTF-8 you can adapt the JDBC URL in the persistence.properties file. Could you try the following JDBC URL

jdbc:mysql://10.204.28.45:3306/ReportServer?useUnicode=true&characterEncoding=UTF-8

Could you also post the result of the following query?

show variables like 'char%';

Cheers
Arno

Offline

#9 2016-06-16 01:47:37

gerry
Member
Registered: 2016-05-10

Re: Chinese with Datasource FolderName and SQL-alias Name

Hi Arno,
Thank you for your help

This is going to be very useful when I add "?useUnicode=true&characterEncoding=UTF-8" to JDBC URL in persistence.properties file.

mysql> show variables like 'char%';
+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | utf8                       |
| character_set_connection | utf8                       |
| character_set_database   | utf8                       |
| character_set_filesystem | binary                     |
| character_set_results    | utf8                       |
| character_set_server     | latin1                     |
| character_set_system     | utf8                       |
| character_sets_dir       | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.06 sec)

Once again thank you for your valuable support. smile

Best Regards,
Gerry

Offline

#10 2016-06-16 06:31:59

Arno Mittelbach
datenwerke
Registered: 2012-02-14

Re: Chinese with Datasource FolderName and SQL-alias Name

Hi Gerry,

good to hear that its working.

As an explanation: The reason you need to force the connection to use UTF8 is that your server's default character set is latin1 rather than UTF8 (see character_set_server variable).

Best Regards,
Arno

Offline

Board footer

Powered by FluxBB