Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1108994

Summary: "Debug As Drools Application" doesn't honour Eclipse encoding settings
Product: [Retired] JBoss BRMS Platform 6 Reporter: Toshiya Kobayashi <tkobayas>
Component: Eclipse ToolingAssignee: Kris Verlaenen <kverlaen>
Status: CLOSED EOL QA Contact: Tomas David <tdavid>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0.1CC: alazarot, etirelli, mwinkler, tdavid, tkobayas
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-27 20:01:14 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
multi-byte-rulename.zip none

Description Toshiya Kobayashi 2014-06-13 04:34:23 UTC
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"

Comment 1 Tomas David 2014-10-06 10:21:29 UTC
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.

Comment 2 Toshiya Kobayashi 2014-10-07 01:34:37 UTC
Created attachment 944434 [details]
multi-byte-rulename.zip

Comment 3 Toshiya Kobayashi 2014-10-07 01:37:01 UTC
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

Comment 4 Tomas David 2014-10-07 07:38:35 UTC
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.