从Spring Boot 1.5迁移到Spring Boot 2并启动应用程序-java.lang.ArrayStoreException

时间:2018-10-22 09:52:17

标签: java spring spring-boot tomcat swagger

启动在SpringBoot 1.5上运行的应用程序时出现以下错误。 我不能发布更多信息(例如pom child),原因是30000个字符限制。

有关更多信息,请参见:github.com/springfox/springfox/issues/2751

2018-10-22 11:33:17.623  WARN [moto,,,] 12260 --- [on(3)-127.0.0.1] aWebConfiguration$JpaWebMvcConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2018-10-22 11:33:17.801  WARN [moto,,,] 12260 --- [on(3)-127.0.0.1] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'documentationPluginsBootstrapper' defined in URL [jar:file:somePackages/someJar!/springfox/documentation/spring/web/plugins/DocumentationPluginsBootstrapper.class]: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'webMvcRequestHandlerProvider' defined in URL [jar:file:somePackages/someJar!/springfox/documentation/spring/web/plugins/WebMvcRequestHandlerProvider.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Invocation of init method failed; nested exception is java.lang.ArrayStoreException
2018-10-22 11:33:19.032  WARN [moto,,,] 12260 --- [on(3)-127.0.0.1] z.r.AsyncReporter$BoundedAsyncReporter   : Timed out waiting for in-flight spans to send
22-Oct-2018 11:33:19.031 WARNING [RMI TCP Connection(3)-127.0.0.1] zipkin2.reporter.AsyncReporter$BoundedAsyncReporter.close Timed out waiting for in-flight spans to send
2018-10-22 11:33:19.044  WARN [moto,,,] 12260 --- [ender@51c81cc8}] s.c.a.AnnotationConfigApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'ribbonClientConfiguration': Unsatisfied dependency expressed through field 'propertiesFactory'; nested exception is org.springframework.beans.factory.BeanCreationNotAllowedException: Error creating bean with name 'propertiesFactory': Singleton bean creation not allowed while singletons of this factory are in destruction (Do not request a bean from a BeanFactory in a destroy method implementation!)
2018-10-22 11:33:19.075 ERROR [moto,,,] 12260 --- [on(3)-127.0.0.1] o.s.boot.SpringApplication               : Application run failed

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'documentationPluginsBootstrapper' defined in URL [jar:file:somePackages/someJar!/springfox/documentation/spring/web/plugins/DocumentationPluginsBootstrapper.class]: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'webMvcRequestHandlerProvider' defined in URL [jar:file:somePackages/someJar!/springfox/documentation/spring/web/plugins/WebMvcRequestHandlerProvider.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Invocation of init method failed; nested exception is java.lang.ArrayStoreException
(...)
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'webMvcRequestHandlerProvider' defined in URL [jar:file:somePackages/someJar!/springfox/documentation/spring/web/plugins/WebMvcRequestHandlerProvider.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Invocation of init method failed; nested exception is java.lang.ArrayStoreException
(...)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Invocation of init method failed; nested exception is java.lang.ArrayStoreException
22-Oct-2018 11:33:19.093 SEVERE [RMI TCP Connection(3)-127.0.0.1] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start: 
(...)
 org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/moto]]
(...)
Caused by: java.lang.ArrayStoreException: null
(...)
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'documentationPluginsBootstrapper' defined in URL [jar:file:somePackages/someJar!/springfox/documentation/spring/web/plugins/DocumentationPluginsBootstrapper.class]: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'webMvcRequestHandlerProvider' defined in URL [jar:file:somePackages/someJar!/springfox/documentation/spring/web/plugins/WebMvcRequestHandlerProvider.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Invocation of init method failed; nested exception is java.lang.ArrayStoreException
(...)
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'webMvcRequestHandlerProvider' defined in URL [jar:file:somePackages/someJar!/springfox/documentation/spring/web/plugins/WebMvcRequestHandlerProvider.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Invocation of init method failed; nested exception is java.lang.ArrayStoreException
(...)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Invocation of init method failed; nested exception is java.lang.ArrayStoreException
(...)
Caused by: java.lang.ArrayStoreException

22-Oct-2018 11:33:19.108 SEVERE [RMI TCP Connection(3)-127.0.0.1] org.apache.tomcat.util.modeler.BaseModelMBean.invoke Exception invoking method manageApp
 java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/moto]]
(...)
[2018-10-22 11:33:19,121] Artifact moto-web:war exploded: Error during artifact deployment. See server log for details.
(...)

22-Oct-2018 11:33:19.109 SEVERE [RMI TCP Connection(3)-127.0.0.1] org.apache.tomcat.util.modeler.BaseModelMBean.invoke Exception invoking method createStandardContext
 javax.management.RuntimeOperationsException: Exception invoking method manageApp
(...)
Caused by: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/moto]]
(...)

我正在Tomcat 9.0.12上启动该应用程序(不是以Jar形式启动SpringBoot-业务需求原因)。 我在代码中没有真正看到Singleton bean creation not allowed while singletons of this factory are in destruction-可能是错误原因。 我不知道如何处理上述错误。

