简体   繁体   English

重新启动计算机后,Spring Boot无法启动

[英]Spring boot failing to start after Computer restart

POM File: POM文件:

<?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.PMDCodeReview</groupId>
    <artifactId>pmdreview</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>pmdreview</name>
    <description>Code Review in HTML format</description>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.5.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-jersey</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>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.8.0</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-data-mongodb -->
        <!--<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-mongodb</artifactId>
            <version>1.5.4.RELEASE</version>
        </dependency>-->

        <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.6</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/rhino/js -->
        <dependency>
            <groupId>rhino</groupId>
            <artifactId>js</artifactId>
            <version>1.7R2</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/com.force.api/force-wsc -->
        <dependency>
            <groupId>com.force.api</groupId>
            <artifactId>force-wsc</artifactId>
            <version>40.1.1</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/com.force.api/force-apex-api -->
        <dependency>
            <groupId>com.force.api</groupId>
            <artifactId>force-apex-api</artifactId>
            <version>40.0.0</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/com.force.api/force-metadata-api -->
        <dependency>
            <groupId>com.force.api</groupId>
            <artifactId>force-metadata-api</artifactId>
            <version>40.0.0</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/com.force.api/force-partner-api -->
        <dependency>
            <groupId>com.force.api</groupId>
            <artifactId>force-partner-api</artifactId>
            <version>40.0.0</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.apache.ant/ant -->
        <dependency>
            <groupId>org.apache.ant</groupId>
            <artifactId>ant</artifactId>
            <version>1.10.1</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.apache.ant/ant-launcher -->
        <dependency>
            <groupId>org.apache.ant</groupId>
            <artifactId>ant-launcher</artifactId>
            <version>1.10.1</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.5</version>
        </dependency>


        <dependency>
            <groupId>com.force.toolingAPI</groupId>
            <artifactId>toolingAPI</artifactId>
            <version>4.0.2</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/src/main/resources/tooling-force.com-0.4.0.2.jar</systemPath>
        </dependency>


    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>


</project>

The spring boot used to start without any errors, but now it throws an error : spring boot曾经启动时没有任何错误,但是现在它引发了一个错误:

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

2018-01-21 13:23:42.998  INFO 9992 --- [  restartedMain] com.pmdcodereview.PmdreviewApplication   : Starting PmdreviewApplication on USBLRNAGESINGH1 with PID 9992 (C:\Users\nagesingh\IdeaProjects\ApexEditorIDE\target\classes started by nagesingh in C:\Users\nagesingh\IdeaProjects\ApexEditorIDE)
2018-01-21 13:23:42.998  INFO 9992 --- [  restartedMain] com.pmdcodereview.PmdreviewApplication   : No active profile set, falling back to default profiles: default
2018-01-21 13:23:43.146  WARN 9992 --- [  restartedMain] o.s.b.c.e.EventPublishingRunListener     : Error calling ApplicationEventListener

java.lang.NoSuchMethodError: org.apache.commons.logging.Log.debug(Ljava/lang/Object;Ljava/lang/Throwable;)V
    at org.springframework.boot.logging.DeferredLog$Line.replayTo(DeferredLog.java:172) ~[spring-boot-1.5.4.RELEASE.jar:1.5.4.RELEASE]
    at org.springframework.boot.logging.DeferredLog.replayTo(DeferredLog.java:136) ~[spring-boot-1.5.4.RELEASE.jar:1.5.4.RELEASE]
    at org.springframework.boot.logging.DeferredLog.replay(DeferredLog.java:147) ~[spring-boot-1.5.4.RELEASE.jar:1.5.4.RELEASE]
    at org.springframework.boot.devtools.restart.Restarter.finish(Restarter.java:407) ~[spring-boot-devtools-1.5.4.RELEASE.jar:1.5.4.RELEASE]
    at org.springframework.boot.devtools.restart.RestartApplicationListener.onApplicationEvent(RestartApplicationListener.java:52) ~[spring-boot-devtools-1.5.4.RELEASE.jar:1.5.4.RELEASE]
    at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:159) [spring-context-4.3.9.RELEASE.jar:4.3.9.RELEASE]
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) [spring-context-4.3.9.RELEASE.jar:4.3.9.RELEASE]
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:122) [spring-context-4.3.9.RELEASE.jar:4.3.9.RELEASE]
    at org.springframework.boot.context.event.EventPublishingRunListener.finished(EventPublishingRunListener.java:115) [spring-boot-1.5.4.RELEASE.jar:1.5.4.RELEASE]
    at org.springframework.boot.SpringApplicationRunListeners.callFinishedListener(SpringApplicationRunListeners.java:79) [spring-boot-1.5.4.RELEASE.jar:1.5.4.RELEASE]
    at org.springframework.boot.SpringApplicationRunListeners.finished(SpringApplicationRunListeners.java:72) [spring-boot-1.5.4.RELEASE.jar:1.5.4.RELEASE]
    at org.springframework.boot.SpringApplication.handleRunFailure(SpringApplication.java:745) [spring-boot-1.5.4.RELEASE.jar:1.5.4.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:314) [spring-boot-1.5.4.RELEASE.jar:1.5.4.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118) [spring-boot-1.5.4.RELEASE.jar:1.5.4.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107) [spring-boot-1.5.4.RELEASE.jar:1.5.4.RELEASE]
    at com.pmdcodereview.PmdreviewApplication.main(PmdreviewApplication.java:11) [classes/:na]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_151]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_151]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_151]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_151]
    at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) [spring-boot-devtools-1.5.4.RELEASE.jar:1.5.4.RELEASE]

