Uploaded image for project: 'Red Hat Process Automation Manager'
  1. Red Hat Process Automation Manager
  2. RHPAM-4853

Error creating custom log handler for RHPAM installed in the OCP environment

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 7.13.4.GA
    • None
    • None
    • False
    • None
    • False
    • Compatibility/Configuration, User Experience
    • Hide

      1) Create a custom log handler JAR and move it to business-central pod.

      2) From POD terminal run

      ~~~

      ./jboss-cli.sh

      ~~~

      3) Add module using below command

      ~~~

      module add --name=com.sudhish.customLogHandler --resources=/opt/target/customlogger-1.0-SNAPSHOT.jar

      ~~~


      4) Module gets added succesfully, you can verify it at location


      ~~~


      cd /opt/eap/modules/com/sudhish/
      customLogHandler/main

      ~~~

      5) Connect to jboss-cli and try adding custom log handler.

      ~~~

      [standalone@localhost:9990 /] /subsystem=logging/custom-handler=MY_LOGGER:add(name=MY_LOGGER,class=com.sudhish.CustomLogHandler,module=com.sudhish.customLogHandler)

      ~~~


      Command fails with below error


      {

          "outcome" => "failed",
          "failure-description" => "WFLYCTL0158: Operation handler failed: java.lang.IllegalArgumentException: Failed to load module \"com.sud
      hish.customLogHandler\" for handler \"MY_LOGGER\"",
          "rolled-back" => true
      {color:#222222}}

      Show
      1) Create a custom log handler JAR and move it to business-central pod. 2) From POD terminal run ~~~ ./jboss-cli.sh ~~~ 3) Add module using below command ~~~ module add --name=com.sudhish. customLogHandler --resources=/opt/target/ customlogger-1.0-SNAPSHOT.jar ~~~ 4) Module gets added succesfully, you can verify it at location ~~~ cd /opt/eap/modules/com/sudhish/ customLogHandler/main ~~~ 5) Connect to jboss-cli and try adding custom log handler. ~~~ [standalone@localhost:9990 /] /subsystem=logging/custom- handler=MY_LOGGER:add(name=MY_ LOGGER,class=com.sudhish. CustomLogHandler,module=com. sudhish.customLogHandler) ~~~ Command fails with below error {     "outcome" => "failed",     "failure-description" => "WFLYCTL0158: Operation handler failed: java.lang. IllegalArgumentException: Failed to load module \"com.sud hish.customLogHandler\" for handler \"MY_LOGGER\"",     "rolled-back" => true {color:#222222}}
    • ---
    • ---

      While trying to create a custom log handler for RHPAM installed (template installation) in the OCP 4.12 environment following EAP documentation.
       
      The logs handler addition seems to fail with below error.
      ~~~
      [sudnair@sudnair target]$ oc rsh rhpam-trial-kieserver-1-m6skb
      sh-4.4$ cd /opt/eap/bin/
      sh-4.4$ ./jboss-cli.sh
      You are disconnected at the moment. Type 'connect' to connect to the server or 'help' for the list of supported commands.
      [disconnected /] module add --name=com.sudhish.customLogHandler --resources=/opt/target/customlogger-1.0-SNAPSHOT.jar
      [disconnected /] connect
      [standalone@localhost:9990 /] /subsystem=logging/custom-handler=MY_LOGGER:add(name=MY_LOGGER,class=com.sudhish.CustomLogHandler,module=com.sudhish.customLogHandler)

      {     "outcome" => "failed",     "failure-description" => "WFLYCTL0158: Operation handler failed: java.lang.IllegalArgumentException: Failed to load module \"com.sud hish.customLogHandler\" for handler \"MY_LOGGER\"",     "rolled-back" => true }

      [standalone@localhost:9990 /]
      ~~~
       
      Module was added correctly and module.xml and jar is available at the correct location.
      ~~~ 
      sh-4.4$ cd /opt/eap/modules/com/sudhish/customLogHandler/main/
      sh-4.4$ ls -lrt
      total 8
      rw-rr-. 1 jboss root 3924 Nov  9 12:47 customlogger-1.0-SNAPSHOT.jar
      rw-rr-. 1 jboss root  219 Nov  9 12:47 module.xml

      ~~~
       
      In the pod logs (attached complete logs)rhpam-trial-kieserver-1-m6skb-rhpam-trial-kieserver (3).log we could see below error
       
      ~~~
      12:36:13,727 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 3) WFLYCTL0013: Operation ("add") failed - address: ([
       
      ("subsystem" => "logging"),
       
      ("custom-handler" => "MY_LOGGER")
       
      ]): java.lang.IllegalArgumentException: Failed to load module "com.sudhish.customLogHandler" for handler "MY_LOGGER"
       
      at org.jboss.logmanager.config.AbstractPropertyConfiguration.<init>(AbstractPropertyConfiguration.java:67)
       
      at org.jboss.logmanager.config.HandlerConfigurationImpl.<init>(HandlerConfigurationImpl.java:51)
       at org.jboss.logmanager.config.LogContextConfigurationImpl.addHandlerConfiguration(LogContextConfigurationImpl.java:143)
      .
      .
      .
      at org.jboss.threads@2.4.0.Final-redhat-00001//org.jboss.threads.JBossThread.run(JBossThread.java:513)
      Caused by: java.lang.NoClassDefFoundError: org/jboss/modules/ModuleLoader
      at org.jboss.logmanager.config.AbstractPropertyConfiguration$ModuleFinder.getClassLoader(AbstractPropertyConfiguration.java:579)
      at org.jboss.logmanager.config.AbstractPropertyConfiguration.<init>(AbstractPropertyConfiguration.java:64)

      ~~~
       
      Please note that the same step works fine for RHPAM on-premise installation.

              jakubschwan Jakub Schwan
              rhn-support-sudnair Sudhish Nair
              Dominik Hanak Dominik Hanak
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: