无法成功启动上下文o.e.j.m.p.JettyWebAppContext

问题描述 投票:1回答:1

我正在尝试使用jetty-maven-plugin并看到一个问题:[警告]上下文启动失败o.e.j.m.p.JettyWebAppContext@21ba83e3java.util.ServiceConfigurationError:org.apache.juli.logging.Log:提供者org.eclipse.jetty.apache.jsp.JuliLog不是子类型

我看到了几处类似错误的帖子,并且看到tomcat-juli是有问题的jar。但是我在项目依赖项中看不到它。我也没有使用AWT。

        <dependency>
            <groupId>com.intuit.ceg.platform</groupId>
            <artifactId>mint-platform-core</artifactId>
            <version>0.0.1-SNAPSHOT</version>
            <exclusions>
                <exclusion>
                    <groupId>ch.qos.logback</groupId>
                    <artifactId>logback-classic</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
         <dependency>
            <groupId>com.intuit.ceg.platform</groupId>
            <artifactId>notification-adapters</artifactId>
            <version>1.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>com.intuit.oinp.platform</groupId>
            <artifactId>oinp-metrics-app</artifactId>
            <version>1.0-SNAPSHOT</version>
        </dependency>
         <dependency>
            <groupId>com.intuit.platform.integration.messaging.crypto</groupId>
            <artifactId>messaging-crypto-client</artifactId>
            <version>release-1.13</version>
            <exclusions>
                <exclusion>
                    <artifactId>idps-sdk</artifactId>
                    <groupId>com.intuit.idps</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
        <exclusions>
            <exclusion>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-tomcat</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-jetty</artifactId>
    </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
         <!--Rest- Assured dependencies -->
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-all</artifactId>
            <version>1.3</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.jayway.restassured</groupId>
            <artifactId>rest-assured</artifactId>
            <version>2.9.0</version>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>${mockito.version}</version>
            <scope>test</scope>
        </dependency>
        <!-- Hibernate -->
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-entitymanager</artifactId>
            <version>4.3.9.Final</version>
            <exclusions>
                <exclusion>
                    <groupId>org.jboss.logging</groupId>
                    <artifactId>jboss-logging</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.jboss.logging</groupId>
                    <artifactId>jboss-logging-annotations</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.hibernate/hibernate-core -->
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>4.3.11.Final</version>
        </dependency>

        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-ehcache</artifactId>
            <version>4.3.9.Final</version>
        </dependency>

         <!--Hikari connection pool changes -->
        <dependency>
           <groupId>com.zaxxer</groupId>
           <artifactId>HikariCP</artifactId>
            <version>${hikari.cp.version}</version>
         </dependency>
        <!--  <dependency>
             <groupId>org.hibernate</groupId>
             <artifactId>hibernate-validator</artifactId>
             <version>${hibernate-validator.version}</version>
         </dependency> -->
         <dependency>
            <groupId>io.swagger</groupId>
            <artifactId>swagger-jersey2-jaxrs</artifactId>
            <version>1.5.8</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-jersey -->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-jersey</artifactId>
    <version>1.5.4.RELEASE</version>
</dependency>
        <!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-api -->
<dependency>
    <groupId>org.apache.logging.log4j</groupId>
    <artifactId>log4j-api</artifactId>
    <version>2.10.0</version>
</dependency>

    </dependencies>

     <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.5.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>1.5.4.RELEASE</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
                <version>2.7</version>
                <configuration>
                    <instrumentation>
                        <excludes>
                            <exclude>**/models/**</exclude>
                            <exclude>**/springConfig/**</exclude>
                            <exclude>**/common/**</exclude>
                            <exclude>**/resources/**</exclude>
                            <exclude>**/kafka/**</exclude>
                            <exclude>**/kafka/producers/**</exclude>
                            <exclude>**/scheduler/controller/**</exclude>
                            <exclude>**/MetricsReporterApplication.class</exclude>
                            <exclude>**/SQSAsyncClientFactoryImpl.class</exclude>
                            <exclude>**/SQSClientImpl.class</exclude>
                            <exclude>**/SESWebHookEventConsumer.class</exclude>
                            <exclude>**/SendGridWebHookService.class</exclude>
                        </excludes>
                    </instrumentation>
                    <check>
                        <branchRate>60</branchRate>
                        <lineRate>95</lineRate>
                        <totalBranchRate>80</totalBranchRate>
                        <totalLineRate>97</totalLineRate>
                        <packageLineRate>97</packageLineRate>
                        <packageBranchRate>80</packageBranchRate>
                        <haltOnFailure>true</haltOnFailure>
                        <regexes>
                            <regex>
                                <pattern>com.intuit.ceg.platform.notifications.services.EventConsumerHelper.class</pattern>
                                <branchRate>97</branchRate>
                                <lineRate>97</lineRate>
                            </regex>
                        </regexes>
                    </check>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>clean</goal>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>pl.project13.maven</groupId>
                <artifactId>git-commit-id-plugin</artifactId>
                <version>${maven.git.commit.id.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>revision</goal>
                        </goals>
                    </execution>
                </executions>

                <configuration>

                    <dotGitDirectory>${project.basedir}/.git</dotGitDirectory>
                    <skipPoms>true</skipPoms>
                </configuration>

            </plugin>
            <plugin>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
                 <version>9.4.18.v20190429</version>
                <configuration>
                    <httpConnector>
                        <port>8080</port>
                    </httpConnector>
                    <scanIntervalSeconds>240</scanIntervalSeconds>
                </configuration>

            </plugin>

        </plugins>
    </build> ```
maven spring-boot embedded-jetty
1个回答
0
投票
Just update your jetty version. it should work. i too was facing this issue. i had below configuration

   <groupId>org.eclipse.jetty</groupId>
   <artifactId>jetty-maven-plugin</artifactId>
   <version>9.4.6.v20170531</version> 

"which was working fine till when my project was a simple hello world kind of.. but started getting issue when i updated my pom.xml with other stuffs. So then i update jetty configuration as below"


     <groupId>org.eclipse.jetty</groupId>
     <artifactId>jetty-maven-plugin</artifactId>
     <version>9.4.12.v20180830</version>
© www.soinside.com 2019 - 2024. All rights reserved.