Announcement Announcement Module
Collapse
No announcement yet.
“SimpleLogger does not seem to be location aware” exception Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • “SimpleLogger does not seem to be location aware” exception

    I'm getting an exception in a Spring 2.5 app on my first line of code:
    Code:
    ApplicationContext context = new ClassPathXmlApplicationContext("beans.xml");
    I have commons-logging-1.1.1.jar configured as a project library.

    Here is the stack trace:

    java.lang.UnsupportedOperationException: The logger [org.slf4j.impl.SimpleLogger(org.springframework.co ntext.support.ClassPathXmlApplicationContext)] does not seem to be location aware.

    at org.apache.log4j.Category.log(Category.java:347)
    at org.apache.commons.logging.impl.Log4JLogger.info(L og4JLogger.java:199) atorg.springframework.context.support.AbstractAppl icationContext.
    prepareRefresh(AbstractApplicationContext.java:456 )
    at org.springframework.context.support.AbstractApplic ationContext.
    refresh(AbstractApplicationContext.java:394)
    at org.springframework.context.support.ClassPathXmlAp plicationContext.(ClassPathXmlApplicationContext.j ava:139)
    at org.springframework.context.support.ClassPathXmlAp plicationContext.(ClassPathXmlApplicationContext.j ava:83)

  • #2
    You seem to want/be using slf4j (judging from the stacktrace) but also log4j and commons... That is somewhere going to bite you... Remove the commons-logging stuff, -sinclude the jcl-over-slf4j.jar (acts as commons-logging), and either use logback or the log4j binding (you seem to be wanting to use log4j).

    Comment


    • #3
      This is a Spring/Hibernate project and somehow I had included both a versioned and an unversioned slf4j-simple.jar in the project as part of the Hibernate config. I deleted slf4j-simple.jar, leaving slf4j-simple-1.4.2.jar matching the slf4j-simple-api-1.4.2.jar that is part of the Hibernate distribution I'm using.

      It is now working fine w/ commons-logging-1.1.1. I tried removing commons-logging-1.1.1 but Spring complained.

      Comment

      Working...
      X