4

How I can know what is the problem when there is no stack trace? Can I enable some option? I just created small project with spring initializer and this is what I'm getting

Updated log(With debug flag)

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.0.0.RELEASE)

2018-03-18 02:40:52.246  INFO 16664 --- [  restartedMain] c.o.b.BigDataProjectApplication          : Starting BigDataProjectApplication on oscar-Inspiron-5735 with PID 16664 (/home/oscar/IdeaProjects/big-data-project/out/production/classes started by oscar in /home/oscar/IdeaProjects/big-data-project)
2018-03-18 02:40:52.253  INFO 16664 --- [  restartedMain] c.o.b.BigDataProjectApplication          : No active profile set, falling back to default profiles: default
2018-03-18 02:40:52.254 DEBUG 16664 --- [  restartedMain] o.s.boot.SpringApplication               : Loading source class com.owozniak.bigdataproject.BigDataProjectApplication
2018-03-18 02:40:52.476 DEBUG 16664 --- [  restartedMain] o.s.b.c.c.ConfigFileApplicationListener  : Loaded config file 'file:/home/oscar/IdeaProjects/big-data-project/out/production/resources/application.properties' (classpath:/application.properties)
2018-03-18 02:40:52.512  INFO 16664 --- [  restartedMain] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@c156816: startup date [Sun Mar 18 02:40:52 CET 2018]; root of context hierarchy
2018-03-18 02:40:52.516 DEBUG 16664 --- [  restartedMain] ConfigServletWebServerApplicationContext : Bean factory for org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@c156816: org.springframework.beans.factory.support.DefaultListableBeanFactory@5f820b6d: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,org.springframework.context.event.internalEventListenerProcessor,org.springframework.context.event.internalEventListenerFactory,bigDataProjectApplication]; root of factory hierarchy
2018-03-18 02:40:55.008 DEBUG 16664 --- [  restartedMain] o.s.b.a.AutoConfigurationPackages        : @EnableAutoConfiguration was declared on a class in the package 'com.owozniak.bigdataproject'. Automatic @Repository and @Entity scanning is enabled.
2018-03-18 02:40:55.882  INFO 16664 --- [  restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$54765f50] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2018-03-18 02:40:55.959 DEBUG 16664 --- [  restartedMain] ConfigServletWebServerApplicationContext : Unable to locate MessageSource with name 'messageSource': using default [org.springframework.context.support.DelegatingMessageSource@1214c019]
2018-03-18 02:40:55.959 DEBUG 16664 --- [  restartedMain] ConfigServletWebServerApplicationContext : Unable to locate ApplicationEventMulticaster with name 'applicationEventMulticaster': using default [org.springframework.context.event.SimpleApplicationEventMulticaster@41ee5a59]
2018-03-18 02:40:56.386 DEBUG 16664 --- [  restartedMain] .s.b.w.e.t.TomcatServletWebServerFactory : Code archive: /home/oscar/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot/2.0.0.RELEASE/771da2071ff14a47f108642a641c204ae4ef7b15/spring-boot-2.0.0.RELEASE.jar
2018-03-18 02:40:56.387 DEBUG 16664 --- [  restartedMain] .s.b.w.e.t.TomcatServletWebServerFactory : Code archive: /home/oscar/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot/2.0.0.RELEASE/771da2071ff14a47f108642a641c204ae4ef7b15/spring-boot-2.0.0.RELEASE.jar
2018-03-18 02:40:56.388 DEBUG 16664 --- [  restartedMain] .s.b.w.e.t.TomcatServletWebServerFactory : None of the document roots [src/main/webapp, public, static] point to a directory and will be ignored.
2018-03-18 02:40:56.551  INFO 16664 --- [  restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
2018-03-18 02:40:56.604  INFO 16664 --- [  restartedMain] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2018-03-18 02:40:56.605  INFO 16664 --- [  restartedMain] org.apache.catalina.core.StandardEngine  : Starting Servlet Engine: Apache Tomcat/8.5.28
2018-03-18 02:40:56.616  INFO 16664 --- [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: [/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib]
2018-03-18 02:40:56.838  INFO 16664 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2018-03-18 02:40:56.838  INFO 16664 --- [ost-startStop-1] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 4361 ms
2018-03-18 02:40:57.959 DEBUG 16664 --- [ost-startStop-1] o.s.b.w.s.ServletContextInitializerBeans : Added existing Servlet initializer bean 'dispatcherServletRegistration'; order=2147483647, resource=class path resource [org/springframework/boot/autoconfigure/web/servlet/DispatcherServletAutoConfiguration$DispatcherServletRegistrationConfiguration.class]
2018-03-18 02:40:57.959 DEBUG 16664 --- [ost-startStop-1] o.s.b.w.s.ServletContextInitializerBeans : Added existing Filter initializer bean 'webMvcMetricsFilter'; order=2147483647, resource=class path resource [org/springframework/boot/actuate/autoconfigure/metrics/web/servlet/WebMvcMetricsAutoConfiguration.class]
2018-03-18 02:40:57.961 DEBUG 16664 --- [ost-startStop-1] o.s.b.w.s.ServletContextInitializerBeans : Added existing ServletContextInitializer initializer bean 'servletEndpointRegistrar'; order=2147483647, resource=class path resource [org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfiguration.class]
2018-03-18 02:40:58.051 DEBUG 16664 --- [ost-startStop-1] o.s.b.w.s.ServletContextInitializerBeans : Created Filter initializer for bean 'characterEncodingFilter'; order=-2147483648, resource=class path resource [org/springframework/boot/autoconfigure/web/servlet/HttpEncodingAutoConfiguration.class]
2018-03-18 02:40:58.051 DEBUG 16664 --- [ost-startStop-1] o.s.b.w.s.ServletContextInitializerBeans : Created Filter initializer for bean 'hiddenHttpMethodFilter'; order=-10000, resource=class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration.class]
2018-03-18 02:40:58.052 DEBUG 16664 --- [ost-startStop-1] o.s.b.w.s.ServletContextInitializerBeans : Created Filter initializer for bean 'httpPutFormContentFilter'; order=-9900, resource=class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration.class]
2018-03-18 02:40:58.052 DEBUG 16664 --- [ost-startStop-1] o.s.b.w.s.ServletContextInitializerBeans : Created Filter initializer for bean 'requestContextFilter'; order=-105, resource=class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter.class]
2018-03-18 02:40:58.052 DEBUG 16664 --- [ost-startStop-1] o.s.b.w.s.ServletContextInitializerBeans : Created Filter initializer for bean 'httpTraceFilter'; order=2147483637, resource=class path resource [org/springframework/boot/actuate/autoconfigure/trace/http/HttpTraceAutoConfiguration$ServletTraceFilterConfiguration.class]
2018-03-18 02:40:58.065  INFO 16664 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean  : Servlet dispatcherServlet mapped to [/]
2018-03-18 02:40:58.070  INFO 16664 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'characterEncodingFilter' to: [/*]
2018-03-18 02:40:58.071  INFO 16664 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2018-03-18 02:40:58.072  INFO 16664 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2018-03-18 02:40:58.072  INFO 16664 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'requestContextFilter' to: [/*]
2018-03-18 02:40:58.072  INFO 16664 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'httpTraceFilter' to: [/*]
2018-03-18 02:40:58.073  INFO 16664 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'webMvcMetricsFilter' to: [/*]
2018-03-18 02:40:58.090 DEBUG 16664 --- [ost-startStop-1] o.s.b.w.s.f.OrderedRequestContextFilter  : Initializing filter 'requestContextFilter'
2018-03-18 02:40:58.092 DEBUG 16664 --- [ost-startStop-1] o.s.b.w.s.f.OrderedRequestContextFilter  : Filter 'requestContextFilter' configured successfully
2018-03-18 02:40:58.095 DEBUG 16664 --- [ost-startStop-1] o.s.b.a.m.w.servlet.WebMvcMetricsFilter  : Initializing filter 'webMvcMetricsFilter'
2018-03-18 02:40:58.096 DEBUG 16664 --- [ost-startStop-1] o.s.b.a.m.w.servlet.WebMvcMetricsFilter  : Filter 'webMvcMetricsFilter' configured successfully
2018-03-18 02:40:58.097 DEBUG 16664 --- [ost-startStop-1] .b.w.s.f.OrderedHttpPutFormContentFilter : Initializing filter 'httpPutFormContentFilter'
2018-03-18 02:40:58.097 DEBUG 16664 --- [ost-startStop-1] .b.w.s.f.OrderedHttpPutFormContentFilter : Filter 'httpPutFormContentFilter' configured successfully
2018-03-18 02:40:58.097 DEBUG 16664 --- [ost-startStop-1] .s.b.w.s.f.OrderedHiddenHttpMethodFilter : Initializing filter 'hiddenHttpMethodFilter'
2018-03-18 02:40:58.098 DEBUG 16664 --- [ost-startStop-1] .s.b.w.s.f.OrderedHiddenHttpMethodFilter : Filter 'hiddenHttpMethodFilter' configured successfully
2018-03-18 02:40:58.098 DEBUG 16664 --- [ost-startStop-1] s.b.w.s.f.OrderedCharacterEncodingFilter : Initializing filter 'characterEncodingFilter'
2018-03-18 02:40:58.099 DEBUG 16664 --- [ost-startStop-1] s.b.w.s.f.OrderedCharacterEncodingFilter : Filter 'characterEncodingFilter' configured successfully
2018-03-18 02:40:58.099 DEBUG 16664 --- [ost-startStop-1] o.s.b.a.w.trace.servlet.HttpTraceFilter  : Initializing filter 'httpTraceFilter'
2018-03-18 02:40:58.099 DEBUG 16664 --- [ost-startStop-1] o.s.b.a.w.trace.servlet.HttpTraceFilter  : Filter 'httpTraceFilter' configured successfully
2018-03-18 02:40:58.265  INFO 16664 --- [  restartedMain] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
2018-03-18 02:40:58.836  INFO 16664 --- [  restartedMain] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Start completed.
2018-03-18 02:40:58.917  INFO 16664 --- [  restartedMain] j.LocalContainerEntityManagerFactoryBean : Building JPA container EntityManagerFactory for persistence unit 'default'
2018-03-18 02:40:58.937  INFO 16664 --- [  restartedMain] o.hibernate.jpa.internal.util.LogHelper  : HHH000204: Processing PersistenceUnitInfo [
    name: default
    ...]
2018-03-18 02:40:59.046  INFO 16664 --- [  restartedMain] org.hibernate.Version                    : HHH000412: Hibernate Core {5.2.14.Final}
2018-03-18 02:40:59.048  INFO 16664 --- [  restartedMain] org.hibernate.cfg.Environment            : HHH000206: hibernate.properties not found
2018-03-18 02:40:59.100  INFO 16664 --- [  restartedMain] o.hibernate.annotations.common.Version   : HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
2018-03-18 02:40:59.251  INFO 16664 --- [  restartedMain] org.hibernate.dialect.Dialect            : HHH000400: Using dialect: org.hibernate.dialect.MySQL5Dialect
2018-03-18 02:41:00.092  WARN 16664 --- [  restartedMain] ConfigServletWebServerApplicationContext : 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/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory
2018-03-18 02:41:00.094  INFO 16664 --- [  restartedMain] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown initiated...
2018-03-18 02:41:00.106  INFO 16664 --- [  restartedMain] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown completed.
2018-03-18 02:41:00.111  INFO 16664 --- [  restartedMain] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2018-03-18 02:41:00.135 DEBUG 16664 --- [  restartedMain] o.s.boot.devtools.restart.Restarter      : Creating new Restarter for thread Thread[main,5,main]
2018-03-18 02:41:00.135 DEBUG 16664 --- [  restartedMain] o.s.boot.devtools.restart.Restarter      : Immediately restarting application
2018-03-18 02:41:00.136 DEBUG 16664 --- [  restartedMain] o.s.boot.devtools.restart.Restarter      : Created RestartClassLoader org.springframework.boot.devtools.restart.classloader.RestartClassLoader@20f4e97e
2018-03-18 02:41:00.136 DEBUG 16664 --- [  restartedMain] o.s.boot.devtools.restart.Restarter      : Starting application com.owozniak.bigdataproject.BigDataProjectApplication with URLs [file:/home/oscar/IdeaProjects/big-data-project/out/production/classes/, file:/home/oscar/IdeaProjects/big-data-project/out/production/resources/]

Process finished with exit code 0

Server is working when I remove all of annotations acording spring data jpa (@Entity, @OneToMay etc)

Oskar Woźniak
  • 715
  • 2
  • 10
  • 25
  • 1
    Is this really all you get? No stack trace? (btw. Hikari is fine) – Pavel Horal Mar 18 '18 at 01:17
  • 1
    You could try setting `debug=true` in your application.properties – larsgrefer Mar 18 '18 at 01:30
  • @larsgrefer I post log in my post – Oskar Woźniak Mar 18 '18 at 01:59
  • If I remove all annotations from "javax.persistence" it is working well – Oskar Woźniak Mar 18 '18 at 02:00
  • Did you change the logging configuration? (Logback.xml or logging related properties?) – larsgrefer Mar 18 '18 at 02:12
  • @larsgrefer no, I din't change anything according logging – Oskar Woźniak Mar 18 '18 at 02:19
  • there is error in hibernate initialization. change hibernate logging level. ConfigServletWebServerApplicationContext : 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/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory – lucid Mar 18 '18 at 04:39
  • check this: similar solution to exception in stacktrace : https://stackoverflow.com/questions/40058001/error-creating-bean-with-name-entitymanagerfactory-defined-in-class-path-resou – dkb Mar 18 '18 at 05:31

4 Answers4

1

I "solved" it by changing gradle to maven

Oskar Woźniak
  • 715
  • 2
  • 10
  • 25
0

If you are using MySQL database, you might be facing the following problem: https://hibernate.atlassian.net/browse/HHH-10490

Change the following line:

properties.setProperty("hibernate.default_schema", defaultSchema);

to:

properties.setProperty("hibernate.default_catalog", defaultSchema);

Note that you might want to change the attribute name from "defaultSchema" to "defaultCatalog" as well.

Mahesh_Loya
  • 2,743
  • 3
  • 16
  • 28
-1

this can be related to your issue: spring boot discussion

spring boot github issue

You can also debug SpringApplication#reportFailure in the end (after catch (throwable)) it has generic logging of any error:

logger.error("Application run failed", ex)

In my case I had the logger from commons-logging which prevented logging to happen.

Vadim Kirilchuk
  • 3,532
  • 4
  • 32
  • 49
-1

APPLICATION FAILED TO START


Description:

Field studentServiceImpl in com.edubridge.springbootpostman.controller.HomeController required a bean of type 'com.edubridge.springbootpostman.serviceimpl.StudentServiceImpl' that could not be found.

The injection point has the following annotations:
    - @org.springframework.beans.factory.annotation.Autowired(required=true)


Action:

Consider defining a bean of type 'com.edubridge.springbootpostman.serviceimpl.StudentServiceImpl' in your configuration.

Either you are missing @Component/@Service on your StudentServiceImpl/interface respectively or missing to define a bean in your Configuration file

Harsh
  • 812
  • 1
  • 10
  • 23