Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Java in General
Search Coderanch
Advance search
Google search
Register / Login
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
Forum:
Java in General
ClassNotFound
Dura Hurtado
Ranch Hand
Posts: 120
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi , I am trying to upload a file and there is a class which is not found:
private Logger logger = LoggerFactory.getLogger(FileUploadController.class);
LoggerFactory, is not found the error inthe console is:
symbol : variable LoggerFactory
location: class bean.FileUploadController
private Logger logger = LoggerFactory.getLogger(FileUploadController.class);
^
1 error
¿Any clue?
Thanks
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
I like...
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
you class path contains LoggerFactory.class ? i.e, do your path contains Jar file[*might be log4j jar*] which has LoggerFactory class. ?
Dura Hurtado
Ranch Hand
Posts: 120
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
When I fix the error and add log4j jar import, this way : import org.apache.log4j.spi.LoggerFactory;
The next error appears:
symbol : method getLogger(java.lang.Class<bean.FileUploadController>)
location: interface org.apache.log4j.spi.LoggerFactory
private Logger logger = LoggerFactory.getLogger(FileUploadController.class);
^
1 error
¿Any clue?
Thanks
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
I like...
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
the LoggerFactory package might be different . i.e, you have imported wrong class;
Rob Spoor
Sheriff
Posts: 22783
131
I like...
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Log4J's LoggerFactory is an interface, and has no static methods. I found another
LoggerFactory
, of
SLF4J
. This has the method you're calling. So remove the Log4J import and library, and replace it with the SLF4J library and import.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions
How To Answer Questions
Did you see how Paul
cut 87% off of his electric heat bill with 82 watts of micro heaters
?
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Can Logger be protected?
upload file jsf
Not able to save logs into .log file
The method getLogger(Class<SimpleProducer>) is undefined for the type LoggerFactory
Upload
First milestone of ScroogeXHTML for the Java™ platform 8.0
More...