Description of problem: "Run As Java Application" honours Eclipse encoding settings, which you can configure at Workspace / Project / Run Configuration levels. But "Debug As Drools Application" picks up OS LOCALE regardless of Eclipse settings. Steps to Reproduce: 1. export LANG=C 2. Start JBDS 7 3. Import attached multi-byte-rulename.zip 4. Confirm that your project encoding is UTF-8 ([Resource]->"Text file encoding") 5. "Run As Java Application" DroolsTest. Confirm that file.encoding is UTF-8 --- file.encoding : UTF-8 SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. Hello World Goodbye cruel world --- 6. "Debug As Drools Application" DroolsTest Actual results: file.encoding is ANSI_X3.4-1968. Execution fails. --- file.encoding : ANSI_X3.4-1968 SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. java.lang.RuntimeException: Error while creating KieBase[Message [id=1, level=ERROR, path=rules/Sample.drl, line=20, column=0 text=Duplicate rule name: ???????????????]] at org.drools.compiler.kie.builder.impl.KieContainerImpl.getKieBase(KieContainerImpl.java:337) at org.drools.compiler.kie.builder.impl.KieContainerImpl.newKieSession(KieContainerImpl.java:486) at org.drools.compiler.kie.builder.impl.KieContainerImpl.newKieSession(KieContainerImpl.java:457) at com.sample.DroolsTest.main(DroolsTest.java:20) --- Expected results: file.encoding is UTF-8. Execution works. And you can debug DRL. Additional info: There are 2 workarounds. - Set UTF-8 as OS LOCALE (e.g. export LANG=ja_JP.UTF-8) before launching JBDS or - Set "-Dfile.encoding=UTF-8" in "VM arguments" section in "Arguments" tab in "Debug Configuration"
I followed the steps, but I cannot get the exception. I tried it on 6.0.1.Final and 6.1.0.Final and it works fine. I am not sure if I can verify this, because it can depend on different environment. Toshiya, could you test this issue on 6.1.0.Final, please? Thanks. Tomas D.
Created attachment 944434 [details] multi-byte-rulename.zip
Ohh, very sorry, I forgot to attach the example. Now attached (multi-byte-rulename.zip). I tested with: - JBDS 7.1.1 + Drools plugin (JBoss Drools Core 6.0.3.201406040014) - Eclipse Luna Service Release 1 (4.4.1) + Drools plugin (JBoss Drools Core 6.1.0.Final) and still reproduced in both versions. The main point is - If OS locale is not UTF-8, (export LANG=C) - "Debug As Drools Application" - file.encoding is picked from OS locale (ANSI_X3.4-1968) - The RuntimeException is a side effect of the wrong file.encoding So it's not very environment specific. I think you can reproduce the issue on your side as well. Could you try with the attached multi-byte-rulename.zip? Regards, Toshiya
Thank you Toshiya. I finally got the exception with attached zip. So the problem is still in 6.1.0.Final. Thanks again. Tomas D.