• 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

Help! I am getting strange and unusual Eclipse Warnings

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Please tell me what to do.<Gasp!>
I am using an application called Eclipse. I moved my jar files in my java build path in Eclipse from C:\Projects\ReportingSuite\web\WEB-INF\lib to the Tomcat5.5\common\lib folder. Now I am getting the following warnings and I do not know why. I even moved all the jar files back to the C:\Projects\ReportingSuite\web\WEB-INF\lib location and the problem is still happening.:

log4j:WARN No appenders could be found for logger (org.apache.catalina.startup.Embedded).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN No appenders could be found for logger (org.apache.catalina.startup.TldConfig).
log4j:WARN Please initialize the log4j system properly.


I have a file called log.properties that is found in the following location: C:\Projects\ReportingSuite\web\WEB-INF\log.properties and is configured:

log4j.rootLogger= DEBUG, stdout, logfile

#Package log levels
log4j.logger.org.apache=WARN
log4j.logger.org.springframework=WARN
log4j.logger.com.amgen.reportingsuite=DEBUG

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - %m%n

log4j.appender.logfile=org.apache.log4j.RollingFileAppender
log4j.appender.logfile.File=//C:/mobileclient/logs/ReportingSuite.log
log4j.appender.logfile.MaxFileSize=512KB
# Keep three backup files.
log4j.appender.logfile.MaxBackupIndex=3
# Pattern to output: date priority [category] - message
log4j.appender.logfile.layout=org.apache.log4j.PatternLayout
log4j.appender.logfile.layout.ConversionPattern=%d %p [%c] - %m%n
 
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Probably best to ask that on the IDEs forum. Moving.
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hm, not really an IDE issue. The file needs to be called log4j.properties, not log.properties. And it needs to be in your classpath. So it needs to be in one of those JAR's in your lib folder or, the standard way, just put it directly under WEB-INF/classes.
 
Rachel Kozlowski
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have renamed the file to log4j.properties. I have put the whole path to this file directly into the CLASSPATH and I have also put the file into the WEB-INF/classes. My amount of warnings was reduced to:

log4j:WARN No appenders could be found for logger (org.apache.catalina.startup.Embedded).
log4j:WARN Please initialize the log4j system properly.

Any thoughts?

 
author
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Appenders are typically definied in the log4j.properties or log4j.xml. What does the contents of your log4j.properties file look like?
 
Rachel Kozlowski
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As stated in my first post:

log4j.rootLogger= DEBUG, stdout, logfile

#Package log levels
log4j.logger.org.apache=WARN
log4j.logger.org.springframework=WARN
log4j.logger.com.amgen.reportingsuite=DEBUG

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - %m%n

log4j.appender.logfile=org.apache.log4j.RollingFileAppender
log4j.appender.logfile.File=//C:/mobileclient/logs/ReportingSuite.log
log4j.appender.logfile.MaxFileSize=512KB
# Keep three backup files.
log4j.appender.logfile.MaxBackupIndex=3
# Pattern to output: date priority [category] - message
log4j.appender.logfile.layout=org.apache.log4j.PatternLayout
log4j.appender.logfile.layout.ConversionPattern=%d %p [%c] - %m%n
 
Martijn Verburg
author
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rachel Kozlowski wrote:I have renamed the file to log4j.properties. I have put the whole path to this file directly into the CLASSPATH and I have also put the file into the WEB-INF/classes.


Sorry missed this before, there should be no need to put the full path to the file in the CLASSPATH if you place the file in the WEB-INF/classes directory, I would remove that and try running it again (just to eliminate that as a red herring).
 
Rachel Kozlowski
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok, I have eliminated it from the classpath. However I am still getting the same warnings.
 
Martijn Verburg
author
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rachel Kozlowski wrote:As stated in my first post:

log4j.rootLogger= DEBUG, stdout, logfile

