当前位置: 首页 > 知识库问答 >
问题:

Spring Boot-在上下文初始化期间遇到异常。如何知道错误的原因?

周宸
2023-03-14

当没有堆栈跟踪时,我如何知道问题是什么?我可以启用某些选项吗?我刚刚用spring初始化器创建了一个小项目,这就是我得到的

更新的日志(带有调试标志)

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: 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

共有1个答案

齐弘业
2023-03-14

我通过将gradle更改为maven来“解决”它

 类似资料:
  • 我正在尝试用mysql和flyway运行我的Spring项目引导 我的环境: > Linux 18.04 Java 1.8.0_201 application.yml v1__init.sql user.java

  • 在使用PostgreSQL数据库启动sprint boot应用程序时出现错误,我试图找到一个解决方案,但到目前为止还没有找到。 这里有个错误: 2018-03-29 17:48:17.945警告13508--[main]ationConfigEmbeddedWebApplicationContext:上下文初始化过程中遇到异常-取消刷新尝试:org.springFramework.Beans.Fa

  • 我所有的春靴项目都不会突然起作用。我创建了一个新的Spring Boot项目,没有添加任何类。当我开始这个项目时,我还是有一个错误。 以下是错误: 我已经检查了现有的类似错误,但它总是与代码有关。在我的例子中,没有添加代码。 我已经编辑了这个项目。实际上,这个项目做得很好。现在我认为在spring依赖项中有一个混合

  • 在Spring Boot上下文的初始化过程中,有什么方法可以处理异常吗? 我的案例是在作业执行过程中处理错误,并根据发生的异常做一些工作。 例如,我有一个由读者和作家组成的工作。读取器和写入器使用以下属性初始化:rootFolder、inFolder、outfolder。这个简单的作业从/rootfolder/infolder/test.txt读取文件,并将数据写入rootfolder/outfo

  • 我在做一个春靴项目。然后我尝试将mysql数据库连接到那个项目。我得到了名为“hikaripool-1-exception distry pool initialization”的错误。 这是整个StackTrace。

  • 我正在部署Spring-Boot4项目,但在池初始化期间出现了一个名为 我不明白这是什么意思。我已经在StackOverflow中搜索了错误。有一些关于HikariPool的问题,但没有一个对我有效。 我的如下所示,