From log4j-user-return-29608-archive-asf-public=cust-asf.ponee.io@logging.apache.org Wed Apr 29 13:48:07 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 4183A180654 for ; Wed, 29 Apr 2020 15:48:07 +0200 (CEST) Received: (qmail 7545 invoked by uid 500); 29 Apr 2020 13:43:16 -0000 Mailing-List: contact log4j-user-help@logging.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Log4J Users List" Reply-To: "Log4J Users List" Delivered-To: mailing list log4j-user@logging.apache.org Received: (qmail 7453 invoked by uid 99); 29 Apr 2020 13:43:12 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Apr 2020 13:43:12 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id B22CBC21B6 for ; Wed, 29 Apr 2020 13:43:11 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-ec2-va.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id aGr_bDNxHmJu for ; Wed, 29 Apr 2020 13:43:09 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.166.195; helo=mail-il1-f195.google.com; envelope-from=boards@gmail.com; receiver= Received: from mail-il1-f195.google.com (mail-il1-f195.google.com [209.85.166.195]) by mx1-ec2-va.apache.org (ASF Mail Server at mx1-ec2-va.apache.org) with ESMTPS id 306B1BB8B2 for ; Wed, 29 Apr 2020 13:43:09 +0000 (UTC) Received: by mail-il1-f195.google.com with SMTP id i16so2389020ils.12 for ; Wed, 29 Apr 2020 06:43:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=gWEGuybT9Y+66BcRZQ93EXs2SBh411vs2UTFJ8y8yg4=; b=X9DgGksptQNwutOeVRATue5WJ1cQ+fg74lYdJgl2zVJylvsgz5Djxe+o81AitDIV43 cHJW/lHMjfCHW/uwcPNr2qikMmP2/tlCOWE/ekj0MbuRfWdfaxoho0ky8OxTyIvshpD2 HJww4c/yPbMN1cF5+zzbSzynHxSn01rFZJ2QCahSAC9GPQAMb6hcDj4Fdl8LpXPgh1E5 xMK9tSd9/Hg5KCi2Ta/kgBxEUi+nkP6g/5JzJ2YS+50RiDbETYyKJlV6nWxZU0fv9BjM rrpa7RP1GDz/cFEvg2XnLGlHg0Eau8SJiNEvxz03r4rDywr6MRFWGe9IPu0+I/JGJiRu RdkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=gWEGuybT9Y+66BcRZQ93EXs2SBh411vs2UTFJ8y8yg4=; b=T5PVMqoGoxhEBovYy/iDluUv569ZuhUzBFIGvNvBWz+1uP5laR4CygAvbE5KWmRPoj V8Rse1vOm5qdZCqEDqnb2cPXv0dx3YPKPhkkI5gOkZmGs9yVEGNC1mP9NHkWnQsfInHV AIR1LdYXvRE5JqJhSTqlKgX4jfDtkbjc1bPXLqjV//5g445EvbKGFYnzRlvfRJBS1NTc FqPzAc4LsHZtuVFR915/DOLcHYIUj3cFVPVJ6CrHSTGQ+2zbOTyeeZ8TpoztSD6q97Ge DZuG+AZMgr+9/OLeem9K38JEciEPUSjE7d+bUQYA7uB9qpblbo7jbqdgGGuntPa9Gc2m 3CkA== X-Gm-Message-State: AGi0Puax3HASGsefxL2RNEzAxnCdDQRPKwTQc9W73rRBYph4g8Z1ZVoJ DJK+9LaSCSKX4gbQxn/CgW+ILIriyvZQcGc+mxslUA== X-Google-Smtp-Source: APiQypI9WAt2+y+/1TErRmyiccNPutMXbBiJwTgoavKX8s5yq7Qp2hHYEnjMZOXl4HQNotF4potKy6NjrWoNN7yYA64= X-Received: by 2002:a92:7e4a:: with SMTP id z71mr32612138ilc.83.1588167788076; Wed, 29 Apr 2020 06:43:08 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Matt Sicker Date: Wed, 29 Apr 2020 08:42:57 -0500 Message-ID: Subject: Re: Java.lang.LinkageError To: Log4J Users List Content-Type: multipart/alternative; boundary="000000000000da24c605a46e2050" --000000000000da24c605a46e2050 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Also, if you=E2=80=99re trying to mock log4j2 in tests, you can always use = the LoggerContextRule from our test libraries to configure logging at the test level. On Wed, Apr 29, 2020 at 08:42 Matt Sicker wrote: > Sounds like you=E2=80=99ll need to configure PowerMock to ignore the log4= j2 JMX > classes. There=E2=80=99s also a system property in log4j2 to disable JMX = which is > worth a try. > > On Wed, Apr 29, 2020 at 08:34 EDMONDO SENA wrote: > >> I repeat, we've done some tests and with java 11, Junit 4 and Log4j 1 >> everything has worked well. >> The only difference is log4j -> log4j 2.13 and we've this problem. >> Can you suggest us what's the workaround? >> >> Kind regards. >> >> >> On 2020/04/29 13:32:17, EDMONDO SENA wrote: >> > Matt sorry, >> > >> > I need a solution! >> > >> > Before we were Java 8, and Log4j and everything has worked! >> > Well, now we've java 11 and Log4j 2. >> > How can we fix it? >> > Have you any suggest? >> > >> > >> > >> > >> > On 2020/04/29 13:29:04, Matt Sicker wrote: >> > > The JMX module isn=E2=80=99t fully compatible with Java 11 as far as= I can >> tell. It >> > > doesn=E2=80=99t even compile above 8. >> > > >> > > On Wed, Apr 29, 2020 at 07:17 EDMONDO SENA wrote= : >> > > >> > > > In API Document is reported this phrase: >> > > > >> > > > Enabling JMX >> > > > JMX support is enabled by default. When Log4j initializes, the >> > > > StatusLogger, ContextSelector, and all LoggerContexts, >> LoggerConfigs and >> > > > Appenders are instrumented with MBeans. To disable JMX completely, >> and >> > > > prevent these MBeans from being created, specify system property >> > > > log4j2.disableJmx to true when you start the Java VM. >> > > > >> > > > Can you explain me if the problem can be fixed set >> log4j2.disableJmx=3Dtrue >> > > > or using >> > > > @PowerMockIgnore("Javax.management.* ")? >> > > > >> > > > Or something else? >> > > > >> > > > >> > > > >> > > > On 2020/04/29 12:07:06, EDMONDO SENA wrote: >> > > > > Any question? >> > > > > >> > > > > I'm using Log4j 2.13.0....... >> > > > > >> > > > > >> > > > >> https://stackanswers.net/questions/powermock-after-log4j2-3-upgrade-coul= d-not-reconfigure-jmx-java-lang-linkageerror >> > > > > >> > > > > >> > > > > >> > > > > On 2020/04/29 11:55:32, EDMONDO SENA wrote: >> > > > > > Sorry, we're using Java 11, Junit 4 e Log4j 2! >> > > > > > >> > > > > > >> > > > > > On 2020/04/29 11:49:03, EDMONDO SENA wrote= : >> > > > > > > No It is not so! >> > > > > > > >> > > > > > > PowerMock with java 11 and Log4j old version (1), everything >> was >> > > > working. >> > > > > > > Adding Log4j 2 We've that problem... >> > > > > > > >> > > > > > > >> > > > > > > >> > > > > > > On 2020/04/29 11:33:24, Benjamin Asbach >> > > > wrote: >> > > > > > > > Hello Edmondo, >> > > > > > > > >> > > > > > > > I don't think this is an log4j related issue. >> > > > > > > > >> > > > > > > > You're using Powermock in combination with JUnit 5 which >> currently >> > > > is >> > > > > > > > not supported [1]. There's some kind of workaround [2] you >> might >> > > > try >> > > > > > > > that out. >> > > > > > > > >> > > > > > > > Greetings >> > > > > > > > Benjamin >> > > > > > > > >> > > > > > > > [1] https://github.com/powermock/powermock/issues/830 >> > > > > > > > [2] >> > > > > > > > >> > > > >> https://github.com/powermock/powermock/issues/830#issuecomment-616243661 >> > > > > > > > >> > > > > > > > On 2020-04-29 11:42, EDMONDO SENA wrote: >> > > > > > > > > Hi Everybody, >> > > > > > > > > >> > > > > > > > > I'm using log4j 2 with Junit 5 and java 11 with last >> version of >> > > > > > > > > PowerMock, but the following error is showed: >> > > > > > > > > >> > > > > > > > > "Could not reconfigure jmx >> > > > > > > > > java.lang.LinkageError: loader constraint violation : >> loader >> > > > > > > > > >> > > > org.powermock.core.classloader.javassist.JavassistMockClassLoader, >> > > > > > > > > child of 'app' >> jdk.internal.loader.ClassLoader$AppClassLoader >> > > > wants to >> > > > > > > > > load interface javax.management.MBeanServer." >> > > > > > > > > >> > > > > > > > > A different interface with the same name was previously >> loaded >> > > > by >> > > > > > > > > 'bootstrap'. >> > > > > > > > > >> > > > > > > > > Can you help me in order to fix this error? >> > > > > > > > > Kind regards. >> > > > > > > > > >> > > > > > > > > >> > > > >> --------------------------------------------------------------------- >> > > > > > > > > To unsubscribe, e-mail: >> > > > log4j-user-unsubscribe@logging.apache.org >> > > > > > > > > For additional commands, e-mail: >> > > > log4j-user-help@logging.apache.org >> > > > > > > > >> > > > > > > > >> > > > >> --------------------------------------------------------------------- >> > > > > > > > To unsubscribe, e-mail: >> log4j-user-unsubscribe@logging.apache.org >> > > > > > > > For additional commands, e-mail: >> > > > log4j-user-help@logging.apache.org >> > > > > > > > >> > > > > > > > >> > > > > > > >> > > > > > > >> --------------------------------------------------------------------- >> > > > > > > To unsubscribe, e-mail: >> log4j-user-unsubscribe@logging.apache.org >> > > > > > > For additional commands, e-mail: >> log4j-user-help@logging.apache.org >> > > > > > > >> > > > > > > >> > > > > > >> > > > > > >> --------------------------------------------------------------------- >> > > > > > To unsubscribe, e-mail: >> log4j-user-unsubscribe@logging.apache.org >> > > > > > For additional commands, e-mail: >> log4j-user-help@logging.apache.org >> > > > > > >> > > > > > >> > > > > >> > > > > >> --------------------------------------------------------------------- >> > > > > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.or= g >> > > > > For additional commands, e-mail: >> log4j-user-help@logging.apache.org >> > > > > >> > > > > >> > > > >> > > > >> --------------------------------------------------------------------- >> > > > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org >> > > > For additional commands, e-mail: log4j-user-help@logging.apache.or= g >> > > > >> > > > -- >> > > Matt Sicker >> > > >> > >> > --------------------------------------------------------------------- >> > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org >> > For additional commands, e-mail: log4j-user-help@logging.apache.org >> > >> > >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org >> For additional commands, e-mail: log4j-user-help@logging.apache.org >> >> -- > Matt Sicker > --=20 Matt Sicker --000000000000da24c605a46e2050--