This week's book giveaways are in the Jython/Python and Object-Oriented programming forums.
We're giving away four copies each of Machine Learning for Business: Using Amazon SageMaker and Jupyter and Object Design Style Guide and have the authors on-line!
See this thread and this one for details.
Win a copy of Machine Learning for Business: Using Amazon SageMaker and JupyterE this week in the Jython/Python forum
or Object Design Style Guide in the Object-Oriented programming 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 ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

JpaRepository: NoSuchBeanDefinitionException

 
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 Hello!

 



xml-config-files:

spring-app.xml


spring-db.xml:


in pom



  But I catch the:





 
Ranch Hand
Posts: 1798
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Andrey,
Can you try to add @EnableJpaRepositories (basePackages ={....}) in your class which is annotated with @SpringBootApplication ?
The basePackage is where the @Repository classes are put.

Let us know your result.
 
Andrey Dmitriev
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
  Himai Minh, I not using Boot...
 
Himai Minh
Ranch Hand
Posts: 1798
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Andrey.
Do you have any class  annotated by @Configure?
If not, you can create one annotated by @Configure without any method.
Also add @EnableJpaRepository (basePackages = {...})
 
Andrey Dmitriev
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
   The problem is solved.
   I add "classpath:spring/spring-db.xml" in param-values of contextConfigLocation in my web.xml:



  Thank for trying to help!
 
You guys haven't done this much, have ya? I suggest you study this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!