• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Is logging compulsory with spring ?

 
Ranch Hand
Posts: 41
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I was just doing a basic hands on of spring DI. I have a couple of beans in my xml and I try to instantiate the Spring container so that it loads the beans. Here is the code.


I removed all the lines because the first line itself causes an exception. I am sure on this. Everything is normal if I do not load container (that is, comment the first line )and just treat it as a normal core java program. Here is the exception.

I then add commons-logging jar to my project. There is no exception once I add it. My question is why is it so ? I have clearly checked all my code. Nowhere am i performing any logging. In fact, I do not even have any import statements related to logging. Why does Spring need this jar then. Does it need it internally or does any other jar I am using need logging features? I am pasting all the jars I am using. Most of them are not being used but I have kept them there because I keep trying different features back and forth. Is there some compulsion to use logging with Spring? I am deliberately not pasting xml or any more code for that matter because I am pretty sure the error is not related to anything else. I have thoroughly checked my code and there is no shred of logging. Still if anyone thinks I am wrong, please ask for more code. Thanks for help.

List of jars (I know its stupid enough but could there be a case that any of these jars need logging.)
 
Rajat Sharmanaive
Ranch Hand
Posts: 41
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Checked on net. Commons-logging is listed as a dependency for Spring. Not sure what that means exactly but it is clear I need it. I am trying to figure out what it means exactly. Any help on that is appreciated. Thanks.
 
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Rajat Sharmanaive wrote:Hi

Checked on net. Commons-logging is listed as a dependency for Spring. Not sure what that means exactly but it is clear I need it. I am trying to figure out what it means exactly. Any help on that is appreciated. Thanks.



Basically, it means that inside Spring's own classes it uses Commons Logging classes, so it needs to be in the classpath at runtime.

Mark
 
Rajat Sharmanaive
Ranch Hand
Posts: 41
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Mark.
 
    Bookmark Topic Watch Topic
  • New Topic