从Jboss EAP 7.0到EAP 7.1的Spring Boot应用迁移无法正常工作

问题描述

我无法将Spring Boot应用程序从JBoss EAP 7.0迁移到JBoss EAP 7.1。 我希望使用相同的WAR(使用MAVEN构建创建)不会有任何问题,但是事实并非如此。 最初,我在使用某些库时遇到麻烦,并承认我不得不在jboss-deployment-structure.xml文件中排除其中的几个库,结果是:

<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
    <deployment>
        <dependencies>
            <module name="sun.jdk">
            </module>
        </dependencies>
        
        <exclusions>
            <module name="com.fasterxml.jackson.core.jackson-annotations" />
            <module name="com.fasterxml.jackson.core.jackson-core" />
            <module name="com.fasterxml.jackson.core.jackson-databind" />
            <module name="org.joda.time" />
            <module name="org.jboss.resteasy.resteasy-jackson2-provider" />
            <module name="org.jboss.resteasy.resteasy-jackson-provider" />
            <module name="com.fasterxml.jackson.datatype.jackson-datatype-jdk8" />
            <module name="com.fasterxml.jackson.datatype.jackson-datatype-jsr310" />
        </exclusions>
        
    </deployment>
</jboss-deployment-structure> 

排除文件的最后两个模型使我成功构建和部署了WAR文件,但是似乎Spring Boot Application无法正确启动。 除了Jboss-deployment-structure.xml文件中的排除项之外,在JBoss EAP 7.0上运行的应用程序与我正在尝试在JBoss EAP 7.1上部署并启动的应用程序之间没有其他区别。 有人有同样的问题吗?或者知道我要完成迁移需要做什么吗? 这是应用程序的主要类。

LISTENERAPPLICATION.JAVA

package it.mef.listener;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.boot.Banner;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.EnableMBeanExport;
import org.springframework.jmx.support.RegistrationPolicy;

import it.mef.listener.websocket_client.WebsocketClient;

@SpringBootApplication
@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class})
@EnableMBeanExport(registration=RegistrationPolicy.IGNORE_EXISTING)
@ComponentScan({
    "it.mef.listener","it.mef.common.ms.shared.utilities","it.mef.common.ms.cache","it.mef.common.http","it.mef.common.security","it.mef.common.validation.filter"
    })
public class ListenerApplication extends SpringBootServletInitializer {

    /** The Constant LOG. */
    private static final Logger LOG = LogManager.getLogger(ListenerApplication.class);

    
    /* (non-Javadoc)
     * @see org.springframework.boot.web.support.SpringBootServletInitializer#configure(org.springframework.boot.builder.SpringApplicationBuilder)
     */
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        System.out.println("APPLICATION STARTED");
        LOG.info("APPLICATION STARTED");
        return configureApplication(builder);
    }

    /**
     * The main method.
     *
     * @param args the arguments
     */
    public static void main(String[] args) {
        System.out.println("APPLICATION STARTED");
        LOG.info("APPLICATION STARTED");
        configureApplication(new SpringApplicationBuilder()).run(args);
    }

    /**
     * Configure application.
     *
     * @param builder the builder
     * @return the spring application builder
     */
    private static SpringApplicationBuilder configureApplication(SpringApplicationBuilder builder) {
        System.out.println("APPLICATION CONFIGURATION");
        LOG.info("APPLICATION CONFIGURATION");
        return builder.sources(ListenerApplication.class).bannerMode(Banner.Mode.OFF);
    }
}

在7.1服务器日志中,应用程序在启动过程中应写入的消息丢失了,而在7.0日志中已正确提示它们(由于消息的最大长度,我未在此处添加这些日志)。在这两种情况下,应用程序都已正确部署,并且服务器启动时没有错误。 这使我认为,关于Spring Boot Application的启动一定存在一些问题。 经过进一步调查,我注意到7.0中的相同API调用给我提供200的状态代码,而7.1中的同一个API给我提供了状态代码405,好像它不存在一样。 有人知道我在做什么错吗? 感谢您的帮助。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...