Return-Path: Delivered-To: apmail-felix-dev-archive@www.apache.org Received: (qmail 64877 invoked from network); 7 Jul 2008 14:38:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Jul 2008 14:38:26 -0000 Received: (qmail 39171 invoked by uid 500); 7 Jul 2008 14:38:27 -0000 Delivered-To: apmail-felix-dev-archive@felix.apache.org Received: (qmail 38992 invoked by uid 500); 7 Jul 2008 14:38:25 -0000 Mailing-List: contact dev-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list dev@felix.apache.org Received: (qmail 38981 invoked by uid 99); 7 Jul 2008 14:38:25 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Jul 2008 07:38:25 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [71.16.158.232] (HELO exch01.praxiseng.com) (71.16.158.232) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Jul 2008 14:37:30 +0000 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Subject: RE: using pax-logger/log4j in embedded felix (class loader issue) Content-Transfer-Encoding: quoted-printable Date: Mon, 7 Jul 2008 10:37:29 -0400 x-mimeole: Produced By Microsoft Exchange V6.5 Message-ID: <9E8C2EE38A83804B8A7CD8F5C5D6BA91CA949B@exch01.praxislan01.com> In-Reply-To: <487a994c0807070710x260c5a1w67c8beb013ee1c21@mail.gmail.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: using pax-logger/log4j in embedded felix (class loader issue) Thread-Index: AcjgO1MnQcxlxF6jR0GC7KgpwaxFTAAAmZ3g References: <9E8C2EE38A83804B8A7CD8F5C5D6BA91CA9402@exch01.praxislan01.com> <487a994c0807070433v7b6f54na1a22028ece17123@mail.gmail.com> <9E8C2EE38A83804B8A7CD8F5C5D6BA91CA940E@exch01.praxislan01.com> <487a994c0807070710x260c5a1w67c8beb013ee1c21@mail.gmail.com> From: "Craig Phillips" To: X-Virus-Checked: Checked by ClamAV on apache.org Karl, I can send you a zip in a few... Re: strange... yeah... I want to believe that I should not have any class loader issues in OSGi in that I simply rely on the manifests and then "world is good"... Of course, I rely on the BND tool, which I couldn't live without, incidentally (I avoid maven like the plague, but that's another discussion)... In my list parameter, I just do the Main.loadProperties() and then add my Felix config.properties from before.... Now, Pax-Logger et al is very heavyweight, and it uses the following config: log4j.rootLogger=3DDEBUG, A8 log4j.appender.A8=3Dorg.apache.log4j.ConsoleAppender log4j.appender.A8.layout=3Dorg.apache.log4j.PatternLayout I'll try to whip up a zip in a few... thanks, Craig -----Original Message----- From: Karl Pauls [mailto:karlpauls@gmail.com]=20 Sent: Monday, July 07, 2008 10:11 AM To: dev@felix.apache.org Subject: Re: using pax-logger/log4j in embedded felix (class loader issue) Strange. Somehow a class is loaded from the outside and then used inside a bundle... Are you maybe bridging something from the outside to the inside (maybe via the list parameter in the felix constructor)? Can you make an example that fails available to me (either send it to me directly or create a jira issue and attach it there)? regards, Karl On Mon, Jul 7, 2008 at 1:44 PM, Craig Phillips wrote: > Hi, > > Hmmm... looks like the dev mailing list doesn't like attachments... OK, > I'll copy/paste the thing in... again, this would work if you run > felix.jar standalone... I'm not going to do all the jre entries, they > go on forever... Craig > > org.osgi.framework.system.packages=3Dorg.osgi.framework; = version=3D1.3.0, \ > org.osgi.service.packageadmin; version=3D1.2.0, \ > org.osgi.service.startlevel; version=3D1.0.0, \ > org.osgi.service.url; version=3D1.0.0, \ > org.osgi.util.tracker; version=3D1.3.2 \ > ${jre-${java.specification.version}} > > # > # LCP - This next section of entries are the entries that are typically > edited: > # file:../webapps/craigbox/WEB-INF/lib/pax-logging-service-1.0.0.jar \ > # > felix.auto.start.1=3D \ > file:../webapps/craigbox/WEB-INF/lib/org.apache.felix.shell-1.0.1.jar \ > file:../webapps/craigbox/WEB-INF/lib/org.osgi.compendium-1.0.1.jar \ > file:../webapps/craigbox/WEB-INF/lib/org.apache.felix.scr-1.0.0.jar \ > > file:../webapps/craigbox/WEB-INF/lib/org.apache.felix.configadmin-1.0.1. > jar \ > file:../webapps/craigbox/WEB-INF/lib/pax-confman-propsloader-0.2.1.jar > \ > file:../webapps/craigbox/WEB-INF/lib/pax-logging-api-1.0.0.jar \ > file:../webapps/craigbox/WEB-INF/lib/org.craig.play.Play01.jar > felix.cache.profile=3Dfelix_starter > felix.cache.dir=3D../webapps/craigbox/WEB-INF/felix_cache > felix.embedded.execution=3Dtrue > > felix.log.level=3D4 > felix.startlevel.framework=3D1 > felix.startlevel.bundle=3D1 > osgi.shell.telnet=3Don > #felix.service.urlhandlers=3Dfalse > #org.osgi.framework.bootdelegation=3Dsun.*,com.sun.* > > # > # Bundle config properties. > # > org.osgi.service.http.port=3D8080 > osgi.shell.telnet=3Don > #obr.repository.url=3Dhttp://bundles.osgi.org/obr/browse?_xml=3D1&cmd=3Dr= eposi > tory > > > # > # Java platform package export properties. > # > jre-1.3=3D, \ > javax.accessibility; \ > javax.naming; \ > javax.naming.directory; \ > javax.naming.event; \ > etc etc etc > > -----Original Message----- > From: Karl Pauls [mailto:karlpauls@gmail.com] > Sent: Monday, July 07, 2008 7:33 AM > To: dev@felix.apache.org > Subject: Re: using pax-logger/log4j in embedded felix (class loader > issue) > > Could you maybe post your complete config.properties? > > regards, > > Karl > > On Mon, Jul 7, 2008 at 12:59 PM, Craig Phillips > wrote: >> Hi, I probably need to direct this to PAX, but I'll try here (felix > dev) >> first... Sorry to trouble you, if anyone with felix class loader >> intimacy could take a look, I'd be appreciative... for a logger, this >> isn't critical and I'll probably just write my own simple FileLogger >> that implements LogService, but I suspect there are bigger issues at >> play... Some background... >> >> >> >> I'm embedding felix in a class that is being run within a tomcat > web-app >> (dot.jsp initiated - just as a driver/tester); Hence, I'm doing a 'new >> Felix(map, list)' and invoking the 'felix.start()' method... Here's my >> config.properties auto.start list: >> >> >> >> file:../webapps/craigbox/WEB-INF/lib/org.apache.felix.shell-1.0.1.jar > \ >> >> file:../webapps/craigbox/WEB-INF/lib/org.osgi.compendium-1.0.1.jar \ >> >> file:../webapps/craigbox/WEB-INF/lib/org.apache.felix.scr-1.0.0.jar \ >> >> > file:../webapps/craigbox/WEB-INF/lib/org.apache.felix.configadmin-1.0.1. >> jar \ >> >> file:../webapps/craigbox/WEB-INF/lib/pax-confman-propsloader-0.2.1.jar > \ >> >> file:../webapps/craigbox/WEB-INF/lib/pax-logging-api-1.0.0.jar \ >> >> file:../webapps/craigbox/WEB-INF/lib/pax-logging-service-1.0.0.jar \ >> >> file:../webapps/craigbox/WEB-INF/lib/org.craig.play.Play01.jar >> >> >> >> Anyway, here are the applicable ERROR log entries, seemingly coming > from >> pax: >> >> >> >> log4j:ERROR A "org.apache.log4j.ConsoleAppender" object is not >> assignable to a " >> >> org.apache.log4j.Appender" variable. >> >> log4j:ERROR The class "org.apache.log4j.Appender" was loaded by >> >> log4j:ERROR [7.0] whereas object of type >> >> log4j:ERROR "org.apache.log4j.ConsoleAppender" was loaded by >> [WebappClassLoader >> >> delegate: false >> >> repositories: >> >> ----------> Parent Classloader: >> >> org.apache.catalina.loader.StandardClassLoader@d1e604 >> >> ]. >> >> log4j:ERROR Could not instantiate appender named "A1". >> >> *DEBUG* Scheduling task ManagedService Update: > pid=3Dorg.ops4j.pax.logging >> >> *DEBUG* Running task ManagedService Update: = pid=3Dorg.ops4j.pax.logging >> >> log4j:ERROR A "org.apache.log4j.ConsoleAppender" object is not >> assignable to a " >> >> org.apache.log4j.Appender" variable. >> >> log4j:ERROR The class "org.apache.log4j.Appender" was loaded by >> >> log4j:ERROR [7.0] whereas object of type >> >> log4j:ERROR "org.apache.log4j.ConsoleAppender" was loaded by >> [WebappClassLoader >> >> delegate: false >> >> repositories: >> >> ----------> Parent Classloader: >> >> org.apache.catalina.loader.StandardClassLoader@d1e604 >> >> ]. >> >> log4j:ERROR Could not instantiate appender named "A8". >> >> DEBUG: WIRE: 8.0 -> org.osgi.service.log -> 2.0 >> >> DEBUG: WIRE: 8.0 -> org.craig.shell.telnet -> 8.0 >> >> DEBUG: WIRE: 8.0 -> org.apache.felix.shell -> 1.0 >> >> DEBUG: WIRE: 8.0 -> org.osgi.service.component -> 2.0 >> >> log4j:WARN No appenders could be found for logger >> (org.ops4j.pax.logging.pax-log >> >> ging-service). >> >> log4j:WARN Please initialize the log4j system properly. >> >> DEBUG: WIRE: 4.0 -> org.osgi.service.log -> 2.0 >> >> >> >> Any insight would be appreciated... not critical, but I suspect I'm > not >> going to see the last of class loader issues, especially in an > embedded >> environment... Thanks, Craig Phillips >> >> >> >> > > > > -- > Karl Pauls > karlpauls@gmail.com > --=20 Karl Pauls karlpauls@gmail.com