我想在Spring Tool Suite中运行Spring Boot项目,所以当我作为Spring Boot App运行时,我的日志文件中会出现此错误:
> Application failed to start with classpath: [file:/C:/Users/Xonos/Desktop/ElasticSpringIndexer/target/classes/, file:/C:/Users/Xonos/.m2/repository/org/springframework/boot/spring-boot-starter-data-jpa/1.2.3.RELEASE/spring-boot-starter-data-jpa-1.2.3.RELEASE.jar, file:/C:/Users/Xonos/.m2/repository/org/springframework/boot/spring-boot-starter/1.2.3.RELEASE/spring-boot-starter-1.2.3.RELEASE.jar, file:/C:/Users/Xonos/.m2/repository/org/springframework/boot/spring-boot/1.2.3.RELEASE/spring-boot-1.2.3.RELEASE.jar, file:/C:/Users/Xonos/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/1.2.3.RELEASE/spring-boot-autoconfigure-1.2.3.RELEASE.jar, file:/C:/Users/Xonos/.m2/repository/org/springframework/boot/spring-boot-starter-logging/1.2.3.RELEASE/spring-boot-starter-logging-1.2.3.RELEASE.jar, file:/C:/Users/Xonos/.m2/repository/org/slf4j/jul-to-slf4j/1.7.11/jul-to-slf4j-1.7.11.jar, file:/C:/Users/Xonos/.m2/repository/org/slf4j/log4j-over-slf4j/1.7.11/log4j-over-slf4j-1.7.11.jar, file:/C:/Users/Xonos/.m2/repository/ch/qos/logback/logback-classic/1.1.3/logback-classic-1.1.3.jar, file:/C:/Users/Xonos/.m2/repository/ch/qos/logback/logback-core/1.1.3/logback-core-1.1.3.jar, file:/C:/Users/Xonos/.m2/repository/org/yaml/snakeyaml/1.14/snakeyaml-1.14.jar, file:/C:/Users/Xonos/.m2/repository/org/springframework/boot/spring-boot-starter-aop/1.2.3.RELEASE/spring-boot-starter-aop-1.2.3.RELEASE.jar, file:/C:/Users/Xonos/.m2/repository/org/aspectj/aspectjrt/1.8.5/aspectjrt-1.8.5.jar, file:/C:/Users/Xonos/.m2/repository/org/aspectj/aspectjweaver/1.8.5/aspectjweaver-1.8.5.jar, file:/C:/Users/Xonos/.m2/repository/org/springframework/spring-core/4.1.6.RELEASE/spring-core-4.1.6.RELEASE.jar, file:/C:/Users/Xonos/.m2/repository/org/springframework/boot/spring-boot-starter-jdbc/1.2.3.RELEASE/spring-boot-starter-jdbc-1.2.3.RELEASE.jar, file:/C:/Users/Xonos/.m2/repository/org/springframework/spring-jdbc/4.1.6.RELEASE/spring-jdbc-4.1.6.RELEASE.jar, file:/C:/Users/Xonos/.m2/repository/org/apache/tomcat/tomcat-jdbc/8.0.20/tomcat-jdbc-8.0.20.jar, file:/C:/Users/Xonos/.m2/repository/org/apache/tomcat/tomcat-juli/8.0.20/tomcat-juli-8.0.20.jar, file:/C:/Users/Xonos/.m2/repository/org/hibernate/hibernate-entitymanager/4.3.8.Final/hibernate-entitymanager-4.3.8.Final.jar, file:/C:/Users/Xonos/.m2/repository/org/jboss/logging/jboss-logging/3.1.3.GA/jboss-logging-3.1.3.GA.jar, file:/C:/Users/Xonos/.m2/repository/org/jboss/logging/jboss-logging-annotations/1.2.0.Beta1/jboss-logging-annotations-1.2.0.Beta1.jar, file:/C:/Users/Xonos/.m2/repository/org/hibernate/hibernate-core/4.3.8.Final/hibernate-core-4.3.8.Final.jar, file:/C:/Users/Xonos/.m2/repository/antlr/antlr/2.7.7/antlr-2.7.7.jar, file:/C:/Users/Xonos/.m2/repository/org/jboss/jandex/1.1.0.Final/jandex-1.1.0.Final.jar, file:/C:/Users/Xonos/.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar, file:/C:/Users/Xonos/.m2/repository/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar, file:/C:/Users/Xonos/.m2/repository/org/hibernate/common/hibernate-commons-annotations/4.0.5.Final/hibernate-commons-annotations-4.0.5.Final.jar, file:/C:/Users/Xonos/.m2/repository/org/hibernate/javax/persistence/hibernate-jpa-2.1-api/1.0.0.Final/hibernate-jpa-2.1-api-1.0.0.Final.jar, file:/C:/Users/Xonos/.m2/repository/org/javassist/javassist/3.18.1-GA/javassist-3.18.1-GA.jar, file:/C:/Users/Xonos/.m2/repository/javax/transaction/javax.transaction-api/1.2/javax.transaction-api-1.2.jar, file:/C:/Users/Xonos/.m2/repository/org/springframework/spring-orm/4.1.6.RELEASE/spring-orm-4.1.6.RELEASE.jar, file:/C:/Users/Xonos/.m2/repository/org/springframework/data/spring-data-jpa/1.7.2.RELEASE/spring-data-jpa-1.7.2.RELEASE.jar, file:/C:/Users/Xonos/.m2/repository/org/springframework/spring-aspects/4.1.6.RELEASE/spring-aspects-4.1.6.RELEASE.jar, file:/C:/Users/Xonos/.m2/repository/com/h2database/h2/1.4.185/h2-1.4.185.jar, file:/C:/Users/Xonos/.m2/repository/org/hsqldb/hsqldb/2.3.2/hsqldb-2.3.2.jar, file:/C:/Users/Xonos/.m2/repository/commons-dbcp/commons-dbcp/1.4/commons-dbcp-1.4.jar, file:/C:/Users/Xonos/.m2/repository/commons-pool/commons-pool/1.6/commons-pool-1.6.jar, file:/C:/Users/Xonos/.m2/repository/mysql/mysql-connector-java/5.1.34/mysql-connector-java-5.1.34.jar, file:/C:/Users/Xonos/.m2/repository/org/springframework/spring-test/4.1.6.RELEASE/spring-test-4.1.6.RELEASE.jar, file:/C:/Users/Xonos/.m2/repository/org/springframework/spring-web/4.1.6.RELEASE/spring-web-4.1.6.RELEASE.jar, file:/C:/Users/Xonos/.m2/repository/org/springframework/spring-aop/4.1.6.RELEASE/spring-aop-4.1.6.RELEASE.jar, file:/C:/Users/Xonos/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar, file:/C:/Users/Xonos/.m2/repository/org/springframework/spring-beans/4.1.6.RELEASE/spring-beans-4.1.6.RELEASE.jar, file:/C:/Users/Xonos/.m2/repository/org/springframework/spring-context/4.1.6.RELEASE/spring-context-4.1.6.RELEASE.jar, file:/C:/Users/Xonos/.m2/repository/org/springframework/spring-expression/4.1.6.RELEASE/spring-expression-4.1.6.RELEASE.jar, file:/C:/Users/Xonos/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.4.5/jackson-databind-2.4.5.jar, file:/C:/Users/Xonos/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.4.5/jackson-annotations-2.4.5.jar, file:/C:/Users/Xonos/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.4.5/jackson-core-2.4.5.jar, file:/C:/Users/Xonos/.m2/repository/org/springframework/data/spring-data-elasticsearch/1.2.0.RELEASE/spring-data-elasticsearch-1.2.0.RELEASE.jar, file:/C:/Users/Xonos/.m2/repository/org/springframework/spring-tx/4.1.6.RELEASE/spring-tx-4.1.6.RELEASE.jar, file:/C:/Users/Xonos/.m2/repository/org/springframework/data/spring-data-commons/1.9.2.RELEASE/spring-data-commons-1.9.2.RELEASE.jar, file:/C:/Users/Xonos/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar, file:/C:/Users/Xonos/.m2/repository/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar, file:/C:/Users/Xonos/.m2/repository/joda-time/joda-time/2.5/joda-time-2.5.jar, file:/C:/Users/Xonos/.m2/repository/org/elasticsearch/elasticsearch/1.4.4/elasticsearch-1.4.4.jar, file:/C:/Users/Xonos/.m2/repository/org/apache/lucene/lucene-core/4.10.3/lucene-core-4.10.3.jar, file:/C:/Users/Xonos/.m2/repository/org/apache/lucene/lucene-analyzers-common/4.10.3/lucene-analyzers-common-4.10.3.jar, file:/C:/Users/Xonos/.m2/repository/org/apache/lucene/lucene-queries/4.10.3/lucene-queries-4.10.3.jar, file:/C:/Users/Xonos/.m2/repository/org/apache/lucene/lucene-memory/4.10.3/lucene-memory-4.10.3.jar, file:/C:/Users/Xonos/.m2/repository/org/apache/lucene/lucene-highlighter/4.10.3/lucene-highlighter-4.10.3.jar, file:/C:/Users/Xonos/.m2/repository/org/apache/lucene/lucene-queryparser/4.10.3/lucene-queryparser-4.10.3.jar, file:/C:/Users/Xonos/.m2/repository/org/apache/lucene/lucene-sandbox/4.10.3/lucene-sandbox-4.10.3.jar, file:/C:/Users/Xonos/.m2/repository/org/apache/lucene/lucene-suggest/4.10.3/lucene-suggest-4.10.3.jar, file:/C:/Users/Xonos/.m2/repository/org/apache/lucene/lucene-misc/4.10.3/lucene-misc-4.10.3.jar, file:/C:/Users/Xonos/.m2/repository/org/apache/lucene/lucene-join/4.10.3/lucene-join-4.10.3.jar, file:/C:/Users/Xonos/.m2/repository/org/apache/lucene/lucene-grouping/4.10.3/lucene-grouping-4.10.3.jar, file:/C:/Users/Xonos/.m2/repository/org/apache/lucene/lucene-spatial/4.10.3/lucene-spatial-4.10.3.jar, file:/C:/Users/Xonos/.m2/repository/com/spatial4j/spatial4j/0.4.1/spatial4j-0.4.1.jar, file:/C:/Users/Xonos/.m2/repository/org/antlr/antlr-runtime/3.5/antlr-runtime-3.5.jar, file:/C:/Users/Xonos/.m2/repository/org/ow2/asm/asm/4.1/asm-4.1.jar, file:/C:/Users/Xonos/.m2/repository/org/ow2/asm/asm-commons/4.1/asm-commons-4.1.jar, file:/C:/Users/Xonos/.m2/repository/org/slf4j/slf4j-api/1.7.11/slf4j-api-1.7.11.jar, file:/C:/Users/Xonos/.m2/repository/org/slf4j/jcl-over-slf4j/1.7.11/jcl-over-slf4j-1.7.11.jar] [7556] [o.s.b.l.ClasspathLoggingApplicationListener]
16:00:35.820 INFO -
> Error starting ApplicationContext. To display the auto-configuration report enabled debug logging (start with --debug)
> [7557] [o.s.b.a.l.AutoConfigurationReportLoggingInitializer]
16:00:35.826 ERROR - Application startup failed [7563] [o.s.boot.SpringApplication]
java.lang.IllegalStateException: Failed to execute CommandLineRunner
at org.springframework.boot.SpringApplication.runCommandLineRunners(SpringApplication.java:675) [spring-boot-1.2.3.RELEASE.jar:1.2.3.RELEASE]
at org.springframework.boot.SpringApplication.afterRefresh(SpringApplication.java:690) [spring-boot-1.2.3.RELEASE.jar:1.2.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:321) [spring-boot-1.2.3.RELEASE.jar:1.2.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:957) [spring-boot-1.2.3.RELEASE.jar:1.2.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:946) [spring-boot-1.2.3.RELEASE.jar:1.2.3.RELEASE]
at my.com.tmgeomatics.ElasticIndexer.geocoding.EsIndexingApplication.main(EsIndexingApplication.java:44) [classes/:na]
Caused by: java.lang.ArithmeticException: / by zero
at my.com.tmgeomatics.ElasticIndexer.util.ProgressBar.update(ProgressBar.java:30) ~[classes/:na]
at my.com.tmgeomatics.ElasticIndexer.geocoding.EsIndexingApplication.BulkIndexing(EsIndexingApplication.java:82) [classes/:na]
at my.com.tmgeomatics.ElasticIndexer.geocoding.EsIndexingApplication.run(EsIndexingApplication.java:53) [classes/:na]
at org.springframework.boot.SpringApplication.runCommandLineRunners(SpringApplication.java:672) [spring-boot-1.2.3.RELEASE.jar:1.2.3.RELEASE]
... 5 common frames omitted
主要关注的是应用程序无法以classpath启动,我的猜测是因为我的项目无法获取DB文件和许多其他函数,这就是为什么最终它出来的错误表示除以零错误,因为它根本无法检索任何数据...
我环顾四周但根本找不到任何答案,希望大家都能帮忙......