#Package log levels
log4j.logger.org.apache=WARN
log4j.logger.org.springframework=WARN
log4j.logger.com.amgen.reportingsuite=DEBUG

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - %m%n

log4j.appender.logfile=org.apache.log4j.RollingFileAppender
log4j.appender.logfile.File=//C:/mobileclient/logs/ReportingSuite.log
log4j.appender.logfile.MaxFileSize=512KB
# Keep three backup files.
log4j.appender.logfile.MaxBackupIndex=3
# Pattern to output: date priority [category] - message
log4j.appender.logfile.layout=org.apache.log4j.PatternLayout
log4j.appender.logfile.layout.ConversionPattern=%d %p [%c] - %m%n



I really was asleep wasn't I, yes you had already posted this <smacks own head>.

OK, it might be a problem with the

log4j.rootLogger= DEBUG, stdout, logfile

Try removing the spaces between the commas and the space between the '=' and DEBUG, e.g. log4j.rootLogger=DEBUG,stdout,logfile

There might also be a problem with log4j.appender.logfile.File=//C:/mobileclient/logs/ReportingSuite.log

I think you want

log4j.appender.logfile.File=C:\\mobileclient\\logs\\ReportingSuite.log

Hope that helps!
 
drifter
Posts: 1364
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You might also try adding log4j.debug=true to your properties file to get some debug on log4j configuring itself.

 
Rachel Kozlowski
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I have changed the rootLogger to:
log4j.rootLogger=DEBUG,stdout,logfile

I have also added
log4j.debug=true

However, I am still getting the error mentioned, but I am now also getting log4j configuration information.

Perhaps there is something else that would cause this? Remember I am new to eclipse and java and I might have put a file in a wrong location or something. What else could I do to fix this?



log4j:WARN No appenders could be found for logger (org.apache.catalina.startup.Embedded).
log4j:WARN Please initialize the log4j system properly.
log4j: Parsing for [root] with value=[DEBUG,stdout,logfile].
log4j: Level token is [DEBUG].
log4j: Category root set to DEBUG
log4j: Parsing appender named "stdout".
log4j: Parsing layout options for "stdout".
log4j: Setting property [conversionPattern] to [%d %p [%c] - %m%n].
log4j: End of parsing for "stdout".
log4j: Parsed "stdout" options.
log4j: Parsing appender named "logfile".
log4j: Parsing layout options for "logfile".
log4j: Setting property [conversionPattern] to [%d %p [%c] - %m%n].
log4j: End of parsing for "logfile".
log4j: Setting property [file] to [//C:/mobileclient/logs/ReportingSuite.log].
log4j: Setting property [maxFileSize] to [512KB].
log4j: Setting property [maxBackupIndex] to [3].
log4j: setFile called: //C:/mobileclient/logs/ReportingSuite.log, true
log4j: setFile ended
log4j: Parsed "logfile" options.
log4j: Parsing for [org.apache] with value=[WARN].
log4j: Level token is [WARN].
log4j: Category org.apache set to WARN
log4j: Handling log4j.additivity.org.apache=[null]
log4j: Parsing for [org.springframework] with value=[WARN].
log4j: Level token is [WARN].
log4j: Category org.springframework set to WARN
log4j: Handling log4j.additivity.org.springframework=[null]
log4j: Parsing for [com.amgen.reportingsuite] with value=[DEBUG].
log4j: Level token is [DEBUG].
log4j: Category com.amgen.reportingsuite set to DEBUG
log4j: Handling log4j.additivity.com.amgen.reportingsuite=[null]
log4j: Finished configuring.
 
Rachel Kozlowski
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Solution:
I moved the Log4j.properties file to Tomcat/common/classes folder and also included it in the classpath.

Problem is now resolved.
 
Martijn Verburg
author
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ah, I think Tomcat wanted one for (org.apache.catalina.startup.Embedded), weird, I always thought it started with one automatically. Well done in any case!
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic