Jboss 7.2 - [org.jboss.config] file.encoding - Jboss as windows service

问题描述 投票:0回答:1

我在尝试设置 file.encoding 为jboss。我正在尝试设置 file.encodingUTF-8 借助

JAVA_OPTS : -Dfile.encoding=UTF-8

每当我以交互式的方式运行jboss时,我都能在下面找到 server.log:

file.encoding = UTF-8

每当jboss以windows服务的形式运行时,我都能在以下地方找到 server.log:

file.encoding = Cp1252

standalone.xml我也定义了下面的系统属性(但不成功)。

<property name="file.encoding" value="UTF-8"/>

<property name="org.apache.catalina.connector.URI_ENCODING" value="UTF-8"/>

有谁知道我们需要在哪里做配置,才能有 file.encoding = UTF-8 当jboss作为一个windows服务运行时,我遇到了一些问题。

windows jboss
1个回答
0
投票

如果你使用脚本 bin/service.bat 将JBoss 7.2安装为Windows服务,然后通过以下方式启动服务器。standalone.bat. 这意味着启动选项可以在 bin/standalone.conf.bat.

有一个JAVA_OPTS任务块,在 bin/standalone.conf.bat 我在其中添加了以下两行

rem # Use UTF-8 as default encoding:
set "JAVA_OPTS=%JAVA_OPTS% -Dfile.encoding=UTF-8"

重启服务后,JBoss实例使用UTF-8作为默认编码。

© www.soinside.com 2019 - 2024. All rights reserved.