commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Kitching <skitch...@apache.org>
Subject Re: [logging] Problem isolated - get a LogConfigurationException when I have j2ee.jar in my project
Date Thu, 23 Jun 2005 09:56:19 GMT
On Tue, 2005-06-21 at 17:44 -0700, Jason Burrows wrote:
> Hi again -
> 
> I have isolated my problem.  It only happens when I include j2ee.jar. 
> It doesn't matter if I am using it or not.  If I don't include this
> jar, the call is fine 100% of the time, if I do include the jar
> (putting it in /jre/lib/ext/ or using Eclipse's 'add external jar...')
> then it will fail unless I am running a j2ee environment.  Obviously I
> don't need to include this jar generally, but it really annoying to
> have to remove it when ever I want to switch from developing my
> components for when they are running in tomcat to when they are
> running standalone.  Just to clarify - the exact same test code with
> only the one line will work when j2ee.jar is not available but will
> fail when it is available.
> 

This doesn't make sense to me. There is no way I can think of for the
presence of a jar whose classes are not being used to cause a null
pointer exception. 

Just to be paranoid I downloaded Sun's appserver (8.1) and tried it, and
could not duplicate your problem:

$ cat Foo.java
import org.apache.commons.logging.LogFactory;
import org.apache.commons.logging.Log;

public class Foo  {
        public static void main(String[] args)  throws Exception {
                Log log = LogFactory.getLog("Test");
                log.info("Hello, World");
        }
}
$ javac -classpath commons-logging-1.0.4.jar Foo.java
$ java -classpath commons-logging-1.0.4.jar:. Foo
23/06/2005 21:51:50 Foo main
INFO: Hello, World
$ java -classpath j2ee.jar:commons-logging-1.0.4.jar:. Foo
23/06/2005 21:51:56 Foo main
INFO: Hello, World



I have no idea what the cause of your problem is, but I am quite sure it
isn't the presence or absence of j2ee.jar. There's something else going
on, and I wish you luck figuring it out.

Regards,

Simon


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


Mime
View raw message