Uploaded image for project: 'camunda BPM'
  1. camunda BPM
  2. CAM-14878

Camunda 7.11.0 with log4j2 is suported?

    XMLWordPrintable

Details

    • Bug Report
    • Resolution: Cannot Reproduce
    • L3 - Default
    • None
    • None
    • camunda.org
    • None

    Description

      Hi,

      We have application where we are using camunda 7.16.0 with wildfly-23.0.2.Final. These changes are working with log4j2.

      1. In jboss-deployment-structure.xml
        <module name="org.apache.logging.log4j" export="true" />
      1. Created new module in module /logging/log4j/main/ and conent of module.xml as below

       

      <?xml version="1.0" encoding="UTF-8"?><module name="org.apache.logging.log4j" xmlns="urn:jboss:module:1.9"><properties><property name="jboss.api" value="public"/></properties><resources><resource-root path="log4j-1.2-api-2.17.1.jar"/><resource-root path="log4j-core-2.17.1.jar"/><resource-root path="log4j-api-2.17.1.jar"/></resources><dependencies><module name="javax.api" export="false"/><module name="javax.servlet.api"/></dependencies></module>

      1. In camunda-engine/main/module.xml added these modules

       

      <module name="org.apache.logging.log4j" />
      <module name="org.apache.log4j" />

      This is working as expected.

      From script node, I am referring log4j2 class

       

      var log=org.apache.logging.log4j.LogManager.getLogger("motive.utilities.javascript.JavaScriptLogger");log.debug("Test 1");

      var p = org.apache.log4j.Logger.getLogger("motive.utilities.javascript.JavaScriptLogger");
      p.debug("Test 2");

      But same script node and fix is not working with 7.11.0 and wildlfy 18.
      It is giving below error

       

      {{2022-09-14 18:28:19,843 ERROR [org.camunda.bpm.engine.context] (pool-10-thread-2) ENGINE-16006 BPMN Stack Trace:
      oryx_BE53DE70-4441-4A48-806D-3A832A043443 (activity-execute, ProcessInstance[e7e05ef5-342c-11ed-9aad-00059a3c7a00])
      oryx_BE53DE70-4441-4A48-806D-3A832A043443, name=BPMNScriptTask_2
      ^
       
      oryx_0BE96DD5-9B53-4C02-95C2-5C15107C9944, name=BPMNStartEvent_12022-09-14 18:28:19,843 ERROR [org.camunda.bpm.engine.context] (pool-10-thread-2) ENGINE-16004 Exception while closing command context: java.lang.ClassNotFoundException: org.apache.logging.log4j.LogManager.getLogger: java.lang.RuntimeException: java.lang.ClassNotFoundException: org.apache.logging.log4j.LogManager.getLogger
      at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:531)
      at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:456)
      at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:413)
      at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:409)
      at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngine.java:162)
      at java.scripting/javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:233)
      at org.camunda.bpm.camunda-engine@7.11.0//org.camunda.bpm.engine.impl.scripting.SourceExecutableScript.evaluateScript(SourceExecutableScript.java:125) at org.camunda.bpm.camunda-engine@7.11.0//org.camunda.bpm.engine.impl.scripting.SourceExecutableScript.evaluate(SourceExecutableScript.java:65) at org.camunda.bpm.camunda-engine@7.11.0//org.camunda.bpm.engine.impl.scripting.ExecutableScript.execute(ExecutableScript.java:63) at org.camunda.bpm.camunda-engine@7.11.0//org.camunda.bpm.engine.impl.scripting.env.ScriptingEnvironment.execute(ScriptingEnvironment.java:101) at org.camunda.bpm.camunda-engine@7.11.0//org.camunda.bpm.engine.impl.scripting.env.ScriptingEnvironment.execute(ScriptingEnvironment.java:87) at org.camunda.bpm.camunda-engine@7.11.0//org.camunda.bpm.engine.impl.delegate.ScriptInvocation.invoke(ScriptInvocation.java:47) at org.camunda.bpm.camunda-engine@7.11.0//org.camunda.bpm.engine.impl.delegate.DelegateInvocation.proceed(DelegateInvocation.java:58) at org.camunda.bpm.camunda-engine@7.11.0//org.camunda.bpm.engine.impl.delegate.DefaultDelegateInterceptor.handleInvocationInContext(DefaultDelegateInterceptor.java:92)}}

      Log4j2 is supported by Camunda in 7.11 version? Any input on this is highly appreciated.

      Thanks in advance.

      mgm-controller-panel

        This is the controller panel for Smart Panels app

        Attachments

          Activity

            People

              Unassigned Unassigned
              pbaddi pbaddi
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Salesforce