Unable to create tables using spring data jpa in mysql - java

Spring JPA does not create the tables under the schema or MySql db.
#DataSource
spring.datasource.url=jdbc:mysql://localhost:3306/pickalystoredatabase?autoReconnect=true&useSSL=false
spring.datasource.username=root
spring.datasource.password=root
# Keep the connection alive if idle for a long time (needed in production)
spring.datasource.testWhileIdle = true
spring.datasource.validationQuery = SELECT 1
# Show or not log for each sql query
spring.jpa.show-sql = true
# Hibernate ddl auto (create, create-drop, update)
spring.jpa.hibernate.ddl-auto = update
# Naming strategy
spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy
# Use spring.jpa.properties.* for Hibernate native properties (the prefix is
# stripped before adding them to the entity manager)
# The SQL dialect makes Hibernate generate better SQL for the chosen database
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect
The application properties seem to be perfect. I also do not see any errors in the logs
#Entity
#Table(name = "user")
public class User {
#Id
#GeneratedValue(strategy = GenerationType.AUTO)
#Column(name = "id", nullable = false, updatable = false)
private Long id;
#Column(name = "username", nullable = false)
private String username;
#Column(name = "password", nullable = false)
private String password;
#Column(name = "firstname", nullable = false)
private String firstname;
#Column(name = "lastname", nullable = false)
private String lastname;
#Column(name = "email", nullable = false, updatable = false)
private String email;
#Column(name = "phone", nullable = false)
private String phone;
#Column(name = "enabled", nullable = false)
private boolean enabled = true;
public User() { }
//getters snad setters
}
I am using the spring-boot-started-data-jpa maven dependency. Version 1.5.9 RC.
Logs for your reference
The logs does not show any exception and it also does not have any information with respect to the creation of tables.
2018-01-31 00:18:53.662 INFO 6640
--- [ restartedMain] com.pickaly.application.Pickaly : Starting Pickaly on PHYADAVI-6Q4D5 with PID 6640 (C:\Users\phyadavi\pickaly\Pickaly-Store\target\classes started by phyadavi in C:\Users\phyadavi\pickaly\Pickaly-Store) 2018-01-31 00:18:53.662 INFO 6640
--- [ restartedMain] com.pickaly.application.Pickaly : No active profile set, falling back to default profiles: default 2018-01-31 00:18:53.664 INFO 6640
--- [ restartedMain] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext#5db9f92a: startup date [Wed Jan 31 00:18:53 IST 2018]; root of context hierarchy 2018-01-31 00:18:54.243 INFO 6640
--- [ restartedMain] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 8080 (http) 2018-01-31 00:18:54.244 INFO 6640
--- [ restartedMain] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2018-01-31 00:18:54.244 INFO 6640
--- [ restartedMain] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.23 2018-01-31 00:18:54.269 INFO 6640
--- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext 2018-01-31 00:18:54.270 INFO 6640
--- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 606 ms 2018-01-31 00:18:54.302 INFO 6640
--- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Mapping servlet: 'dispatcherServlet' to [/] 2018-01-31 00:18:54.302 INFO 6640
--- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*] 2018-01-31 00:18:54.302 INFO 6640
--- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*] 2018-01-31 00:18:54.302 INFO 6640
--- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*] 2018-01-31 00:18:54.302 INFO 6640
--- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*] 2018-01-31 00:18:54.443 INFO 6640
--- [ restartedMain] j.LocalContainerEntityManagerFactoryBean : Building JPA container EntityManagerFactory for persistence unit 'default' 2018-01-31 00:18:54.443 INFO 6640
--- [ restartedMain] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [ name: default ...] 2018-01-31 00:18:54.460 INFO 6640
--- [ restartedMain] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQL5Dialect 2018-01-31 00:18:54.467 INFO 6640
--- [ restartedMain] org.hibernate.tool.hbm2ddl.SchemaUpdate : HHH000228: Running hbm2ddl schema update 2018-01-31 00:18:54.468 INFO 6640
--- [ restartedMain] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default' 2018-01-31 00:18:54.553 INFO 6640
--- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for #ControllerAdvice: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext#5db9f92a: startup date [Wed Jan 31 00:18:53 IST 2018]; root of context hierarchy 2018-01-31 00:18:54.564 INFO 6640
--- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/]}" onto public java.lang.String com.pickaly.controllers.HomeController.index() 2018-01-31 00:18:54.567 INFO 6640
--- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest) 2018-01-31 00:18:54.567 INFO 6640
--- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) 2018-01-31 00:18:54.574 INFO 6640
--- [ restartedMain] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] 2018-01-31 00:18:54.575 INFO 6640
--- [ restartedMain] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] 2018-01-31 00:18:54.587 INFO 6640
--- [ restartedMain] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler] 2018-01-31 00:18:54.661 INFO 6640
--- [ restartedMain] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 35729 2018-01-31 00:18:54.705 INFO 6640
--- [ restartedMain] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup 2018-01-31 00:18:54.718 INFO 6640
--- [ restartedMain] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8080 (http) 2018-01-31 00:18:54.720 INFO 6640
--- [ restartedMain] com.pickaly.application.Pickaly : Started Pickaly in 1.098 seconds (JVM running for 720.446)
Please help.
Edit:
In addition to the above mentioned properties i also used properties and annotations like
#EnableAutoConfiguration
#EntityScan(basePackages = {"com.pickaly.domains"})
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect instead of MySQLDBDialect
But these configurations did not work.

Try to add spring.jpa.generate-ddl = true to your application properties.

Related

Suspend after `HHH000204: Processing PersistenceUnitInfo`

