Java spring boot应用程序正在关闭,无错误
我正在运行一个springboot应用程序,其中mysql、web、jpa作为依赖项。我已经用数据库属性配置了Java spring boot应用程序正在关闭,无错误,java,spring,spring-boot,Java,Spring,Spring Boot,我正在运行一个springboot应用程序,其中mysql、web、jpa作为依赖项。我已经用数据库属性配置了application.properties文件。有关以下详细信息,请参阅日志: 2018-08-16 10:02:00.746 INFO 10472 --- [ restartedMain] com.classpath.CrudApplication : Starting CrudApplication on LAPTOP-MAI0FJBD with PID
application.properties
文件。有关以下详细信息,请参阅日志:
2018-08-16 10:02:00.746 INFO 10472 --- [ restartedMain] com.classpath.CrudApplication : Starting CrudApplication on LAPTOP-MAI0FJBD with PID 10472 (C:\Users\classpath\packt\Downloads\crud\target\classes started by classpath in C:\Users\classpath\packt\Downloads\crud)
2018-08-16 10:02:00.748 INFO 10472 --- [ restartedMain] com.classpath.CrudApplication : No active profile set, falling back to default profiles: default
2018-08-16 10:02:00.876 INFO 10472 --- [ restartedMain] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@17bd80f6: startup date [Thu Aug 16 10:02:00 IST 2018]; root of context hierarchy
2018-08-16 10:02:02.107 INFO 10472 --- [ restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$437af157] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2018-08-16 10:02:02.370 INFO 10472 --- [ restartedMain] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2018-08-16 10:02:02.572 INFO 10472 --- [ restartedMain] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
2018-08-16 10:02:02.602 INFO 10472 --- [ restartedMain] j.LocalContainerEntityManagerFactoryBean : Building JPA container EntityManagerFactory for persistence unit 'default'
2018-08-16 10:02:02.616 INFO 10472 --- [ restartedMain] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [
name: default
...]
2018-08-16 10:02:02.670 INFO 10472 --- [ restartedMain] org.hibernate.Version : HHH000412: Hibernate Core {5.2.17.Final}
2018-08-16 10:02:02.671 INFO 10472 --- [ restartedMain] org.hibernate.cfg.Environment : HHH000206: hibernate.properties not found
2018-08-16 10:02:02.708 INFO 10472 --- [ restartedMain] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
2018-08-16 10:02:02.847 INFO 10472 --- [ restartedMain] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQL5InnoDBDialect
2018-08-16 10:02:03.377 INFO 10472 --- [ restartedMain] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2018-08-16 10:02:04.183 INFO 10472 --- [ restartedMain] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 35729
2018-08-16 10:02:04.206 INFO 10472 --- [ restartedMain] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2018-08-16 10:02:04.207 INFO 10472 --- [ restartedMain] o.s.j.e.a.AnnotationMBeanExporter : Bean with name 'dataSource' has been autodetected for JMX exposure
2018-08-16 10:02:04.210 INFO 10472 --- [ restartedMain] o.s.j.e.a.AnnotationMBeanExporter : Located MBean 'dataSource': registering with JMX server as MBean [com.zaxxer.hikari:name=dataSource,type=HikariDataSource]
2018-08-16 10:02:04.221 INFO 10472 --- [ restartedMain] com.classpath.CrudApplication : Started CrudApplication in 3.814 seconds (JVM running for 4.411)
2018-08-16 10:02:04.225 INFO 10472 --- [ Thread-10] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@17bd80f6: startup date [Thu Aug 16 10:02:00 IST 2018]; root of context hierarchy
2018-08-16 10:02:04.228 INFO 10472 --- [ Thread-10] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans on shutdown
2018-08-16 10:02:04.228 INFO 10472 --- [ Thread-10] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans
2018-08-16 10:02:04.229 INFO 10472 --- [ Thread-10] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2018-08-16 10:02:04.230 INFO 10472 --- [ Thread-10] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
2018-08-16 10:02:04.233 INFO 10472 --- [ Thread-10] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.
Process finished with exit code 0
我已创建git存储库并将代码上载到Github-
我还附上了pom.xml
,以供参考
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.classpath</groupId>
<artifactId>crud</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>crud</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.4.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
4.0.0
com.classpath
积垢
0.0.1-快照
罐子
积垢
SpringBoot的演示项目
org.springframework.boot
spring启动程序父级
2.0.4.1发布
UTF-8
UTF-8
1.8
org.springframework.boot
弹簧靴起动器执行器
org.springframework.boot
spring引导启动器数据jpa
org.springframework.boot
弹簧启动安全
org.springframework.boot
SpringBootStarterWeb
org.springframework.boot
弹簧靴开发工具
运行时
org.springframework.boot
弹簧起动试验
测验
org.springframework.security
弹簧安全性试验
测验
mysql
mysql连接器java
org.springframework.boot
springbootmaven插件
我应该如何调试此错误。请告诉我,这里有很多神奇之处。应用程序日志中的条件评估报告显示嵌入式servlet容器未配置为
javax.servlet。ServletRequest
不在类路径上:
ServletWebServerFactoryAutoConfiguration:
Did not match:
- @ConditionalOnClass did not find required class 'javax.servlet.ServletRequest' (OnClassCondition)
它应该在类路径上,因为您依赖于springbootstarterweb
,它引入了包含所有Servlet API类的tomcatembeddedcore
。应用程序日志还显示C:\Users\classpath\.m2\repository\org\apache\tomcat\embed\tomcat-embed-core\8.5.32\tomcat-embed-core-8.5.32.jar
位于类路径上
要使jar文件位于类路径上并且找不到它所包含的类,jar文件必须已损坏。当Maven下载jar时,就会发生这种情况。尝试删除
C:\Users\classpath\.m2\repository\org\apache\tomcat\embed\tomcat-embed-core\8.5.32\
目录并重建应用程序。这将导致Maven下载jar的新副本,希望这次不会损坏它。应用程序日志中的条件评估报告显示嵌入式servlet容器未配置为javax.servlet。ServletRequest
不在类路径上:
ServletWebServerFactoryAutoConfiguration:
Did not match:
- @ConditionalOnClass did not find required class 'javax.servlet.ServletRequest' (OnClassCondition)
它应该在类路径上,因为您依赖于springbootstarterweb
,它引入了包含所有Servlet API类的tomcatembeddedcore
。应用程序日志还显示C:\Users\classpath\.m2\repository\org\apache\tomcat\embed\tomcat-embed-core\8.5.32\tomcat-embed-core-8.5.32.jar
位于类路径上
要使jar文件位于类路径上并且找不到它所包含的类,jar文件必须已损坏。当Maven下载jar时,就会发生这种情况。尝试删除
C:\Users\classpath\.m2\repository\org\apache\tomcat\embed\tomcat-embed-core\8.5.32\
目录并重建应用程序。这将导致Maven下载jar的新副本,希望这次不会损坏它。最后,我解决了这个问题。我删除了.m2
中的存储库目录,并再次构建了整个项目。这一次,它成功了。最后,我解决了这个问题。我删除了.m2
中的存储库目录,并再次构建了整个项目。这一次,,它成功了。您是如何启动服务器的?@Pramod正在IntelliJ Idea中以java程序的形式运行CrudApplication。您能分享一下pom吗。xml@zilcuanu以spring boot:run
为目标,以maven项目的形式运行该项目。@Pramod如何在IntelliJ Idea上做到这一点?如何启动服务器?@Pramod运行CrudApplication作为IntelliJ Idea的java程序。请分享一下pom。xml@zilcuanu以springboot:run
为目标,以maven项目的形式运行该项目。@Pramod如何在IntellijIDEA上做到这一点?这很有效。很好的故障排除,让我知道如何解决这些问题。这很有效。很好的故障排除和让我知道,如何解决这些问题。