Pom(moto.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">
    <parent>
        someParent
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>moto</artifactId>
    <packaging>pom</packaging>

    <modules>
        someModules
    </modules>

    <properties>
        <hibernate-validator.version>5.2.2.Final</hibernate-validator.version>
        <lombok.version>1.16.10</lombok.version>
        <spock-core.version>1.0-groovy-2.4</spock-core.version>
        <cglib-nodep.version>3.2.4</cglib-nodep.version>
        <objenesis.version>2.1</objenesis.version>
        <maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
        <gmavenplus-plugin.version>1.5</gmavenplus-plugin.version>
        <logstash.logback.version>4.5.1</logstash.logback.version>

        <integration.test.mask>**/*Spec</integration.test.mask>
        <integration.test.mask2>**/*Test*</integration.test.mask2>
    </properties>

    <profiles>
        <profile>
            <id>integration-tests</id>
            <properties>
                <integration.test.mask>**/*SpecIT</integration.test.mask>
                <integration.test.mask2>**/*TestIT</integration.test.mask2>
            </properties>
        </profile>
    </profiles>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven-surefire-plugin.version}</version>
                <dependencies>
                    <!-- implicitly force only junit runner in case of testng dependency found -->
                    <dependency>
                        <groupId>org.apache.maven.surefire</groupId>
                        <artifactId>surefire-junit47</artifactId>
                        <version>${maven-surefire-plugin.version}</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <includes>
                        <include>${integration.test.mask}</include>
                        <include>${integration.test.mask2}</include>
                    </includes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.gmavenplus</groupId>
                <artifactId>gmavenplus-plugin</artifactId>
                <version>${gmavenplus-plugin.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>compile</goal>
                            <goal>testCompile</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>1.10</version>
                <executions>
                    <execution>
                        <phase>generate-test-sources</phase>
                        <goals>
                            <goal>add-test-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>src/test/groovy</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <dependencyManagement>
        <dependencies>

            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-properties-migrator</artifactId>
            </dependency>

            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>2.0.3.RELEASE</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-starter-parent</artifactId>
                <version>Finchley.RELEASE</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>somePackages</groupId>
                <artifactId>backoffice-common-api</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>somePackages</groupId>
                <artifactId>fileRepository-api-client</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>somePackages</groupId>
                <artifactId>policyManagement-api-client</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>somePackages</groupId>
                <artifactId>motoPolicy-bo</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>somePackages</groupId>
                <artifactId>motoPolicy-api</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>somePackages</groupId>
                <artifactId>motoPolicy-api-client</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>somePackages</groupId>
                <artifactId>vehicleClassification-api-client</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>somePackages</groupId>
                <artifactId>ufg-integration-api</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>somePackages</groupId>
                <artifactId>ufg-integration-api-impl</artifactId>
                <version>${project.version}</version>
                <scope>runtime</scope> <!-- provide impl only on runtime -->
            </dependency>
            <dependency>
                <groupId>somePackages</groupId>
                <artifactId>policy-core-integration-api</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>somePackages</groupId>
                <artifactId>policy-core-integration-api-impl</artifactId>
                <version>${project.version}</version>
                <scope>runtime</scope> <!-- provide impl only on runtime -->
            </dependency>
            <dependency>
                <groupId>somePackages</groupId>
                <artifactId>eurotax-integration-api</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>somePackages</groupId>
                <artifactId>eurotax-integration-api-impl</artifactId>
                <version>${project.version}</version>
                <scope>runtime</scope> <!-- provide impl only on runtime -->
            </dependency>
            <dependency>
                <groupId>org.spockframework</groupId>
                <artifactId>spock-core</artifactId>
                <version>${spock-core.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.spockframework</groupId>
                <artifactId>spock-spring</artifactId>
                <version>${spock-core.version}</version>
            </dependency>
            <dependency>
                <groupId>cglib</groupId>
                <artifactId>cglib-nodep</artifactId>
                <version>${cglib-nodep.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.objenesis</groupId>
                <artifactId>objenesis</artifactId>
                <version>${objenesis.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>io.springfox</groupId>
                <artifactId>springfox-swagger2</artifactId>
                <version>${swagger.version}</version>
            </dependency>
            <dependency>
                <groupId>io.springfox</groupId>
                <artifactId>springfox-swagger-ui</artifactId>
                <version>${swagger.version}</version>
            </dependency>
            <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-validator</artifactId>
                <version>${hibernate-validator.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
                <version>${guava.version}</version>
            </dependency>
            <dependency>
                <groupId>net.logstash.logback</groupId>
                <artifactId>logstash-logback-encoder</artifactId>
                <version>4.11</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.spockframework</groupId>
            <artifactId>spock-core</artifactId>
        </dependency>
        <dependency>
            <groupId>cglib</groupId>
            <artifactId>cglib-nodep</artifactId>
        </dependency>
        <dependency>
            <groupId>org.objenesis</groupId>
            <artifactId>objenesis</artifactId>
        </dependency>
    </dependencies>

</project>

任何提示都会很棒。谢谢

0 个答案:

没有答案