I'm using SpringBoot and Hibernate, but the application stops after log HHH000204: Processing PersistenceUnitInfo at start up.
What does it mean?
Full stack:
:: Spring Boot :: (v2.0.5.RELEASE)
2019-01-19 17:30:40.343 INFO 23942 --- [ main] com.mafengwo.Application : Starting Application on sunxingbindeMacBook-Pro.local with PID 23942 (/Users/sunxingbin/IdeaProjects/contentrepojob/target/classes started by sunxingbin in /Users/sunxingbin/IdeaProjects/contentrepojob)
2019-01-19 17:30:40.347 INFO 23942 --- [ main] com.mafengwo.Application : No active profile set, falling back to default profiles: default
2019-01-19 17:30:40.470 INFO 23942 --- [ main] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext#cd3fee8: startup date [Sat Jan 19 17:30:40 CST 2019]; root of context hierarchy
2019-01-19 17:30:41.910 INFO 23942 --- [ main] f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
2019-01-19 17:30:42.208 INFO 23942 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$86296a04] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-01-19 17:30:42.750 INFO 23942 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 10086 (http)
2019-01-19 17:30:42.788 INFO 23942 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2019-01-19 17:30:42.788 INFO 23942 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.34
2019-01-19 17:30:42.801 INFO 23942 --- [ost-startStop-1] o.a.catalina.core.AprLifecycleListener : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/Users/sunxingbin/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.]
2019-01-19 17:30:43.028 INFO 23942 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2019-01-19 17:30:43.028 INFO 23942 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 2561 ms
2019-01-19 17:30:43.130 INFO 23942 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Servlet dispatcherServlet mapped to [/]
2019-01-19 17:30:43.135 INFO 23942 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*]
2019-01-19 17:30:43.136 INFO 23942 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2019-01-19 17:30:43.136 INFO 23942 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2019-01-19 17:30:43.137 INFO 23942 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*]
2019-01-19 17:30:43.200 INFO 23942 --- [ main] o.s.j.d.DriverManagerDataSource : Loaded JDBC driver: com.mysql.jdbc.Driver
2019-01-19 17:30:43.402 INFO 23942 --- [ main] j.LocalContainerEntityManagerFactoryBean : Building JPA container EntityManagerFactory for persistence unit 'default'
2019-01-19 17:30:43.433 INFO 23942 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [
name: default
...]
2019-01-19 17:30:43.549 INFO 23942 --- [ main] org.hibernate.Version : HHH000412: Hibernate Core {5.2.17.Final}
2019-01-19 17:30:43.550 INFO 23942 --- [ main] org.hibernate.cfg.Environment : HHH000206: hibernate.properties not found
2019-01-19 17:30:43.599 INFO 23942 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
Sat Jan 19 17:30:43 CST 2019 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
2019-01-19 17:30:44.423 INFO 23942 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect
Sat Jan 19 17:30:45 CST 2019 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
2019-01-19 17:30:45.251 INFO 23942 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2019-01-19 17:30:45.271 INFO 23942 --- [ main] o.s.j.d.DriverManagerDataSource : Loaded JDBC driver: com.mysql.jdbc.Driver
2019-01-19 17:30:45.276 INFO 23942 --- [ main] j.LocalContainerEntityManagerFactoryBean : Building JPA container EntityManagerFactory for persistence unit 'default'
2019-01-19 17:30:45.276 INFO 23942 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [
name: default
...]

Spring Boot Not Deploying WAR From IntelliJ

