16 January 2019

Log4j2 name JMX MBeans

To let name through JMX at MBeans, this can be assigned through

        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-web</artifactId>
            <version>${log4j2.version}</version>
            <scope>provided</scope>
        </dependency>
      
and can be customized:

    <context-param>
        <param-name>log4jContextName</param-name>
        <param-value>spring-mvc-simple-32-nombre</param-value>
    </context-param>


https://logging.apache.org/log4j/2.x/manual/webapp.html

It must be web.xml 3.0

15 January 2019

WebLogic log4j2 asm

At starting or deploying time the next exception can be thrown with WebLogic Server :

Caused By: java.lang.IllegalArgumentException
        at com.bea.objectweb.asm.ClassReader.(Unknown Source)

        at com.bea.objectweb.asm.ClassReader.(Unknown Source)
        at weblogic.application.utils.annotation.ClassInfoImpl.(ClassInfoImpl.java:41)
        at weblogic.application.utils.annotation.ClassfinderClassInfos.polulateOneClassInfo(ClassfinderClassInfos.java:240)
        at weblogic.application.utils.annotation.ClassfinderClassInfos.populateClassInfos(ClassfinderClassInfos.java:193)
        at weblogic.application.utils.annotation.ClassfinderClassInfos.(ClassfinderClassInfos.java:44)
        at weblogic.servlet.internal.War.initializeClassInfosIfNecessary(War.java:446)
        at weblogic.servlet.internal.War.getAnnotatedClasses(War.java:376)
        at weblogic.servlet.utils.WarUtils.isJsfApplication(WarUtils.java:258)
        at weblogic.servlet.internal.WebAppModule.detectJsfApplication(WebAppModule.java:277)
        at weblogic.servlet.internal.WebAppModule.init(WebAppModule.java:262)
        at weblogic.servlet.internal.WebAppModule.init(WebAppModule.java:682)
        at weblogic.application.internal.flow.ScopedModuleDriver.init(ScopedModuleDriver.java:162)
        at weblogic.application.internal.ExtensibleModuleWrapper.init(ExtensibleModuleWrapper.java:98)
        at weblogic.application.internal.flow.ModuleListenerInvoker.init(ModuleListenerInvoker.java:84)
        at weblogic.application.internal.flow.InitModulesFlow.initModule(InitModulesFlow.java:288)
        at weblogic.application.internal.flow.InitModulesFlow.initModules(InitModulesFlow.java:301)
        at weblogic.application.internal.flow.InitModulesFlow.prepare(InitModulesFlow.java:329)
        at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:706)
        at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:42)
        at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:237)
        at weblogic.application.internal.EarDeployment.prepare(EarDeployment.java:61)
        at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:158)
        at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:61)
        at weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.java:208)
        at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:98)
        at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:233)
        at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:749)
        at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1238)
        at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:252)
        at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:172)



This is caused by having .class bytecode bigger than accepted

Tag: ASM_5_0

        // checks the class version
        if (readShort(off + 6) > Opcodes.V1_8) {
            throw new IllegalArgumentException();
        }

  
One workaround is to remove the classes compiled with the newest bytecode (> 1.8 > 52)

more details:

https://issues.apache.org/jira/browse/LOG4J2-2124

http://mail-archives.apache.org/mod_mbox/logging-notifications/201711.mbox/%3CJIRA.13120226.1511356169000.299143.1511356200159@Atlassian.JIRA%3E

https://gitlab.ow2.org/asm


Blog Archive

Disclaimer

The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.