Access the full course here: javabrains.io/courses/spring_bootquickstart
In this video, we’ll create a new project and add the necessary dependencies to use Spring Data JPA to connect to a database.
14 Comments on "Spring Boot Quick Start 27 – Adding Spring Data JPA"
I noticed the package issue when I was using Spring Boot 1.2.5.Release, when i changed it to 1.4.2.Release, i did not faced that issue.
I created a simple spring boot starter project with web, jpa and apache derby on Spring boot 1.5.2,1.5.3 and tried on 2.0.0 also but I am getting error org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tomcatEmbeddedServletContainerFactory' defined in class path resource [org/springframework/boot/autoconfigure/web/EmbeddedServletContainerAutoConfiguration$EmbeddedTomcat.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'serverProperties' defined in class path resource [org/springframework/boot/autoconfigure/web/ServerPropertiesAutoConfiguration.class]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/hibernate/HibernateException
Hi Want to create , different Projects for Service , Repositories , and controllerI understand for controller if we select Spring Web its enough and for Repositories I select JPA , what is required for service? only web dependency is sufficient?
amazing tutorial, I hope you will have more tutorials about Spring Boot in near future! Well done!
After downloading and adding Topic package from earlier project when I am running it, i am getting error like "Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: javassist/bytecode/ClassFile". I have tried many things but I think in video there is nothing done explicitly. Please help me.
add the following dependency to your pom.xml <dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> </dependency>
I dont see any topic about how to connect to external databases. Am I missing some thing.
You have fast internet and a fast machine :p
Thanks a lot Koushik for all the videos, they are really helpful, the best teacher :)There is something that I noticed. If the RestController class is not inside the same package (or subpackage) as the SpringBootApplication, then the controller is not picked by the MVC and my request to for eg. '/topics' returns me a 'not found'. I guess all RestControllers in the classpath are not picked up by the SpringBootApplication. (A complete classpath scan might not be happening)
I have no idea why, but had the same problem.
I noticed the same too
Looking up the documentation specifies that I can specify the basepackages for the componentscan and things work fine when I do so. I realize it was the default same package + child packages that is being scanned when no basepackages are specified!
In CodeChannels.com, you can learn to code by watching videos and stay up to date with latest code shows, events and tutorials aggregated from various leading developer communities.
Copyright 2016 By CodeChannels.com All rights reserved.