wood burning stoves 2.0*
The moose likes Other Open Source Projects and the fly likes Could not configure log4j.properties Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Could not configure log4j.properties" Watch "Could not configure log4j.properties" New topic
Author

Could not configure log4j.properties

dahood shaikh
Greenhorn

Joined: Nov 27, 2012
Posts: 7
Hi Guys,

I added the log4j.properties to my project and log4j.jar to the lib folder. And deployed the app on jboss 7. My application is deployed successfully ,but when i run the app i get the NullPointer Exception.
Below is the error that i see on my console.

ERROR
01:07:42,112 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) Could not configure log4j.properties.

01:07:42,112 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) java.lang.NullPointerException

01:07:42,112 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:475)

01:07:42,112 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at org.apache.log4j.PropertyConfigurator.configure(PropertyConfigurator.java:428)

log4j.properties
# Set root category priority to DEBUG and its only appender to SVAppenderFile.
log4j.rootCategory=DEBUG, SVAppenderFile

# SVAppenderFile is set to be a ConsoleAppender.
# log4j.appender.SVAppenderFile=org.apache.log4j.ConsoleAppender
# different appenders
log4j.appender.SVAppenderFile=org.apache.log4j.RollingFileAppender
log4j.appender.SVAppenderFile.File=C:\\projects\\edemo\\log\\edemo.log
log4j.appender.SVAppenderFile.Threshold=DEBUG
log4j.appender.SVAppenderFile.MaxFileSize=1000KB
log4j.appender.SVAppenderFile.Append=False
log4j.debug=true

# Keep one backup file
log4j.appender.SVAppenderFile.MaxBackupIndex=5

# SVAppenderFile uses PatternLayout.
log4j.appender.SVAppenderFile.layout=org.apache.log4j.PatternLayout
log4j.appender.SVAppenderFile.layout.ConversionPattern=[%p][date] %d{dd MMM yyyy HH:mm:ss,SSS} [class]%c %m%n

Can anyone please help me out why i get the above error?
Is there any thing thats missing in log4j.properties file?

Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

The first thing to do is to follow the stack trace a bit farther and see if any of your code appears in it. I think it's unlikely that log4j would be throwing NPEs just for configuration errors at this point.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Could not configure log4j.properties
 
Similar Threads
javax.naming.CommunicationException:Could not obtain connection to any of these urls:localhost:1099
JBoss 5 Transaction Exception
Failed to setup EJB remote context using jboss 7.1.1
Where to put derbyclient.jar in jboss7?
java.lang.RuntimeException: ClassNotFoundException marshaling EJB parameters