The only change I did was to restart the system, and nothing else. 我所做的唯一更改是重新启动系统,而没有其他操作。 It used to start properly but after restarts it shuts down with the above error. 它曾经可以正常启动,但重新启动后会因上述错误而关闭。 I have even tried removing commons-lang3 also, but same error keeps on coming. 我什至也尝试过删除commons-lang3 ,但是同样的错误不断出现。 Please help. 请帮忙。

mvn dependency:tree -Dverbose -Dincludes=org.springframework mvn依赖项:tree -Dverbose -Dincludes = org.springframework

This is the result 这是结果

C:\Java8\jdk\bin\java -Dmaven.multiModuleProjectDirectory=C:\Users\nagesingh\IdeaProjects\ApexEditorIDE -Dmaven.home=C:\apacheMaven\apache-maven-3.5.0 -Dclassworlds.conf=C:\apacheMaven\apache-maven-3.5.0\bin\m2.conf "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2017.3\lib\idea_rt.jar=50494:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2017.3\bin" -Dfile.encoding=UTF-8 -classpath C:\apacheMaven\apache-maven-3.5.0\boot\plexus-classworlds-2.5.2.jar org.codehaus.classworlds.Launcher -Didea.version=2017.3.1 dependency:tree -Dverbose -Dincludes=org.springframework
[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for com.PMDCodeReview:pmdreview:jar:0.0.1-SNAPSHOT
[WARNING] 'dependencies.dependency.systemPath' for com.force.toolingAPI:toolingAPI:jar should not point at files within the project directory, ${project.basedir}/src/main/resources/tooling-force.com-0.4.0.2.jar will be unresolvable by dependent projects @ line 130, column 16
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] Building pmdreview 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-dependency-plugin:2.10:tree (default-cli) @ pmdreview ---
[WARNING] Using Maven 2 dependency tree to get verbose output, which may be inconsistent with actual Maven 3 resolution
[INFO] com.PMDCodeReview:pmdreview:jar:0.0.1-SNAPSHOT
[INFO] +- org.springframework.boot:spring-boot-starter-jersey:jar:1.5.4.RELEASE:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter:jar:1.5.4.RELEASE:compile
[INFO] |  |  +- org.springframework.boot:spring-boot:jar:1.5.4.RELEASE:compile
[INFO] |  |  |  +- (org.springframework:spring-core:jar:4.3.9.RELEASE:compile - omitted for duplicate)
[INFO] |  |  |  \- (org.springframework:spring-context:jar:4.3.9.RELEASE:compile - omitted for duplicate)
[INFO] |  |  \- org.springframework:spring-core:jar:4.3.9.RELEASE:compile
[INFO] |  +- org.springframework:spring-web:jar:4.3.9.RELEASE:compile
[INFO] |  |  +- org.springframework:spring-aop:jar:4.3.9.RELEASE:compile
[INFO] |  |  |  +- (org.springframework:spring-beans:jar:4.3.9.RELEASE:compile - omitted for duplicate)
[INFO] |  |  |  \- (org.springframework:spring-core:jar:4.3.9.RELEASE:compile - omitted for duplicate)
[INFO] |  |  +- org.springframework:spring-beans:jar:4.3.9.RELEASE:compile
[INFO] |  |  |  \- (org.springframework:spring-core:jar:4.3.9.RELEASE:compile - omitted for duplicate)
[INFO] |  |  +- org.springframework:spring-context:jar:4.3.9.RELEASE:compile
[INFO] |  |  |  +- (org.springframework:spring-aop:jar:4.3.9.RELEASE:compile - omitted for duplicate)
[INFO] |  |  |  +- (org.springframework:spring-beans:jar:4.3.9.RELEASE:compile - omitted for duplicate)
[INFO] |  |  |  +- (org.springframework:spring-core:jar:4.3.9.RELEASE:compile - omitted for duplicate)
[INFO] |  |  |  \- (org.springframework:spring-expression:jar:4.3.9.RELEASE:compile - omitted for duplicate)
[INFO] |  |  \- (org.springframework:spring-core:jar:4.3.9.RELEASE:compile - omitted for duplicate)
[INFO] |  \- org.glassfish.jersey.ext:jersey-spring3:jar:2.25.1:compile
[INFO] |     +- org.glassfish.hk2:spring-bridge:jar:2.5.0-b32:compile
[INFO] |     |  \- (org.springframework:spring-context:jar:4.3.9.RELEASE:compile - version managed from 3.2.3.RELEASE; omitted for duplicate)
[INFO] |     +- (org.springframework:spring-beans:jar:4.3.9.RELEASE:compile - version managed from 3.2.17.RELEASE; omitted for duplicate)
[INFO] |     +- (org.springframework:spring-core:jar:4.3.9.RELEASE:compile - version managed from 3.2.17.RELEASE; omitted for duplicate)
[INFO] |     +- (org.springframework:spring-web:jar:4.3.9.RELEASE:compile - version managed from 3.2.17.RELEASE; omitted for duplicate)
[INFO] |     \- (org.springframework:spring-aop:jar:4.3.9.RELEASE:compile - version managed from 3.2.17.RELEASE; omitted for duplicate)
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:1.5.4.RELEASE:compile
[INFO] |  +- (org.springframework:spring-web:jar:4.3.9.RELEASE:compile - version managed from 3.2.17.RELEASE; omitted for duplicate)
[INFO] |  \- org.springframework:spring-webmvc:jar:4.3.9.RELEASE:compile
[INFO] |     +- (org.springframework:spring-aop:jar:4.3.9.RELEASE:compile - version managed from 3.2.17.RELEASE; omitted for duplicate)
[INFO] |     +- (org.springframework:spring-beans:jar:4.3.9.RELEASE:compile - version managed from 3.2.17.RELEASE; omitted for duplicate)
[INFO] |     +- (org.springframework:spring-context:jar:4.3.9.RELEASE:compile - version managed from 3.2.3.RELEASE; omitted for duplicate)
[INFO] |     +- (org.springframework:spring-core:jar:4.3.9.RELEASE:compile - version managed from 3.2.17.RELEASE; omitted for duplicate)
[INFO] |     +- org.springframework:spring-expression:jar:4.3.9.RELEASE:compile
[INFO] |     |  \- (org.springframework:spring-core:jar:4.3.9.RELEASE:compile - version managed from 3.2.17.RELEASE; omitted for duplicate)
[INFO] |     \- (org.springframework:spring-web:jar:4.3.9.RELEASE:compile - version managed from 3.2.17.RELEASE; omitted for duplicate)
[INFO] \- org.springframework.boot:spring-boot-starter-test:jar:1.5.4.RELEASE:test
[INFO]    +- (org.springframework:spring-core:jar:4.3.9.RELEASE:compile - version managed from 3.2.17.RELEASE; scope updated from test; omitted for duplicate)
[INFO]    \- org.springframework:spring-test:jar:4.3.9.RELEASE:test
[INFO]       \- (org.springframework:spring-core:jar:4.3.9.RELEASE:test - version managed from 3.2.17.RELEASE; omitted for duplicate)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.568 s
[INFO] Finished at: 2018-01-21T14:10:29+05:30
[INFO] Final Memory: 32M/622M
[INFO] ------------------------------------------------------------------------

Process finished with exit code 0

That must means there is an incompatible version in your pom.xml , in your case an incompatible logger . 这必须意味着pom.xml存在不兼容的版本 ,对于您而言,则是不兼容的记录器

Try: 尝试:

mvn dependency:tree -Dverbose -Dincludes=org.springframework

To see if you get multiple loggers. 查看是否有多个记录器。
If so, you might need to exclude it, as in this answer . 如果是这样,您可能需要排除它, 如本答案所示

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM