Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error starting Spring Boot 2.2.1 in WildFly 15 - Jackson StreamFactory Verify Error

I am new to Spring Boot. I am trying to deploy a Spring Boot 2.2.1 project on WildFly 15 as a war. I can build and run a unit test in Maven, but when I deploy to WildFly, I get the following error:

WFLYCTL0186: Services which failed to start: service jboss.deployment.unit."my.war".undertow-deployment: 
java.lang.RuntimeException:org.springframework.beans.factory.BeanCreationException: 
Error creating bean with name 'integrationArgumentResolverMessageConverter': Instantiation of bean failed; 
nested exception is org.springframework.beans.BeanInstantiationException: 
Failed to instantiate [org.springframework.integration.support.converter.ConfigurableCompositeMessageConverter]: 
Constructor threw exception; nested exception is java.lang.VerifyError: Bad return type

Exception Details:
  Location:
    com/fasterxml/jackson/databind/cfg/MapperBuilder.streamFactory()Lcom/fasterxml/jackson/core/TokenStreamFactory; @7: areturn
  Reason:
    Type 'com/fasterxml/jackson/core/JsonFactory' (current frame, stack[0]) is not assignable to 'com/fasterxml/jackson/core/TokenStreamFactory' (from method signature)
  Current Frame:
    bci: @7
    flags: { }
    locals: { 'com/fasterxml/jackson/databind/cfg/MapperBuilder' }
    stack: { 'com/fasterxml/jackson/core/JsonFactory' }
  Bytecode:
    0x0000000: 2ab4 0002 b600 08b0

My pom.xml file looks like:

<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.2.1.RELEASE</version>
        <relativePath/> 
    </parent>
    <groupId>com.somecompany</groupId>
    <artifactId>my</artifactId>
    <version>0.1-SNAPSHOT</version>
    <packaging>war</packaging>
    <name>My</name>

    <properties>
        <java.version>1.8</java.version>
    </properties>

    <dependencies>
        <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>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-activemq</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.integration</groupId>
            <artifactId>spring-integration-jms</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>com.oracle.ojdbc</groupId>
            <artifactId>ojdbc8</artifactId>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
        </dependency>       
    </dependencies>

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

</project>

My project is also using Spring Integration and I am using Jackson in my code to parse JSON that arrives on a ActiveMQ queue.

Any help would be, well... helpful. Thanks

like image 914
Hignesh Hirani Avatar asked Nov 20 '19 21:11

Hignesh Hirani


1 Answers

Spring Boot 2.2.1 was using a newer Jackson than WildFly 15. And the newer Jackson was being loaded and causing WildFly issues in starting up.

Downgrading Spring Boot to 2.1.10 and upgrading WildFly to 18 fixed the issue. Perhaps I could have done some creative excluding to solve the issue, but I had the freedom to select other versions and selected 2 that played well together.

like image 138
Hignesh Hirani Avatar answered Sep 24 '22 15:09

Hignesh Hirani