commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicholas Gianniotis <n...@acm.org>
Subject [logging] ClassCastException/InstantiationException from LogFactory.newFactory()
Date Mon, 27 Sep 2004 06:57:24 GMT
Hi,

I'm working with jwsdp-1.1, commons-logging (1.0.3, 1.0.4) and log4j
(1.2.7, 1.2.8) on a Solaris x86 (SunOS 5.8) platform with the Java
j2sdk1.4.2_04 environment.

When Tomcat comes up with the jwsdp out-of-the-box configuration,
org.apache.commons.logging.LogFactory() seems to choose
org.apache.commons.logging.impl.SimpleLog as the default logging
implementation.

I'm trying to get it to use Log4JLogger instead, but can't seem to be
able to.

Following the instructions "Choosing A LogFactory Implementation" in
the docs, I created a properties file named commons-logging.properties
visible in the application class path and defined the property
org.apache.commons.logging.LogFactory=Log4JLogger.

When I restart Tomcat (catalina.sh run), I get a
org.apache.commons.logging.LogConfigurationException:
java.lang.ClassCastException (full stack trace appended). I tried
several other implementation classes like Jdk14Logger, and there I got
similar errors: org.apache.commons.logging.LogConfigurationException:
java.lang.InstantiationException:
org.apache.commons.logging.impl.Jdk14Logger.

If anyone could suggest what steps I could take next to narrow down
the problem I'd be most grateful.

Thanks in advance,
Nico

Example (org.apache.commons.logging.LogFactory=Log4JLogger):

