Uploaded image for project: 'Red Hat Decision Manager'
  1. Red Hat Decision Manager
  2. RHDM-45

"Debug As Drools Application" doesn't honour Eclipse encoding settings

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • 6.x.x
    • Eclipse Tooling
    • None

      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"

              kverlaen@redhat.com Kris Verlaenen
              rhn-support-tkobayas Toshiya Kobayashi
              Tomas David Tomas David
              Tomas David Tomas David
              Alessandro Lazarotti, Edson Tirelli, Marek Winkler (Inactive), Tomas David, Toshiya Kobayashi
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: