IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  webMethods Log4j2 async disruptor 3.x issue

    Posted Tue May 17, 2022 05:45 AM

    What product/components do you use and which version/fix level?

    webMethods Integration Server 10.5

    What are trying to achieve? Please describe in detail.

    Planning to use the log4j2 async logging , I tried to configure and create the service . But facing the error as mentioned below .

    Added the Jar file (disruptor-3.4.2.jar):

    Tried adding in Package/packageName/code/jars
    and also tried adding in the Integration Server/instances/default/lib/jars but no luck

    log4j.xml file :

    <?xml version="1.0" encoding="UTF-8"?> {"level":"%p","time":"%d{ISO8601}","thread":"%t","file":"%F","applicationData":%m}%n
    <Loggers>
    
    <AsyncLogger additivity="false" level="Info" name="InfoLogger">
    <AppenderRef ref="Log4jDemo"/>
    </AsyncLogger>
    <AsyncLogger additivity="false" level="Error" name="ErrorLogger">
    <AppenderRef ref="Log4jDemo"/>
    </AsyncLogger>
    
    </Loggers>
    

    Do you get any error messages? Please provide a full error message screenshot and log file.

    ------------------------------------------------------ERROR-----------------------------------------------------------------

    jvm 1 | 2022-05-16 15:14:35,157 Service Thread Pool ERROR Unable to invoke factory method in class org.apache.logging.log4j.core.async.AsyncLoggerConfig for element AsyncLogger: java.lang.NoClassDefFoundError: com/lmax/disruptor/EventFactory java.lang.reflect.InvocationTargetException
    jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    jvm 1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    jvm 1 | at java.lang.reflect.Method.invoke(Method.java:498)
    jvm 1 | at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:136)
    jvm 1 | at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:964)
    jvm 1 | at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:904)
    jvm 1 | at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:896)
    jvm 1 | at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:514)
    jvm 1 | at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:238)
    jvm 1 | at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:250)
    jvm 1 | at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:548)
    jvm 1 | at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:263)
    jvm 1 | at Log4jDemo.utils.java.init(java.java:83)
    jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    jvm 1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    jvm 1 | at java.lang.reflect.Method.invoke(Method.java:498)
    jvm 1 | at com.wm.app.b2b.server.JavaService.baseInvoke(JavaService.java:411)
    jvm 1 | at com.wm.app.b2b.server.invoke.InvokeManager.process(InvokeManager.java:739)
    jvm 1 | at com.wm.app.b2b.server.util.tspace.ReservationProcessor.process(ReservationProcessor.java:46)
    jvm 1 | at com.wm.app.b2b.server.invoke.StatisticsProcessor.process(StatisticsProcessor.java:61)
    jvm 1 | at com.wm.app.b2b.server.invoke.ServiceCompletionImpl.process(ServiceCompletionImpl.java:250)
    jvm 1 | at com.wm.app.b2b.server.invoke.ValidateProcessor.process(ValidateProcessor.java:56)
    jvm 1 | at com.wm.app.b2b.server.invoke.PipelineProcessor.process(PipelineProcessor.java:178)
    jvm 1 | at com.wm.app.b2b.server.ACLManager.process(ACLManager.java:334)
    jvm 1 | at com.wm.app.b2b.server.invoke.DispatchProcessor.process(DispatchProcessor.java:41)
    jvm 1 | at com.wm.app.b2b.server.AuditLogManager.process(AuditLogManager.java:401)
    jvm 1 | at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:611)
    jvm 1 | at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:423)
    jvm 1 | at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:381)
    jvm 1 | at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:253)
    jvm 1 | at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:122)
    jvm 1 | at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:81)
    jvm 1 | at com.wm.app.b2b.server.SessionInvoke.run(SessionInvoke.java:35)
    jvm 1 | at com.wm.util.pool.PooledThread.run(PooledThread.java:134)
    jvm 1 | at java.lang.Thread.run(Thread.java:748)
    jvm 1 | Caused by: java.lang.NoClassDefFoundError: com/lmax/disruptor/EventFactory
    jvm 1 | at org.apache.logging.log4j.core.config.AbstractConfiguration.getAsyncLoggerConfigDelegate(AbstractConfiguration.java:203)
    jvm 1 | at org.apache.logging.log4j.core.async.AsyncLoggerConfig.(AsyncLoggerConfig.java:91)
    jvm 1 | at org.apache.logging.log4j.core.async.AsyncLoggerConfig.createLogger(AsyncLoggerConfig.java:273)
    jvm 1 | … 37 more
    jvm 1 | Caused by: java.lang.ClassNotFoundException: com.lmax.disruptor.EventFactory cannot be found by org.apache.logging.log4j.core_2.11.2
    jvm 1 | at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:511)
    jvm 1 | at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)
    jvm 1 | at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:414)
    jvm 1 | at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:153)
    jvm 1 | at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    jvm 1 | … 40 more

    Please adivise


    #webMethods
    #Integration-Server-and-ESB


  • 2.  RE: webMethods Log4j2 async disruptor 3.x issue

    Posted Tue May 17, 2022 07:03 AM

    You need to move your jar to a sub-folder called static in your package and then restart the IS.
    Otherwise the jar is loaded by a private class loader that is only accessible from the package itself.
    Hence, why log4j can’t find the factory class.


    #webMethods
    #Integration-Server-and-ESB


  • 3.  RE: webMethods Log4j2 async disruptor 3.x issue

    Posted Tue May 17, 2022 07:26 AM

    Hi John,

    Thank you for your reply.
    I tried by moving the jar file to static folder but getting the same issue.

    I can see that the jar file is added to class path as shown in the below screen print . but the issue continue to occur


    #webMethods
    #Integration-Server-and-ESB


  • 4.  RE: webMethods Log4j2 async disruptor 3.x issue

    Posted Tue May 17, 2022 08:33 AM

    Are there any errors in the log file relating to the jar ?
    I checked the jar and it is 1.8 compatible, so that’s okay.
    thinking…
    Only thing I can think of is to verify the log4j minimum version required by disruptor and check that 10.5 is compliant. Also can you post your log4j.xml file, the above copy is displayed strangely.
    regards
    John.


    #webMethods
    #Integration-Server-and-ESB


  • 5.  RE: webMethods Log4j2 async disruptor 3.x issue

    Posted Wed May 18, 2022 03:14 AM

    Hi Jhon,

    Attached the log4j.xml file for your reference

    Thank you


    #Integration-Server-and-ESB
    #webMethods


  • 6.  RE: webMethods Log4j2 async disruptor 3.x issue

    Posted Thu May 19, 2022 03:46 AM

    Did you find any related errors in your log files when starting the server?
    either
    <SAG_HOME>/profiles/IS_default/logs/wrapper.log
    <SAG_HOME>/IntegrationServer/instances/default/logs/server.log

    Also did you check the log4j minimum version required by disruptor and the version of log4j in wm 10.5 ?

    regards,
    John.


    #Integration-Server-and-ESB
    #webMethods