Win a copy of Transfer Learning for Natural Language Processing (MEAP) this week in the Artificial Intelligence and Machine Learning forum!
  • 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 ...
  • Campbell Ritchie
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • salvin francis
  • Carey Brown
  • Frits Walraven

NoSuchField: logger from AnnotationConfigApplicationContext

Ranch Hand
Posts: 1871
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I am running an example in ch 9 of Getting started with Springframework 4th edition:


NFO  org.springframework.context.annotation.AnnotationConfigApplicationContext - Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@3ecd23d9: startup date [Sat Jul 14 18:58:26 EDT 2018]; root of context hierarchy
Exception in thread "main" java.lang.NoSuchFieldError: logger
at sample.spring.chapter09.bankapp.BankApp.main(

The exception is thrown from the context.refresh. Please help.
[Thumbnail for fileStructure.JPG]
file structure
Himai Minh
Ranch Hand
Posts: 1871
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let me answer my own question.
I first created the and and their classes by adding the dependencies below and changed the plugins:
In pom.xml:


Download Apache Maven. Set the path variables as instructed by MKyong (
In a command prompt, navigate to the ch09-spring-mongo-data project folder. Type mvn compile. This can generate the Q-classes and java code in the target/generated-sources/java.
Copy the Q-classes , in this case,  and to the corresponding package.

Close and delete the ch09-spring-mongo-data project from the Eclipse workspace. Open the original project with the original pom.xml file. Copy the Q classes to the corresponding package in the original project.
Now, the original project can compile with the Q classes.
Install MongoDB community instruction and follow their instruction to run it.
Run the from the original project. It should work.
Whose rules are you playing by? This tiny ad doesn't respect those rules:
the value of filler advertising in 2020
    Bookmark Topic Watch Topic
  • New Topic