Return-Path: X-Original-To: apmail-logging-log4j-user-archive@www.apache.org Delivered-To: apmail-logging-log4j-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C412817281 for ; Mon, 3 Nov 2014 21:05:17 +0000 (UTC) Received: (qmail 10053 invoked by uid 500); 3 Nov 2014 21:05:17 -0000 Delivered-To: apmail-logging-log4j-user-archive@logging.apache.org Received: (qmail 9994 invoked by uid 500); 3 Nov 2014 21:05:17 -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 9983 invoked by uid 99); 3 Nov 2014 21:05:17 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Nov 2014 21:05:17 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of ralph.goers@dslextreme.com designates 209.85.192.169 as permitted sender) Received: from [209.85.192.169] (HELO mail-pd0-f169.google.com) (209.85.192.169) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Nov 2014 21:05:12 +0000 Received: by mail-pd0-f169.google.com with SMTP id y10so12302682pdj.0 for ; Mon, 03 Nov 2014 13:04:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:content-transfer-encoding:message-id:references:to; bh=v6RwC8R52NQBcp/uha87ZgoIsNO0BCdYTucWHcm7IsI=; b=Aph3rrK3r8Idmxg4tAdxdOooE/VCRKxLapu7VKZGWoEsa1iUr5bsDt2qYmHbLjSXrc 0Hfkp3Zvd/nglGIJ+ReLYsrmeLOjfzEV2uTyQC6x5fsYrRNsKTTJLHnwr1GqrbCyp7P6 dqTIhJvCx2pmwi/pLRvDMwemv8cUYpuejlOfx4ttppPTfTJgVjVJReOGacJ40tyx3zS+ FFZNLLoSlxibISrgueTN9L8iOIQS/rYNChMqeanxolbsddVkLEtjuAfDc70PVIxyYp0+ tuVYRgftwqqcZQ7kYanK73+6gjNyhRU3/LyJxTIzLqAshGIkL53AGoyGtbtSUn4ickRe JwCA== X-Gm-Message-State: ALoCoQnKeQUdUTjP/gvOccx3So/IZXI1zEgPV8p8W3WFaqqrxkZEOSeOMl5dCgoQvcSydv9CB8n/ X-Received: by 10.66.138.72 with SMTP id qo8mr3269151pab.148.1415048691977; Mon, 03 Nov 2014 13:04:51 -0800 (PST) Received: from [10.0.45.224] ([208.93.128.118]) by mx.google.com with ESMTPSA id l6sm18035069pdr.39.2014.11.03.13.04.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 03 Nov 2014 13:04:51 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.0 \(1990.1\)) Subject: Re: lo4j2.xml in EAR From: Ralph Goers In-Reply-To: Date: Mon, 3 Nov 2014 14:04:49 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <739CE84C-F17F-4F17-857A-59B281866EEA@dslextreme.com> References: <2B744D79-B554-457C-929C-788820584E46@dslextreme.com> <0C317CE1-D756-4A93-A2E8-73069AE9197B@dslextreme.com> To: Log4J Users List X-Mailer: Apple Mail (2.1990.1) X-Virus-Checked: Checked by ClamAV on apache.org Do you have a =E2=80=9Ccaused by=E2=80=9D on the NoClassDefFoundError? =20= Ralph > On Nov 3, 2014, at 1:46 PM, Paul Benedict = wrote: >=20 > Right now my code cannot see the API classes; so I get a > NoClassDefFoundError. If I can see the classes, that will be a win :-) = even > if the functionality will fail. >=20 >=20 > Cheers, > Paul >=20 > On Mon, Nov 3, 2014 at 2:42 PM, Ralph Goers = > wrote: >=20 >> The Log4j API is going to look for its implementation. It does that = by >> looking for a property file using ClassLoader.getResources(). If that = file >> cannot be located because it is in a different ClassLoader then you = will >> have problems. >>=20 >> When you say it doesn=E2=80=99t work, what exactly is happening? >>=20 >> Ralph >>=20 >>> On Nov 3, 2014, at 12:51 PM, Paul Benedict = wrote: >>>=20 >>> The first smart thing to do in Wildfly 8.1 is install a common = instance >> of >>> log4j2. You do this by creating a module. Here are my steps: >>>=20 >>> 1. Go to /modules >>> 2. Create folders org/apache/log4j2/main >>> 3. Drop in the api jar. >>> 4. Create a module.xml with this content: >>>=20 >>> >>> >>> >>> >>> >>> >>>=20 >>> PS: I could have also dropped in the "core" jar but I am being >>> conservative. Since I can't get anything to work, this is the = minimal. >>>=20 >>> Then inside my ejb-jar project, I create myself a >>> META-INF/jboss-deployment-descriptor.xml file like this: >>>=20 >>> >>> >>> >>> >>> >>> >>> >>>=20 >>> That should automatically map the jar into my module's classpath. = I've >> done >>> this before but I am obviously missing something because it's not >> working. >>> If anyone can help by following these steps and figuring this out, = I'd be >>> happy to hear someone's success story. >>>=20 >>> Cheers, >>> Paul >>>=20 >>> On Sat, Nov 1, 2014 at 7:00 PM, Ralph Goers = >>>> wrote: >>>>=20 >>>>> I am not aware that we have implemented any specific support for = EARs. >>>>> That said, I am not sure we need to. I=E2=80=99ve also looked at = the Log4j 1.x >> code >>>>> and don=E2=80=99t see anything specific to supporting META-INF or = EARs. >>>>>=20 >>>>> Log4j will load log4j2.xml from the classpath, so you should be = able to >>>>> do something like what is described at >>>>> = https://developer.jboss.org/wiki/HowToPutAnExternalFileInTheClasspath >> < >>>>> = https://developer.jboss.org/wiki/HowToPutAnExternalFileInTheClasspath >>> . >>>>> I believe you can also place it in the /lib directory or whatever >> directory >>>>> is defined in the library-directory element of the deployment >> descriptor. >>>>> See >>>>>=20 >> = http://javahowto.blogspot.com/2006/10/use-library-directory-in-javaee-5-ap= ps.html >>>>> < >>>>>=20 >> = http://javahowto.blogspot.com/2006/10/use-library-directory-in-javaee-5-ap= ps.html >>>>>> . >>>>>=20 >>>>> What app server are you using? >>>>>=20 >>>>> Ralph >>>>>=20 >>>>>=20 >>>>>=20 >>>>>> On Nov 1, 2014, at 10:56 AM, Paul Benedict >>>>> wrote: >>>>>>=20 >>>>>> When I used log4j 1.x, I could put my log4j.xml in the >>>>> /META-INF >>>>>> folder and it was found. I did try this with log4j 2.0.2 and the >>>>>> configuration was not found. >>>>>>=20 >>>>>> I read this but it only talks about WARs. I don't have a WAR but = an >> EAR >>>>>> with EJB modules. >>>>>> http://logging.apache.org/log4j/2.x/manual/webapp.html >>>>>>=20 >>>>>> So is this feature missing in 2.x? Or did I do something wrong? >>>>>>=20 >>>>>> Cheers, >>>>>> Paul >>>>>=20 >>>>=20 >>=20 >>=20 >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org >> For additional commands, e-mail: log4j-user-help@logging.apache.org >>=20 >>=20 --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org For additional commands, e-mail: log4j-user-help@logging.apache.org