• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

LOg4j error in JSP page running on SUNONE

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
IN an application running on SunOne App Server,am using log4j for error logging.
The JSP code(Login.jsp) is as follows
<%@page import="org.apache.log4j.Category"%>
<%!
static Category logger = Category.getInstance("login.jsp");
logger.debug("in Login.jsp");
%>

The log4j properties is set as follows
log4j.rootCategory=debug, stdout, R
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
# Pattern to output the caller's file name and line number.
log4j.appender.stdout.layout.ConversionPattern=[%d] %3p (%F:%L) - %m%n
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=test.log
log4j.appender.R.MaxFileSize=100KB
# Keep one backup file
log4j.appender.R.MaxBackupIndex=1
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=[%d] %3p (%F:%L) - %m%n
# Print only messages of level WARN or above in the package com.foo.
#log4j.logger.com.ge.erc.hipaa=WARN
But still,the messages are not logged in test.log.
In the above case,where does the debug information get logged?
How can i locate the file where it is logged?
When the checked the server.log i found the following error.

[09/Jan/2004:15:39:36] WARNING ( 1856): CORE3283: stderr: java.lang.ClassNotFoundException: org.apache.log4j.ConsoleAppender
[09/Jan/2004:15:39:36] WARNING ( 1856): CORE3283: stderr: at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
[09/Jan/2004:15:39:36] WARNING ( 1856): CORE3283: stderr: at java.security.AccessController.doPrivileged(Native Method)
[09/Jan/2004:15:39:36] WARNING ( 1856): CORE3283: stderr: at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
[09/Jan/2004:15:39:36] WARNING ( 1856): CORE3283: stderr: at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
[09/Jan/2004:15:39:36] WARNING ( 1856): CORE3283: stderr: at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
[09/Jan/2004:15:39:36] WARNING ( 1856): CORE3283: stderr: at java.lang.ClassLoader.loadClass(ClassLoader.java:262)
[09/Jan/2004:15:39:36] WARNING ( 1856): CORE3283: stderr: at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:322)
[09/Jan/2004:15:39:36] WARNING ( 1856): CORE3283: stderr: at java.lang.Class.forName0(Native Method)
[09/Jan/2004:15:39:36] WARNING ( 1856): CORE3283: stderr: at java.lang.Class.forName(Class.java:130)
[09/Jan/2004:15:39:36] WARNING ( 1856): CORE3283: stderr: at org.apache.log4j.helpers.OptionConverter.instantiateByClassName(OptionConverter.java:195)
[09/Jan/2004:15:39:36] WARNING ( 1856): CORE3283: stderr: at org.apache.log4j.helpers.OptionConverter.instantiateByKey(OptionConverter.java:89)
[09/Jan/2004:15:39:36] WARNING ( 1856): CORE3283: stderr: at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:574)
[09/Jan/2004:15:39:36] WARNING ( 1856): CORE3283: stderr: at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:555)
[09/Jan/2004:15:39:36] WARNING ( 1856): CORE3283: stderr: at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:462)
[09/Jan/2004:15:39:36] WARNING ( 1856): CORE3283: stderr: at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:388)
[09/Jan/2004:15:39:36] WARNING ( 1856): CORE3283: stderr: at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:300)
[09/Jan/2004:15:39:36] WARNING ( 1856): CORE3283: stderr: at org.apache.log4j.PropertyConfigurator.configure(PropertyConfigurator.java:308)
[09/Jan/2004:15:39:36] WARNING ( 1856): CORE3283: stderr: at com.ge.erc.hipaa.util.HiPAAInit.init(HiPAAInit.java:22)
[09/Jan/2004:15:39:36] WARNING ( 1856): CORE3283: stderr: at javax.servlet.GenericServlet.init(GenericServlet.java:258)
[09/Jan/2004:15:39:36] WARNING ( 1856): CORE3283: stderr: at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:921)
[09/Jan/2004:15:39:36] WARNING ( 1856): CORE3283: stderr: at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:813)
[09/Jan/2004:15:39:37] WARNING ( 1856): CORE3283: stderr: at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3346)
[09/Jan/2004:15:39:37] WARNING ( 1856): CORE3283: stderr: at org.apache.catalina.core.StandardContext.start(StandardContext.java:3592)
[09/Jan/2004:15:39:37] WARNING ( 1856): CORE3283: stderr: at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
[09/Jan/2004:15:39:37] WARNING ( 1856): CORE3283: stderr: at org.apache.catalina.core.StandardHost.start(StandardHost.java:638)
[09/Jan/2004:15:39:37] WARNING ( 1856): CORE3283: stderr: at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
[09/Jan/2004:15:39:37] WARNING ( 1856): CORE3283: stderr: at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:345)
[09/Jan/2004:15:39:37] WARNING ( 1856): CORE3283: stderr: at org.apache.catalina.startup.Embedded.start(Embedded.java:957)
[09/Jan/2004:15:39:37] WARNING ( 1856): CORE3283: stderr: at com.iplanet.ias.web.WebContainer.start(WebContainer.java:426)
[09/Jan/2004:15:39:37] WARNING ( 1856): CORE3283: stderr: at com.iplanet.ias.web.WebContainer.startInstance(WebContainer.java:514)
[09/Jan/2004:15:39:37] WARNING ( 1856): CORE3283: stderr: at com.iplanet.ias.server.J2EERunner.confPostInit(J2EERunner.java:170)
[09/Jan/2004:15:39:37] WARNING ( 1856): CORE3283: stderr: log4j:ERROR Could not instantiate appender named "stdout".
[09/Jan/2004:15:40:07] WARNING ( 1856): CORE3283: stderr: log4j:WARN No appenders could be found for logger (login.jsp).
[09/Jan/2004:15:40:07] WARNING ( 1856): CORE3283: stderr: log4j:WARN Please initialize the log4j system properly.
Please suggest a soln
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure if this will help.
It turns out that S1AS has a bug using log4j in applications. It can be solved by adding the log4j.jar at [S1AS-install]/share/lib and adding the entry to the server's classpath in the admin console.
Let me know if it did help.
 
reply
    Bookmark Topic Watch Topic
  • New Topic