I was trying to deploy my first Spring Boot application to WAR file but it's not working. There is no error showing but also not finding any WAR file.
I have followed all the steps found on Spring Boot documentation and all over StackOverflow. Here are these:
Step 1: I have extended SpringBootServletInitializer
#SpringBootApplication
public class SpringBoot1Application extends SpringBootServletInitializer
{
public static void main(String[] args) throws Exception
{
SpringApplication.run(SpringBoot1Application.class, args);
}
}
Step 2: Added apply plugin: 'war' and dependencies in the build.gradle file
buildscript {
ext {
springBootVersion = '2.0.3.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'war'
group = 'com.ranadepto'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
compile('org.springframework.boot:spring-boot-starter-data-jpa')
compile('org.springframework.boot:spring-boot-starter-web')
runtime('org.springframework.boot:spring-boot-devtools')
runtime('mysql:mysql-connector-java')
testCompile('org.springframework.boot:spring-boot-starter-test')
provided 'org.springframework.boot:spring-boot-starter-tomcat'
providedCompile 'javax.servlet:javax.servlet-api:3.1.0'
}
war {
baseName = 'SpringBoot1'
}
I am also including console output messages:
:: Spring Boot :: (v2.0.3.RELEASE)
2018-07-06 20:50:49.322 INFO 3489 --- [ restartedMain] c.r.SpringBoot1.SpringBoot1Application : Starting SpringBoot1Application on Rana-Depto-MacBook-Pro.local with PID 3489 (/Users/ranadepto/Desktop/SpringBoot1/out/production/classes started by ranadepto in /Users/ranadepto/Desktop/SpringBoot1)
2018-07-06 20:50:49.324 INFO 3489 --- [ restartedMain] c.r.SpringBoot1.SpringBoot1Application : No active profile set, falling back to default profiles: default
2018-07-06 20:50:49.375 INFO 3489 --- [ restartedMain] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext#7acf6bce: startup date [Fri Jul 06 20:50:49 BDT 2018]; root of context hierarchy
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.springframework.cglib.core.ReflectUtils$1 (file:/Users/ranadepto/.gradle/caches/modules-2/files-2.1/org.springframework/spring-core/5.0.7.RELEASE/54b731178d81e66eca9623df772ff32718208137/spring-core-5.0.7.RELEASE.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of org.springframework.cglib.core.ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
2018-07-06 20:50:50.215 INFO 3489 --- [ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$f69149ff] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2018-07-06 20:50:50.461 INFO 3489 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2018-07-06 20:50:50.476 INFO 3489 --- [ restartedMain] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2018-07-06 20:50:50.477 INFO 3489 --- [ restartedMain] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.31
2018-07-06 20:50:50.480 INFO 3489 --- [ost-startStop-1] o.a.catalina.core.AprLifecycleListener : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/Users/ranadepto/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.]
2018-07-06 20:50:50.527 INFO 3489 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2018-07-06 20:50:50.527 INFO 3489 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 1157 ms
2018-07-06 20:50:50.612 INFO 3489 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Servlet dispatcherServlet mapped to [/]
2018-07-06 20:50:50.615 INFO 3489 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*]
2018-07-06 20:50:50.615 INFO 3489 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2018-07-06 20:50:50.615 INFO 3489 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2018-07-06 20:50:50.615 INFO 3489 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*]
2018-07-06 20:50:50.710 INFO 3489 --- [ restartedMain] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2018-07-06 20:50:50.841 INFO 3489 --- [ restartedMain] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
2018-07-06 20:50:50.866 INFO 3489 --- [ restartedMain] j.LocalContainerEntityManagerFactoryBean : Building JPA container EntityManagerFactory for persistence unit 'default'
2018-07-06 20:50:50.873 INFO 3489 --- [ restartedMain] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [
name: default
...]
2018-07-06 20:50:50.908 INFO 3489 --- [ restartedMain] org.hibernate.Version : HHH000412: Hibernate Core {5.2.17.Final}
2018-07-06 20:50:50.909 INFO 3489 --- [ restartedMain] org.hibernate.cfg.Environment : HHH000206: hibernate.properties not found
2018-07-06 20:50:50.931 INFO 3489 --- [ restartedMain] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
2018-07-06 20:50:50.995 INFO 3489 --- [ restartedMain] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQL5InnoDBDialect
2018-07-06 20:50:51.305 INFO 3489 --- [ restartedMain] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2018-07-06 20:50:51.523 INFO 3489 --- [ restartedMain] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-07-06 20:50:51.682 INFO 3489 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for #ControllerAdvice: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext#7acf6bce: startup date [Fri Jul 06 20:50:49 BDT 2018]; root of context hierarchy
2018-07-06 20:50:51.700 WARN 3489 --- [ restartedMain] aWebConfiguration$JpaWebMvcConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2018-07-06 20:50:51.722 INFO 3489 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/api/reports],methods=[GET]}" onto public java.util.List<com.ranadepto.SpringBoot1.ReportModel> com.ranadepto.SpringBoot1.ReportController.getAllReports()
2018-07-06 20:50:51.723 INFO 3489 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/api/reports/{id}],methods=[GET]}" onto public com.ranadepto.SpringBoot1.ReportModel com.ranadepto.SpringBoot1.ReportController.getReportById(java.lang.String)
2018-07-06 20:50:51.724 INFO 3489 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/api/reports],methods=[POST]}" onto public com.ranadepto.SpringBoot1.ReportModel com.ranadepto.SpringBoot1.ReportController.createReport(com.ranadepto.SpringBoot1.ReportModel)
2018-07-06 20:50:51.724 INFO 3489 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/api/reports/{id}],methods=[PUT]}" onto public com.ranadepto.SpringBoot1.ReportModel com.ranadepto.SpringBoot1.ReportController.updateReport(java.lang.String,com.ranadepto.SpringBoot1.ReportModel)
2018-07-06 20:50:51.724 INFO 3489 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/api/reports/{id}],methods=[DELETE]}" onto public org.springframework.http.ResponseEntity<?> com.ranadepto.SpringBoot1.ReportController.deleteReport(java.lang.String)
2018-07-06 20:50:51.726 INFO 3489 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2018-07-06 20:50:51.726 INFO 3489 --- [ restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
2018-07-06 20:50:51.746 INFO 3489 --- [ restartedMain] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-07-06 20:50:51.746 INFO 3489 --- [ restartedMain] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-07-06 20:50:51.921 INFO 3489 --- [ restartedMain] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 35729
2018-07-06 20:50:51.942 INFO 3489 --- [ restartedMain] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2018-07-06 20:50:51.943 INFO 3489 --- [ restartedMain] o.s.j.e.a.AnnotationMBeanExporter : Bean with name 'dataSource' has been autodetected for JMX exposure
2018-07-06 20:50:51.947 INFO 3489 --- [ restartedMain] o.s.j.e.a.AnnotationMBeanExporter : Located MBean 'dataSource': registering with JMX server as MBean [com.zaxxer.hikari:name=dataSource,type=HikariDataSource]
2018-07-06 20:50:51.972 INFO 3489 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2018-07-06 20:50:51.976 INFO 3489 --- [ restartedMain] c.r.SpringBoot1.SpringBoot1Application : Started SpringBoot1Application in 2.93 seconds (JVM running for 3.809)
And finally this is a screenshot of IntelliJ directory hierarchy:
I have been spending for hour on debugging and searching on the web and finally ended up here with a question. Please help me out with how can I get rid of this.

Camel - Can't access rest service

I'm running camel via spring and camel boot with embedded tomcat.
I have a simple camel route that is configuring correctly and consuming that I can see in the logs, but when i try to access it, it is giving 404 with localhost:8080/hi.
My Route
#Component
public class ServiceRoute extends RouteBuilder {
#Autowired
private SampleBean sampleBean;
#Override
public void configure() throws Exception {
from("rest:get:hi").to("bean:sampleBean");
}
}
My Main class
#Configuration
#SpringBootApplication
#ComponentScan(basePackages = { "routes", "service" },
excludeFilters = {#ComponentScan.Filter(value = Controller.class,
type = FilterType.ANNOTATION)})
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
Gradle dependencies
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.11'
compile 'org.apache.camel:camel-spring-boot-starter:2.17.0'
compile group: 'org.springframework.boot', name: 'spring-boot-starter-
web', version: '1.4.2.RELEASE'
compile group: 'org.apache.camel', name: 'camel-servlet', version:
'2.18.1'
}
Logs
2016-12-12 12:37:39.860 INFO 24684 --- [ main] root.Application : Starting Application on ram.tscpt.local with PID 24684 (/Users/srikanth/emulya/build/classes/main started by srikanth in /Users/srikanth/emulya)
2016-12-12 12:37:39.865 INFO 24684 --- [ main] root.Application : No active profile set, falling back to default profiles: default
2016-12-12 12:37:39.979 INFO 24684 --- [ main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext#4facf68f: startup date [Mon Dec 12 12:37:39 SAST 2016]; root of context hierarchy
2016-12-12 12:37:41.866 INFO 24684 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.apache.camel.spring.boot.CamelAutoConfiguration' of type [class org.apache.camel.spring.boot.CamelAutoConfiguration$$EnhancerBySpringCGLIB$$a11fb1e5] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2016-12-12 12:37:42.597 INFO 24684 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 8080 (http)
2016-12-12 12:37:42.617 INFO 24684 --- [ main] o.apache.catalina.core.StandardService : Starting service Tomcat
2016-12-12 12:37:42.618 INFO 24684 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.5
2016-12-12 12:37:42.756 INFO 24684 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2016-12-12 12:37:42.756 INFO 24684 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 2782 ms
2016-12-12 12:37:42.959 INFO 24684 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Mapping servlet: 'dispatcherServlet' to [/]
2016-12-12 12:37:42.983 INFO 24684 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*]
2016-12-12 12:37:42.984 INFO 24684 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2016-12-12 12:37:42.985 INFO 24684 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2016-12-12 12:37:42.985 INFO 24684 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*]
2016-12-12 12:37:43.525 INFO 24684 --- [ main] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for #ControllerAdvice: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext#4facf68f: startup date [Mon Dec 12 12:37:39 SAST 2016]; root of context hierarchy
2016-12-12 12:37:43.651 INFO 24684 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2016-12-12 12:37:43.653 INFO 24684 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
2016-12-12 12:37:43.703 INFO 24684 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2016-12-12 12:37:43.707 INFO 24684 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2016-12-12 12:37:43.778 INFO 24684 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2016-12-12 12:37:44.557 INFO 24684 --- [ main] o.a.c.i.converter.DefaultTypeConverter : Loaded 196 type converters
2016-12-12 12:37:44.890 INFO 24684 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2016-12-12 12:37:44.970 INFO 24684 --- [ main] o.a.camel.spring.boot.RoutesCollector : Loading additional Camel XML routes from: classpath:camel/*.xml
2016-12-12 12:37:44.973 INFO 24684 --- [ main] o.a.camel.spring.boot.RoutesCollector : Loading additional Camel XML rests from: classpath:camel-rest/*.xml
2016-12-12 12:37:44.974 INFO 24684 --- [ main] o.a.camel.spring.SpringCamelContext : Apache Camel 2.18.1 (CamelContext: camel-1) is starting
2016-12-12 12:37:44.976 INFO 24684 --- [ main] o.a.c.m.ManagedManagementStrategy : JMX is enabled
2016-12-12 12:37:45.548 INFO 24684 --- [ main] o.a.c.i.DefaultRuntimeEndpointRegistry : Runtime endpoint registry is in extended mode gathering usage statistics of all incoming and outgoing endpoints (cache limit: 1000)
2016-12-12 12:37:45.871 INFO 24684 --- [ main] o.a.camel.spring.SpringCamelContext : StreamCaching is not in use. If using streams then its recommended to enable stream caching. See more details at http://camel.apache.org/stream-caching.html
2016-12-12 12:37:46.023 INFO 24684 --- [ main] o.a.camel.spring.SpringCamelContext : Route: route1 started and consuming from: servlet:/hi?httpMethodRestrict=GET
2016-12-12 12:37:46.024 INFO 24684 --- [ main] o.a.camel.spring.SpringCamelContext : Total 1 routes, of which 1 are started.
2016-12-12 12:37:46.026 INFO 24684 --- [ main] o.a.camel.spring.SpringCamelContext : Apache Camel 2.18.1 (CamelContext: camel-1) started in 1.050 seconds
2016-12-12 12:37:46.147 INFO 24684 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8080 (http)
2016-12-12 12:37:46.157 INFO 24684 --- [ main] root.Application : Started Application in 6.985 seconds (JVM running for 7.475)
It's not working, because the Camel HTTP Servlet is not registered. CamelAutoConfiguration just starts the camel context.
You need to register the servlet yourself. The default name of the camel servlet is CamelServlet. Change your Application class:
#SpringBootApplication
#ComponentScan(basePackages = { "routes", "service" },
excludeFilters = {#ComponentScan.Filter(value = Controller.class,
type = FilterType.ANNOTATION)})
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
#Bean
public ServletRegistrationBean servletRegistrationBean() {
ServletRegistrationBean registration = new ServletRegistrationBean(new CamelHttpTransportServlet(), "/service/*");
registration.setName("CamelServlet");
return registration;
}
}
And then try to access http://localhost/service/hi
Btw, you don't need to add #Configuration to the class annotated with #SpringBootApplication.

Spring boot jpa with H2 database

I am trying a sample code to run my Spring Boot data project with JPA for an H2 DB.
The code is below, application is running properly, but I don't see any table getting created, I don't see any error in the server console as well. I checked the logs, I don't see any queries getting created an fired. Am I am doing anything wrong?
Domain class:
#Entity
public class Account {
#Id
#GeneratedValue
private Integer accountId;
private String name;
private String accType;
public Integer getAccountId() {
return accountId;
}
public String getName() {
return name;
}
public String getAccType() {
return accType;
}
public Account(Integer accountId, String name, String accType) {
super();
this.accountId = accountId;
this.name = name;
this.accType = accType;
}
public Account(String name, String accType) {
super();
this.name = name;
this.accType = accType;
}
public Account() {
}
Data Loader class:
#Component
public class AccountLoaded {
private AccountRepository accountRepository;
public AccountLoaded(AccountRepository accountRepository) {
this.accountRepository = accountRepository;
}
#PostConstruct
private void loadData() {
Account account = new Account(1,"Madhu","Savings");
accountRepository.save(account);
System.out.println("Loaded Account " + account.toString());
}
}
Repository class:
#Repository
public interface AccountRepository extends CrudRepository<Account, Integer> {
}
application.properties:
spring.datasource.jdbc-url=jdbc:h2:mem:test
spring.h2.console.enabled=true
spring.h2.console.path=/console
spring.datasource.platform=h2
My Logs in the server console:
2016-10-11 12:38:26.202 INFO 20020 --- [ main] j.LocalContainerEntityManagerFactoryBean : Building JPA container EntityManagerFactory for persistence unit 'default'
2016-10-11 12:38:26.217 INFO 20020 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [
name: default
...]
2016-10-11 12:38:26.285 INFO 20020 --- [ main] org.hibernate.Version : HHH000412: Hibernate Core {5.0.11.Final}
2016-10-11 12:38:26.287 INFO 20020 --- [ main] org.hibernate.cfg.Environment : HHH000206: hibernate.properties not found
2016-10-11 12:38:26.288 INFO 20020 --- [ main] org.hibernate.cfg.Environment : HHH000021: Bytecode provider name : javassist
2016-10-11 12:38:26.327 INFO 20020 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
2016-10-11 12:38:26.554 INFO 20020 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.H2Dialect
2016-10-11 12:38:26.995 INFO 20020 --- [ main] org.hibernate.tool.hbm2ddl.SchemaExport : HHH000227: Running hbm2ddl schema export
2016-10-11 12:38:27.004 INFO 20020 --- [ main] org.hibernate.tool.hbm2ddl.SchemaExport : HHH000230: Schema export complete
2016-10-11 12:38:27.044 INFO 20020 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
Loaded Account Account [accountId=1, name=Madhu, accType=Savings]
2016-10-11 12:38:27.587 INFO 20020 --- [ main] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for #ControllerAdvice: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext#b472aa: startup date [Tue Oct 11 12:38:23 CDT 2016]; root of context hierarchy
2016-10-11 12:38:27.663 INFO 20020 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2016-10-11 12:38:27.664 INFO 20020 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
2016-10-11 12:38:27.696 INFO 20020 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2016-10-11 12:38:27.696 INFO 20020 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2016-10-11 12:38:27.732 INFO 20020 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2016-10-11 12:38:27.959 INFO 20020 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2016-10-11 12:38:28.011 INFO 20020 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8080 (http)
2016-10-11 12:38:28.015 INFO 20020 --- [ main] com.example.SpringdataApplication : Started SpringdataApplication in 4.898 seconds (JVM running for 5.255)
Change spring.datasource.jdbc-url=jdbc:h2:mem:test to spring.datasource.jdbc-url=jdbc:h2:file:test (test is the name of the db file, could also have a path with the name) and use one of these tools to view the DB.
You can also log the SQL statements to your console, by adding spring.jpa.show-sql: true to your application.properties
If you go to the embedded h2 console (http://localhost:8080/console), and there type the correct connection URL (jdbc:h2:mem:test), you should see things.
The embedded h2 console does not show the correct connection URL by default, it forgets the :mem: part IIRC.
Even if all is done in memory you should see SQL logs when spring.jpa.show-sql is set to true (in application.properties file).
Don't forget to set spring.jpa.generate-ddl to true ( default is false) and make you loadData method transaction (see Spring #Transactional annotation).

Spring Boot Failing to Start Correctly [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 years ago.
Improve this question
My Spring Boot application is failing at startup, with the log below. What does this mean?
I'm using Hibernate Core v5.0.11.Final.
<pre>
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v1.4.1.RELEASE)
2016-09-27 02:55:31.899 INFO 5329 --- [ main] c.t.application.TaqnihomeApplication : Starting TaqnihomeApplication on Songlines-MacBook-Air.local with PID 5329 (/Users/songline/Downloads/assignment-2/target/classes started by songline in /Users/songline/Downloads/assignment-2)
2016-09-27 02:55:31.904 INFO 5329 --- [ main] c.t.application.TaqnihomeApplication : No active profile set, falling back to default profiles: default
2016-09-27 02:55:32.092 INFO 5329 --- [ main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext#7722c3c3: startup date [Tue Sep 27 02:55:32 IST 2016]; root of context hierarchy
2016-09-27 02:55:33.792 INFO 5329 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Overriding bean definition for bean 'dataSource' with a different definition: replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration$Generic; factoryMethodName=dataSource; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Generic.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration$Hikari; factoryMethodName=dataSource; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]]
2016-09-27 02:55:34.412 INFO 5329 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [class org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$8ec63a75] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2016-09-27 02:55:35.085 INFO 5329 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 8080 (http)
2016-09-27 02:55:35.103 INFO 5329 --- [ main] o.apache.catalina.core.StandardService : Starting service Tomcat
2016-09-27 02:55:35.104 INFO 5329 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.5
2016-09-27 02:55:35.280 INFO 5329 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2016-09-27 02:55:35.280 INFO 5329 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 3192 ms
2016-09-27 02:55:35.492 INFO 5329 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Mapping servlet: 'dispatcherServlet' to [/]
2016-09-27 02:55:35.497 INFO 5329 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*]
2016-09-27 02:55:35.498 INFO 5329 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2016-09-27 02:55:35.498 INFO 5329 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2016-09-27 02:55:35.498 INFO 5329 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*]
2016-09-27 02:55:35.798 INFO 5329 --- [ main] j.LocalContainerEntityManagerFactoryBean : Building JPA container EntityManagerFactory for persistence unit 'default'
2016-09-27 02:55:35.818 INFO 5329 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [
name: default
...]
2016-09-27 02:55:35.917 INFO 5329 --- [ main] org.hibernate.Version : HHH000412: Hibernate Core {5.0.11.Final}
2016-09-27 02:55:35.919 INFO 5329 --- [ main] org.hibernate.cfg.Environment : HHH000206: hibernate.properties not found
2016-09-27 02:55:35.921 INFO 5329 --- [ main] org.hibernate.cfg.Environment : HHH000021: Bytecode provider name : javassist
2016-09-27 02:55:35.990 INFO 5329 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
2016-09-27 02:55:36.268 INFO 5329 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Started.
2016-09-27 02:55:36.528 INFO 5329 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect
2016-09-27 02:55:37.223 INFO 5329 --- [ main] org.hibernate.tool.hbm2ddl.SchemaUpdate : HHH000228: Running hbm2ddl schema update
2016-09-27 02:55:37.266 INFO 5329 --- [ main] rmationExtractorJdbcDatabaseMetaDataImpl : HHH000262: Table not found: game_library
2016-09-27 02:55:37.363 WARN 5329 --- [ main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: 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 javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory
2016-09-27 02:55:37.364 INFO 5329 --- [ main] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Close initiated...
2016-09-27 02:55:37.370 INFO 5329 --- [ main] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Closed.
2016-09-27 02:55:37.372 INFO 5329 --- [ main] o.apache.catalina.core.StandardService : Stopping service Tomcat
2016-09-27 02:55:37.390 INFO 5329 --- [ main] utoConfigurationReportLoggingInitializer :
Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2016-09-27 02:55:37.398 ERROR 5329 --- [ main] o.s.boot.SpringApplication : Application startup failed
org.springframework.beans.factory.BeanCreationException: 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 javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1583) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1076) ~[spring-context-4.3.3.RELEASE.jar:4.3.3.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:851) ~[spring-context-4.3.3.RELEASE.jar:4.3.3.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541) ~[spring-context-4.3.3.RELEASE.jar:4.3.3.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) ~[spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:761) [spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:371) [spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1186) [spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1175) [spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
at com.taqnihome.application.TaqnihomeApplication.main(TaqnihomeApplication.java:34) [classes/:na]
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.persistenceException(EntityManagerFactoryBuilderImpl.java:954) ~[hibernate-entitymanager-5.0.11.Final.jar:5.0.11.Final]
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:882) ~[hibernate-entitymanager-5.0.11.Final.jar:5.0.11.Final]
at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:60) ~[spring-orm-4.3.3.RELEASE.jar:4.3.3.RELEASE]
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:353) ~[spring-orm-4.3.3.RELEASE.jar:4.3.3.RELEASE]
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:373) ~[spring-orm-4.3.3.RELEASE.jar:4.3.3.RELEASE]
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:362) ~[spring-orm-4.3.3.RELEASE.jar:4.3.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1642) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1579) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
... 16 common frames omitted
Caused by: org.hibernate.tool.schema.spi.SchemaManagementException: Unable to execute schema management to JDBC target [alter table game_library add column game_id varchar(255) not null]
at org.hibernate.tool.schema.internal.TargetDatabaseImpl.accept(TargetDatabaseImpl.java:59) ~[hibernate-core-5.0.11.Final.jar:5.0.11.Final]
at org.hibernate.tool.schema.internal.SchemaMigratorImpl.applySqlString(SchemaMigratorImpl.java:431) ~[hibernate-core-5.0.11.Final.jar:5.0.11.Final]
at org.hibernate.tool.schema.internal.SchemaMigratorImpl.applySqlStrings(SchemaMigratorImpl.java:449) ~[hibernate-core-5.0.11.Final.jar:5.0.11.Final]
at org.hibernate.tool.schema.internal.SchemaMigratorImpl.migrateTable(SchemaMigratorImpl.java:253) ~[hibernate-core-5.0.11.Final.jar:5.0.11.Final]
at org.hibernate.tool.schema.internal.SchemaMigratorImpl.doMigrationToTargets(SchemaMigratorImpl.java:170) ~[hibernate-core-5.0.11.Final.jar:5.0.11.Final]
at org.hibernate.tool.schema.internal.SchemaMigratorImpl.doMigration(SchemaMigratorImpl.java:60) ~[hibernate-core-5.0.11.Final.jar:5.0.11.Final]
at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:134) ~[hibernate-core-5.0.11.Final.jar:5.0.11.Final]
at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:101) ~[hibernate-core-5.0.11.Final.jar:5.0.11.Final]
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:472) ~[hibernate-core-5.0.11.Final.jar:5.0.11.Final]
at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:444) ~[hibernate-core-5.0.11.Final.jar:5.0.11.Final]
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:879) ~[hibernate-entitymanager-5.0.11.Final.jar:5.0.11.Final]
... 22 common frames omitted
Caused by: java.sql.SQLSyntaxErrorException: Table 'testingjpa.game_library' doesn't exist
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:686) ~[mysql-connector-java-6.0.3.jar:6.0.3]
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:663) ~[mysql-connector-java-6.0.3.jar:6.0.3]
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:653) ~[mysql-connector-java-6.0.3.jar:6.0.3]
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:115) ~[mysql-connector-java-6.0.3.jar:6.0.3]
at com.mysql.cj.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2041) ~[mysql-connector-java-6.0.3.jar:6.0.3]
at com.mysql.cj.jdbc.StatementImpl.executeUpdateInternal(StatementImpl.java:1608) ~[mysql-connector-java-6.0.3.jar:6.0.3]
at com.mysql.cj.jdbc.StatementImpl.executeLargeUpdate(StatementImpl.java:2630) ~[mysql-connector-java-6.0.3.jar:6.0.3]
at com.mysql.cj.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1534) ~[mysql-connector-java-6.0.3.jar:6.0.3]
at com.zaxxer.hikari.pool.ProxyStatement.executeUpdate(ProxyStatement.java:120) ~[HikariCP-2.4.7.jar:na]
at com.zaxxer.hikari.pool.HikariProxyStatement.executeUpdate(HikariProxyStatement.java) ~[HikariCP-2.4.7.jar:na]
at org.hibernate.tool.schema.internal.TargetDatabaseImpl.accept(TargetDatabaseImpl.java:56) ~[hibernate-core-5.0.11.Final.jar:5.0.11.Final]
... 32 common frames omitted
</pre>
Log TLDR;
HHH000228: Running hbm2ddl schema update
HHH000262: Table not found: game_library
GameLibrary class:
#Entity
#Table(name = "game_library")
public class GameLibrary {
#Id
#Column(name = "game_id")
private String gameId;
#Column(name = "game_name")
private String gameName;
#Column(name = "game_genre")
private String gameGenre;
#ManyToOne
#JoinColumn(name = "game_category", nullable = false)
private GameCategory gameCategory;
#Column(name = "game_version")
private String gameVersion;
#Column(name = "game_publiher")
private String gamePublisher;
#Column(name = "game_studio")
private String gameStudio;
#Column(name = "game_release_date")
private Long gameReleaseDate;
#Column
private Double gameRating;
#Column
private String gamePlatform;
#Column
private Long creationDate;
#Column
private String googlePlayUrl;
#Column
private Long approvedDate;
#Column
private Boolean isApproved;
#Column
private String packageName;
#ManyToMany(mappedBy = "gameLibrary", cascade = CascadeType.ALL)
private List<GameProfile> gameProfiles;
// getters and setters
}
new log when update change with create field value ddl-auto
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v1.4.1.RELEASE)
2016-09-27 12:47:50.815 INFO 5812 --- [ main] c.t.application.TaqnihomeApplication : Starting TaqnihomeApplication on Songlines-MacBook-Air.local with PID 5812 (/Users/songline/Downloads/assignment-2/target/classes started by songline in /Users/songline/Downloads/assignment-2)
2016-09-27 12:47:50.818 INFO 5812 --- [ main] c.t.application.TaqnihomeApplication : No active profile set, falling back to default profiles: default
2016-09-27 12:47:50.939 INFO 5812 --- [ main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext#7722c3c3: startup date [Tue Sep 27 12:47:50 IST 2016]; root of context hierarchy
2016-09-27 12:47:52.624 INFO 5812 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Overriding bean definition for bean 'dataSource' with a different definition: replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration$Generic; factoryMethodName=dataSource; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Generic.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration$Hikari; factoryMethodName=dataSource; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]]
2016-09-27 12:47:53.213 INFO 5812 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [class org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$8ec63a75] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2016-09-27 12:47:53.853 INFO 5812 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 8080 (http)
2016-09-27 12:47:53.874 INFO 5812 --- [ main] o.apache.catalina.core.StandardService : Starting service Tomcat
2016-09-27 12:47:53.876 INFO 5812 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.5
2016-09-27 12:47:54.085 INFO 5812 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2016-09-27 12:47:54.085 INFO 5812 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 3153 ms
2016-09-27 12:47:54.275 INFO 5812 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Mapping servlet: 'dispatcherServlet' to [/]
2016-09-27 12:47:54.281 INFO 5812 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*]
2016-09-27 12:47:54.281 INFO 5812 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2016-09-27 12:47:54.282 INFO 5812 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2016-09-27 12:47:54.282 INFO 5812 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*]
2016-09-27 12:47:54.529 INFO 5812 --- [ main] j.LocalContainerEntityManagerFactoryBean : Building JPA container EntityManagerFactory for persistence unit 'default'
2016-09-27 12:47:54.552 INFO 5812 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [
name: default
...]
2016-09-27 12:47:54.640 INFO 5812 --- [ main] org.hibernate.Version : HHH000412: Hibernate Core {5.0.11.Final}
2016-09-27 12:47:54.642 INFO 5812 --- [ main] org.hibernate.cfg.Environment : HHH000206: hibernate.properties not found
2016-09-27 12:47:54.644 INFO 5812 --- [ main] org.hibernate.cfg.Environment : HHH000021: Bytecode provider name : javassist
2016-09-27 12:47:54.691 INFO 5812 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
2016-09-27 12:47:54.965 INFO 5812 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Started.
2016-09-27 12:47:55.253 INFO 5812 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect
2016-09-27 12:47:56.049 INFO 5812 --- [ main] org.hibernate.tool.hbm2ddl.SchemaExport : HHH000227: Running hbm2ddl schema export
2016-09-27 12:47:56.441 INFO 5812 --- [ main] org.hibernate.tool.hbm2ddl.SchemaExport : HHH000230: Schema export complete
2016-09-27 12:47:56.489 INFO 5812 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2016-09-27 12:47:57.575 INFO 5812 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/login],methods=[POST]}" onto public org.springframework.http.ResponseEntity com.taqnihome.controller.HomeController.login(com.taqnihome.domain.User)
2016-09-27 12:47:57.577 INFO 5812 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/signup],methods=[POST]}" onto public org.springframework.http.ResponseEntity com.taqnihome.controller.HomeController.saveData(com.taqnihome.domain.User)
2016-09-27 12:47:57.577 INFO 5812 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/search],methods=[POST]}" onto public org.springframework.http.ResponseEntity com.taqnihome.controller.HomeController.checkMacAddress(com.taqnihome.domain.User)
2016-09-27 12:47:57.577 INFO 5812 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/addGameToProfile],methods=[POST]}" onto public org.springframework.http.ResponseEntity com.taqnihome.controller.HomeController.addGameToProfile(com.taqnihome.domain.GameProfile)
2016-09-27 12:47:57.578 INFO 5812 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/updateGameToProfile],methods=[PUT]}" onto public org.springframework.http.ResponseEntity com.taqnihome.controller.HomeController.updateGameToProfile(com.taqnihome.domain.GameProfile)
2016-09-27 12:47:57.578 INFO 5812 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/addGameRequestToLibrary],methods=[POST]}" onto public org.springframework.http.ResponseEntity com.taqnihome.controller.HomeController.addGameRequestToLibrary(java.lang.String,java.lang.String)
2016-09-27 12:47:57.578 INFO 5812 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/getAllLibraryGames],methods=[GET]}" onto public org.springframework.http.ResponseEntity com.taqnihome.controller.HomeController.getAllGames()
2016-09-27 12:47:57.578 INFO 5812 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/getGameProfileByUser],methods=[GET]}" onto public org.springframework.http.ResponseEntity com.taqnihome.controller.HomeController.getAllProfileGames(com.taqnihome.domain.User)
2016-09-27 12:47:57.579 INFO 5812 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/v2/api-docs],methods=[GET],produces=[application/json || application/hal+json]}" onto public org.springframework.http.ResponseEntity springfox.documentation.swagger2.web.Swagger2Controller.getDocumentation(java.lang.String,javax.servlet.http.HttpServletRequest)
2016-09-27 12:47:57.584 INFO 5812 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/swagger-resources/configuration/ui]}" onto org.springframework.http.ResponseEntity springfox.documentation.swagger.web.ApiResourceController.uiConfiguration()
2016-09-27 12:47:57.590 INFO 5812 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/swagger-resources/configuration/security]}" onto org.springframework.http.ResponseEntity springfox.documentation.swagger.web.ApiResourceController.securityConfiguration()
2016-09-27 12:47:57.591 INFO 5812 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/swagger-resources]}" onto org.springframework.http.ResponseEntity> springfox.documentation.swagger.web.ApiResourceController.swaggerResources()
2016-09-27 12:47:57.595 INFO 5812 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2016-09-27 12:47:57.595 INFO 5812 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
2016-09-27 12:47:57.914 INFO 5812 --- [ main] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for #ControllerAdvice: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext#7722c3c3: startup date [Tue Sep 27 12:47:50 IST 2016]; root of context hierarchy
2016-09-27 12:47:58.017 INFO 5812 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2016-09-27 12:47:58.017 INFO 5812 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2016-09-27 12:47:58.068 INFO 5812 --- [ main] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2016-09-27 12:47:58.430 INFO 5812 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2016-09-27 12:47:58.437 INFO 5812 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Bean with name 'dataSource' has been autodetected for JMX exposure
2016-09-27 12:47:58.443 INFO 5812 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Located MBean 'dataSource': registering with JMX server as MBean [com.zaxxer.hikari:name=dataSource,type=HikariDataSource]
2016-09-27 12:47:58.449 INFO 5812 --- [ main] o.s.c.support.DefaultLifecycleProcessor : Starting beans in phase 2147483647
2016-09-27 12:47:58.449 INFO 5812 --- [ main] d.s.w.p.DocumentationPluginsBootstrapper : Context refreshed
2016-09-27 12:47:58.476 INFO 5812 --- [ main] d.s.w.p.DocumentationPluginsBootstrapper : Found 1 custom documentation plugin(s)
2016-09-27 12:47:58.487 INFO 5812 --- [ main] s.d.s.w.s.ApiListingReferenceScanner : Scanning for api listing references
2016-09-27 12:47:58.843 INFO 5812 --- [ main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8080 (http)
2016-09-27 12:47:58.850 INFO 5812 --- [ main] c.t.application.TaqnihomeApplication : Started TaqnihomeApplication in 8.563 seconds (JVM running for 8.995)
Hibernate is pitching a fit because you told it to do this (intentionally or not):
alter table game_library add column game_id varchar(255) not null
However, Table 'testingjpa.game_library' doesn't exist.
Either fix your DB or fix your game_library object definition or mapping.
It's probably gone from your DB, or you're pointing it at a wrong or older DB.
Have a look at the error message that Hibernate is providing you:
java.sql.SQLSyntaxErrorException: Table 'testingjpa.game_library' doesn't exist
You're referring to a table that doesn't yet exist in your database, or that your DB user does not have access to. This is causing Spring to fail when it's setting up your Entity Manager Factory, and ultimately the entire Spring context. The errant SQL statement seems to be:
alter table game_library add column game_id varchar(255) not null
If this is in a schema.sql file, or some other schema configuration file that you're running to setup your database, you'll have to ensure that the table is created correctly before you run this alter statement.
Have a look at the Spring Boot doc on Database initialization. If you're expecting the table to be auto-generated, ensure that you have the spring.jpa.generate-ddl flag set to true in your application.properties file.

Categories