% /usr/local/jwsdp-1.1/bin/catalina.sh run
+ exec /hdd1/usr_local/j2sdk1.4.2_04/bin/java -classpath /usr/local/jwsdp-1.1/bin/../jwsdp-shared/lib/commons-logging.jar:/usr/local/jwsdp-1.1/bin/../jwsdp-shared/lib/log4j.jar:/usr/local/jwsdp-1.1/bin:/usr/local/jwsdp-1.1/bin/../jwsdp-shared/bin:/usr/local/jwsdp-1.1/bin/../jwsdp-shared/bin/commons-launcher.jar:/usr/local/jwsdp-1.1/bin/../jakarta-ant-1.5.1/lib/ant.jar:/usr/local/jwsdp-1.1/bin/../jakarta-ant-1.5.1/lib/optional.jar:/usr/local/jwsdp-1.1/bin/../jaxp-1.2.2/lib/jaxp-api.jar:/usr/local/jwsdp-1.1/bin/../jaxp-1.2.2/lib/endorsed/sax.jar:/usr/local/jwsdp-1.1/bin/../jaxp-1.2.2/lib/endorsed/dom.jar:/usr/local/jwsdp-1.1/bin/../jaxp-1.2.2/lib/endorsed/xercesImpl.jar:/usr/local/jwsdp-1.1/bin/../jaxp-1.2.2/lib/endorsed/xalan.jar
LauncherBootstrap jwsdp -DJAVA_HOME=/hdd1/usr_local/j2sdk1.4.2_04 -DCATALINA_OPTS=-Djava.security.debug=access,failure
run 
Executing the following command:
'/hdd1/usr_local/j2sdk1.4.2_04/jre/bin/java' '-Xmx128m' '-Dhttp.proxyHost=' '-Dhttp.proxyPort='
'-Dhttps.proxyHost=' '-Dhttps.proxyPort=' '-Dftp.proxyHost=' '-Dftp.proxyPort=' '-Djava.security.debug=access,failure'
'-DANT_HOME=/hdd1/usr_local/jwsdp-1.1/jakarta-ant-1.5.1' '-Djavax.xml.transform.TransformerFactory=org.apache.xalan.processor.TransformerFactoryImpl'
'-Dcatalina.base=/hdd1/usr_local/jwsdp-1.1' '-Djava.protocol.handler.pkgs=com.sun.net.ssl.internal.www.protocol'
'-Dcatalina.useNaming=true' '-Djsse.home=/hdd1/usr_local/jwsdp-1.1/jwsdp-shared' '-Dcatalina.home=/hdd1/usr_local/jwsdp-1.1'
'-Dorg.xml.sax.driver=org.apache.xerces.parsers.SAXParser' '-Dorg.xml.sax.parser=org.xml.sax.helpers.XMLReaderAdapter'
'-Djava.ext.dirs=/hdd1/usr_local/jwsdp-1.1/lib/ext:/hdd1/usr_local/j2sdk1.4.2_04/jre/jre/lib/ext'
'-Djava.endorsed.dirs=/hdd1/usr_local/jwsdp-1.1/jaxp-${jaxp-version}/lib/endorsed' '-Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl'
'-Dorg.apache.xindice.root-collection=/hdd1/usr_local/jwsdp-1.1/registry-server-1.0_04/Xindice/db'
'-Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl'
'-Djwsdp.home=/hdd1/usr_local/jwsdp-1.1' '-Dorg.apache.commons.launcher.heartbeatFile=/var/tmp/org.apache.commons.launcher.heartbeatFile.59218'
'-Dorg.apache.commons.launcher.waitForChild=' '-Djavax.naming.Context.INITIAL_CONTEXT_FACTORY=org.apache.naming.java.javaURLContextFactory'
'-classpath' '/hdd1/usr_local/jwsdp-1.1/jwsdp-shared/bin/commons-launcher.jar:/hdd1/usr_local/j2sdk1.4.2_04/lib/tools.jar:/hdd1/usr_local/jwsdp-1.1/bin:/hdd1/usr_local/jwsdp-1.1/bin/bootstrap.jar:/hdd1/usr_local/j2sdk1.4.2_04/lib/tools.jar:/hdd1/usr_local/j2sdk1.4.2_04/jre/lib/ext/localedata.jar:/hdd1/usr_local/jwsdp-1.1/jwsdp-shared/lib/activation.jar:/hdd1/usr_local/jwsdp-1.1/jwsdp-shared/lib/mail.jar:/hdd1/usr_local/jwsdp-1.1/jwsdp-shared/lib/commons-logging-jwsdp.jar:/hdd1/usr_local/jwsdp-1.1/jwsdp-shared/lib/log4j-1.2.7.jar:/hdd1/usr_local/jwsdp-1.1/jwsdp-shared/lib/jaas.jar:/hdd1/usr_local/jwsdp-1.1/jwsdp-shared/lib/jsse.jar:/hdd1/usr_local/jwsdp-1.1/jwsdp-shared/lib/jcert.jar:/hdd1/usr_local/jwsdp-1.1/jwsdp-shared/lib/jnet.jar:/hdd1/usr_local/jwsdp-1.1/jwsdp-shared/lib/providerutil.jar:/hdd1/usr_local/jwsdp-1.1/jwsdp-shared/lib/jax-qname.jar:/hdd1/usr_local/jwsdp-1.1/jwsdp-shared/lib/namespace.jar:/hdd1/usr_local/jwsdp-1.1/jstl-1.0.3/standard/lib/jaxen-full.jar:/hdd1/usr_local/jwsdp-1.1/jstl-1.0.3/standard/lib/jstl.jar:/hdd1/usr_local/jwsdp-1.1/jstl-1.0.3/standard/lib/saxpath.jar:/hdd1/usr_local/jwsdp-1.1/jstl-1.0.3/standard/lib/standard.jar:/hdd1/usr_local/jwsdp-1.1/jstl-1.0.3/tld:/hdd1/usr_local/jwsdp-1.1/jaxrpc-1.0.3/lib/jaxrpc-api.jar:/hdd1/usr_local/jwsdp-1.1/jaxrpc-1.0.3/lib/jaxrpc-ri.jar:/hdd1/usr_local/jwsdp-1.1/jaxp-1.2.2/lib/jaxp-api.jar:/hdd1/usr_local/jwsdp-1.1/jaxp-1.2.2/lib/endorsed/dom.jar:/hdd1/usr_local/jwsdp-1.1/jaxp-1.2.2/lib/endorsed/sax.jar:/hdd1/usr_local/jwsdp-1.1/jaxp-1.2.2/lib/endorsed/xalan.jar:/hdd1/usr_local/jwsdp-1.1/jaxp-1.2.2/lib/endorsed/xercesImpl.jar:/hdd1/usr_local/jwsdp-1.1/jaxp-1.2.2/lib/endorsed/xsltc.jar:/hdd1/usr_local/jwsdp-1.1/jaxb-1.0/lib/jaxb-api.jar:/hdd1/usr_local/jwsdp-1.1/jaxb-1.0/lib/jaxb-ri.jar:/hdd1/usr_local/jwsdp-1.1/jaxb-1.0/lib/jaxb-libs.jar:/hdd1/usr_local/jwsdp-1.1/jaxb-1.0/lib/jaxb-xjc.jar:/hdd1/usr_local/jwsdp-1.1/jaxb-1.0/lib/jaxb-api-doc.zip:/hdd1/usr_local/jwsdp-1.1/saaj-1.1.1/lib/dom4j.jar:/hdd1/usr_local/jwsdp-1.1/saaj-1.1.1/lib/saaj-api.jar:/hdd1/usr_local/jwsdp-1.1/saaj-1.1.1/lib/saaj-ri.jar:/hdd1/usr_local/jwsdp-1.1/jaxm-1.1.1/lib/jaxm-api.jar:/hdd1/usr_local/jwsdp-1.1/jaxm-1.1.1/lib/jaxm-runtime.jar:/hdd1/usr_local/jwsdp-1.1/jaxm-1.1.1/services/jaxm-provider/WEB-INF/lib/provider.jar:/hdd1/usr_local/jwsdp-1.1/jaxr-1.0_03/lib/castor-0.9.3.9-xml.jar:/hdd1/usr_local/jwsdp-1.1/jaxr-1.0_03/lib/fscontext.jar:/hdd1/usr_local/jwsdp-1.1/jaxr-1.0_03/lib/jaxr-api.jar:/hdd1/usr_local/jwsdp-1.1/jaxr-1.0_03/lib/jaxr-ri.jar:/hdd1/usr_local/jwsdp-1.1/jaxr-1.0_03/lib/soap.jar:/hdd1/usr_local/jwsdp-1.1/jaxr-1.0_03/lib/jaxr-apidoc.jar:/hdd1/usr_local/jwsdp-1.1/jakarta-ant-1.5.1/lib/ant.jar:/hdd1/usr_local/jwsdp-1.1/jakarta-ant-1.5.1/lib/optional.jar:/hdd1/usr_local/jwsdp-1.1/common/lib/naming-factory.jar:/hdd1/usr_local/jwsdp-1.1/common/lib/commons-collections.jar:/hdd1/usr_local/jwsdp-1.1/common/lib/commons-pool.jar:/hdd1/usr_local/jwsdp-1.1/common/lib/naming-resources.jar:/hdd1/usr_local/jwsdp-1.1/common/lib/naming-common.jar:/hdd1/usr_local/jwsdp-1.1/common/lib/jasper-compiler.jar:/hdd1/usr_local/jwsdp-1.1/common/lib/servlet.jar:/hdd1/usr_local/jwsdp-1.1/common/lib/jdbc2_0-stdext.jar:/hdd1/usr_local/jwsdp-1.1/common/lib/commons-dbcp.jar:/hdd1/usr_local/jwsdp-1.1/common/lib/jasper-runtime.jar:/hdd1/usr_local/jwsdp-1.1/common/lib/jta-spec1_0_1.jar:/hdd1/usr_local/jwsdp-1.1/common/lib/db2jcc.jar:/hdd1/usr_local/jwsdp-1.1/common/lib/mysql-connector-java-3.0.6-stable-bin.jar:/hdd1/usr_local/jwsdp-1.1/shared/classes'
'org.apache.catalina.startup.Bootstrap' 'start'
org.apache.commons.logging.LogConfigurationException: java.lang.ClassCastException
	at org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:549)
	at org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:337)
	at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:394)
	at org.apache.commons.digester.Digester.<init>(Digester.java:310)
	at org.apache.catalina.startup.Catalina.createStartDigester(Catalina.java:279)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:440)
	at org.apache.catalina.startup.Catalina.execute(Catalina.java:399)
	at org.apache.catalina.startup.Catalina.process(Catalina.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at org.apache.commons.launcher.ChildMain.run(ChildMain.java:269)
Caused by: java.lang.ClassCastException
	at org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:542)
	... 17 more


---------------------------------------------------------------------
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