commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Stansberry <bes_commons_...@yahoo.com>
Subject Re: [logging] update docs to specify that java 1.1 is supported
Date Thu, 14 Apr 2005 05:08:02 GMT
No joy.  Doesn't run under JDK 1.1.  I wrote a simple
main method that calls LogFactory.getLog() and then
Log.info().  Call to LogFactory.getLog() fails with a
NoClassDefFoundError: java/security/PrivilegedAction.

java.security.AccessController isn't in 1.1 either.

Brian

--- Simon Kitching <skitching@apache.org> wrote:

> Hi Brian,
> 
> This code in LogFactory:
>     public static LogFactory getFactory() 
>       throws    LogConfigurationException {
> 
>         // Identify the class loader we will be
> using
>         ClassLoader contextClassLoader =
>            
> (ClassLoader)AccessController.doPrivileged(
>                 new PrivilegedAction() {
>                     public Object run() {
>                         return
> getContextClassLoader();
>                     }
>                 });
> 
> 
> actually calls a method named
> "getContextClassLoader" defined in the
> LogFactory class, *not*
> Thread.getContextClassLoader. The local
> "getContextClassLoader" method uses reflection to
> handle 1.1 jvms. On
> 1.1 JVMs, the classloader which loaded the current
> class is always
> returned (see "catch(NoSuchMethodException e)" on
> line 551 of
> LogFactory.java).
> 
> So I *think* everything currently works ok on 1.1
> jvms. I haven't tested
> it myself, though, so would be very interested in
> results of your
> testing.
> 
> Can you even *download* 1.1 JVMs these days??
> 
> Cheers,
> 
> Simon
> 
> PS: I'm back from my holidays now, and ready to get
> stuck into JCL
> (well, once recovered from my jetlag!).
> 
> On Wed, 2005-04-13 at 08:50 -0700, Brian Stansberry
> wrote:
> > LogFactory relies on
> Thread.getContextClassLoader(),
> > which didn't exist in the 1.1 JVM.  So, I wouldn't
> > expect JCL to run.  I played around with testing
> this
> > a while back (downloaded Sun's 1.1 JVM), but hit
> some
> > minor roadblock and stopped.  You're right -- this
> > should be clarified, particularly since it also
> > impacts design issues.  Tonight I'll get the test
> > working.  
> > 
> > Brian
> > 
> > --- Simon Kitching <skitching@apache.org> wrote:
> > 
> > > Hi, 
> > > 
> > > A user recently asked on the commons-user list
> > > whether JCL runs on java
> > > 1.1. I'm sure it is meant to, but I can't find
> > > anywhere in the docs
> > > myself that say what JVMs are supported.
> > > 
> > > So attached is a proposed patch to clarify this
> in
> > > the docs.
> > > Is everyone happy with this?
> > > 
> > > Cheers,
> > > 
> > > Simon
> > > > Index: xdocs/index.xml
> > >
> >
>
===================================================================
> > > --- xdocs/index.xml	(revision 161185)
> > > +++ xdocs/index.xml	(working copy)
> > > @@ -39,6 +39,9 @@
> > >  and contributors may write Log implementations
> for
> > > the library of
> > >  their choice.</p>
> > >  
> > > +<p>Jakarta Commons Logging supports all
> versions of
> > > java equal to or later
> > > +than java 1.1.</p>
> > > +
> > >  </section>
> > >  
> > >  
> > > Index: xdocs/guide.xml
> > >
> >
>
===================================================================
> > > --- xdocs/guide.xml	(revision 161185)
> > > +++ xdocs/guide.xml	(working copy)
> > > @@ -92,6 +92,10 @@
> > >  logging abstraction, that allows the user
> > > (application developer) to plug in
> > >  a specific logging implementation.
> > >      </p>
> > > +
> > > +<p>JCL supports all versions of java equal to
> or
> > > later
> > > +than java 1.1.</p>
> > > +
> > >  <p>JCL provides thin-wrapper <code>Log</code>
> > > implementations for
> > >  other logging tools, including
> > >  <a
> > >
> >
>
href="http://jakarta.apache.org/log4j/docs/index.html">Log4J</a>,
> > > > Index:
> > > src/java/org/apache/commons/logging/package.html
> > >
> >
>
===================================================================
> > > ---
> src/java/org/apache/commons/logging/package.html
> > > (revision 161185)
> > > +++
> src/java/org/apache/commons/logging/package.html
> > > (working copy)
> > > @@ -43,6 +43,8 @@
> > >      System.err.</li>
> > >  </ul>
> > >  
> > > +<p>This library is intended to run on any JVM
> equal
> > > to or later than 
> > > +version 1.1.</p>
> > >  
> > >  <h3>Quick Start Guide</h3>
> > >  
> > > 
> > > >
> >
>
---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > > commons-dev-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail:
> > commons-dev-help@jakarta.apache.org
> > 
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> > http://mail.yahoo.com 
> 
> 



		
__________________________________ 
Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message