Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 27

Thread: standalone spring app, exception loading context from xml file

  1. #11
    Join Date
    Sep 2008
    Posts
    2

    Default

    Quote Originally Posted by ew0kian View Post
    Code:
    ...
    org.slf4j.impl.SimpleLoggerFactory.getLogger(SimpleLoggerFactory.java:67)
    	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:103)
    	at org.hibernate.cfg.Configuration.<clinit>(Configuration.java:128)
    	at java.lang.Class.forName0(Native Method)
    	at java.lang.Class.forName(Unknown Source)
    ...
    I have fixed it!
    My problem was due to incompatible versions of the components of the slf4j library.
    The project used the following:
    slf4j-api-1.5.2.jar
    slf4j-log4j12-1.5.3.jar
    but they aren't compatible.

    slf4j-api-1.5.2.jar was replaced by slf4j-api-1.5.3.jar and now it works!

  2. #12
    Join Date
    Nov 2007
    Location
    Austin, TX USA
    Posts
    154

    Default

    cool nice work. i replaced slf4j-api-1.4.2 with slf4j-api-1.5.3 and now it works. do you know if it matters if i use slf4j-simple or slf4j-log4j12?

  3. #13
    Join Date
    Jun 2008
    Posts
    11

    Default

    I had this error
    java.lang.NoSuchFieldError: name
    until I matched all of my libraries for slf4j to the latest release the
    .name field was added in a new (recent) superclass and the java.lang error
    is that there really isn't such a field in the class defintion.

    I'd check the mix and match of version of all of the slf4j and any other sets
    of libraries because you have a .class that actually says this.name and
    there isn't such a field in the classes you have brought together.

  4. #14
    Join Date
    Nov 2007
    Location
    Austin, TX USA
    Posts
    154

    Default

    right, i made sure those two have the same version number and it works fine now

  5. #15
    Join Date
    Sep 2008
    Posts
    1

    Default

    I am getting the exact same error.

    Caused by: java.lang.NoSuchFieldError: name
    at org.slf4j.impl.SimpleLogger.<init>(SimpleLogger.ja va:83)
    at org.slf4j.impl.SimpleLoggerFactory.getLogger(Simpl eLoggerFactory.java:67)
    at org.slf4j.LoggerFactory.getLogger(LoggerFactory.ja va:103)
    at org.hibernate.cfg.Configuration.<clinit>(Configura tion.java:151)
    at org.hibernate.ejb.Ejb3Configuration.<clinit>(Ejb3C onfiguration.java:107)
    at org.hibernate.ejb.HibernatePersistence.createConta inerEntityManagerFactory(HibernatePersistence.java :130)
    at org.springframework.orm.jpa.LocalContainerEntityMa nagerFactoryBean.createNativeEntityManagerFactory( LocalContainerEntityManagerFactoryBean.java:221)
    at org.springframework.orm.jpa.AbstractEntityManagerF actoryBean.afterPropertiesSet(AbstractEntityManage rFactoryBean.java:251)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods(Abstr actAutowireCapableBeanFactory.java:1390)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.initializeBean(Abstract AutowireCapableBeanFactory.java:1359)

  6. #16
    Join Date
    Jun 2008
    Posts
    11

    Default

    I see I'm not the only one to not see a reply before replying amd not only one
    to accidently cobble together the wrong library sets.
    My (phill) and ew0kian's solution was to get all of the org.slf4j libraries aligned to the same (latest) version and the problem went away because the name field was recently added, so this erros comes up if you mix more recent versions
    with slightly older versions.

    HTH

  7. #17

    Default

    Quote Originally Posted by dendery View Post
    I have fixed it!
    My problem was due to incompatible versions of the components of the slf4j library.
    The project used the following:
    slf4j-api-1.5.2.jar
    slf4j-log4j12-1.5.3.jar
    but they aren't compatible.

    slf4j-api-1.5.2.jar was replaced by slf4j-api-1.5.3.jar and now it works!
    Hi, can some1 help me get this file [slf4j-api-1.5.3.jar] please ... googled with no success

  8. #18
    Join Date
    Aug 2006
    Location
    Now Germany, previously Ukraine
    Posts
    1,546

    Default

    And on the slf4j site (http://www.slf4j.org)?
    Quote Originally Posted by SonxSprn7 View Post
    Hi, can some1 help me get this file [slf4j-api-1.5.3.jar] please ... googled with no success

  9. #19
    Join Date
    Apr 2006
    Posts
    2

    Default Which version of slf4j are you using?

    I was using slf4j-log4j12-1.5.3.jar because I downloaded it manually from the slf4j site but the dependency states slf4j-1.5.2. Once I got the 1.5.2 the NoSuchFieldError was gone.

  10. #20
    Join Date
    Aug 2006
    Location
    Now Germany, previously Ukraine
    Posts
    1,546

    Default

    Which dependency do you mean?
    And I really doubt that any dependecy states mix of 1.5.2 and 1.5.3
    Quote Originally Posted by szafir View Post
    I was using slf4j-log4j12-1.5.3.jar because I downloaded it manually from the slf4j site but the dependency states slf4j-1.5.2. Once I got the 1.5.2 the NoSuchFieldError was gone.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •