将 spring 引导部署到 weblogic 10.3 时出错 - AppMerge 流程的进展异常

Error deploying spring boot to weblogic 10.3 - Exception in AppMerge flows' progression

我创建了一个 spring boot 2.0.0 - rest 应用程序.. 它 运行 在 STS 中的嵌入式 tomcat 上很好(使用 Run as Spring boot application)但是当我将其组装成 war 并尝试将其部署在 weblogic 10.3.6(java EE 5 兼容服务器)上,它未能在管理控制台上显示 The configuration for app is still being loaded from your last request, please wait a moment and retry. ...查看日志,我发现:

####<Apr 18, 2018 2:45:58 PM AST> <Warning> <netuix> <EJASRV7078> <AdminServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <weblogic> <> <ab32afc0f77c2566:-190f3657:162d88b7cc4:-8000-000000000000001b> <1524051958770> <BEA-423420> <Redirect is executed in begin or refresh action. Redirect url is /console/console.portal?_nfpb=true&_pageLabel=WebAppApplicationOverviewPage&WebAppApplicationOverviewPortlethandle=com.bea.console.handles.AppDeploymentHandle%28%22com.bea%3AName%3Dapp%2CType%3DAppDeployment%22%29.> 
####<Apr 18, 2018 2:46:11 PM AST> <Error> <Console> <EJASRV7078> <AdminServer> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <weblogic> <> <ab32afc0f77c2566:-190f3657:162d88b7cc4:-8000-000000000000001c> <1524051971974> <BEA-240003> <Console encountered the following error java.io.IOException: Exception in AppMerge flows' progression
    at weblogic.deploy.api.internal.utils.AppMerger.getMergedApp(AppMerger.java:70)
    at weblogic.deploy.api.model.internal.WebLogicDeployableObjectFactoryImpl.createDeployableObject(WebLogicDeployableObjectFactoryImpl.java:181)
    at weblogic.deploy.api.model.internal.WebLogicDeployableObjectFactoryImpl.createDeployableObject(WebLogicDeployableObjectFactoryImpl.java:163)
    at weblogic.deploy.api.tools.SessionHelper.initialize(SessionHelper.java:727)
    at weblogic.deploy.api.tools.SessionHelper.initializeConfiguration(SessionHelper.java:556)
    at weblogic.deploy.api.tools.SessionHelper.initializeConfiguration(SessionHelper.java:544)
    at weblogic.deploy.api.tools.SessionHelper.initializeConfiguration(SessionHelper.java:627)
    at com.bea.console.utils.DeploymentConfigurationHelper.execute(DeploymentConfigurationHelper.java:858)
    at com.bea.console.utils.DeploymentUtils.runDeploymentAction(DeploymentUtils.java:5023)
    at com.bea.console.utils.DeploymentConfigurationHelper.initDeploymentConfiguration(DeploymentConfigurationHelper.java:847)
    at com.bea.console.utils.DeploymentConfigurationHelper.completeInitialization(DeploymentConfigurationHelper.java:443)
    at com.bea.console.utils.DeploymentConfigurationManager.getDeploymentConfiguration(DeploymentConfigurationManager.java:150)
    at com.bea.console.utils.DeploymentConfigurationManager.getDeploymentConfiguration(DeploymentConfigurationManager.java:104)
    at com.bea.console.utils.DeploymentConfigurationManager.getDeploymentConfiguration(DeploymentConfigurationManager.java:65)
    at com.bea.console.utils.PersistenceUtils.getPersistenceUnitNames(PersistenceUtils.java:76)
    at com.bea.console.utils.PersistenceUtils.hasPersistenceUnits(PersistenceUtils.java:52)
    at com.bea.console.utils.AppDeploymentBackingFile.preRender(AppDeploymentBackingFile.java:110)
    at com.bea.netuix.servlets.controls.Backable$Impl.preRender(Backable.java:191)
    at com.bea.netuix.servlets.controls.AdministeredBackableControl.preRender(AdministeredBackableControl.java:104)
    at com.bea.netuix.servlets.controls.window.Window.preRender(Window.java:432)
    at com.bea.netuix.servlets.controls.page.Page.preRender(Page.java:240)
    at com.bea.netuix.nf.ControlLifecycle.visit(ControlLifecycle.java:428)
    at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:727)
    at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
    at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
    at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
    at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
    at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
    at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
    at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
    at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
    at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
    at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
    at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
    at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
    at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
    at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
    at com.bea.netuix.nf.ControlTreeWalker.walk(ControlTreeWalker.java:146)
    at com.bea.netuix.nf.Lifecycle.processLifecycles(Lifecycle.java:395)
    at com.bea.netuix.nf.Lifecycle.processLifecycles(Lifecycle.java:361)
    at com.bea.netuix.nf.Lifecycle.runOutbound(Lifecycle.java:208)
    at com.bea.netuix.nf.Lifecycle.run(Lifecycle.java:162)
    at com.bea.netuix.servlets.manager.UIServlet.runLifecycle(UIServlet.java:388)
    at com.bea.netuix.servlets.manager.UIServlet.doPost(UIServlet.java:258)
    at com.bea.netuix.servlets.manager.UIServlet.doGet(UIServlet.java:211)
    at com.bea.netuix.servlets.manager.UIServlet.service(UIServlet.java:196)
    at com.bea.netuix.servlets.manager.SingleFileServlet.service(SingleFileServlet.java:251)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at com.bea.console.utils.MBeanUtilsInitSingleFileServlet.service(MBeanUtilsInitSingleFileServlet.java:64)
    at weblogic.servlet.AsyncInitServlet.service(AsyncInitServlet.java:130)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:301)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3730)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3696)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2273)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1490)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
Caused by: weblogic.utils.compiler.ToolFailureException: Exception in AppMerge flows' progression
    at weblogic.application.compiler.AppMerge.merge(AppMerge.java:172)
    at weblogic.deploy.api.internal.utils.AppMerger.merge(AppMerger.java:88)
    at weblogic.deploy.api.internal.utils.AppMerger.getMergedApp(AppMerger.java:63)
    ... 65 more
Caused by: weblogic.utils.compiler.ToolFailureException: String index out of range: 36611
    at weblogic.application.compiler.FlowDriver.handleStateChangeException(FlowDriver.java:53)
    at weblogic.application.compiler.FlowDriver.nextState(FlowDriver.java:37)
    at weblogic.application.compiler.FlowDriver$CompilerFlowDriver.compile(FlowDriver.java:96)
    at weblogic.application.compiler.AppMerge.runBody(AppMerge.java:157)
    at weblogic.utils.compiler.Tool.run(Tool.java:158)
    at weblogic.utils.compiler.Tool.run(Tool.java:115)
    at weblogic.application.compiler.AppMerge.merge(AppMerge.java:169)
    ... 67 more
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 36611
    at java.lang.String.checkBounds(String.java:401)
    at java.lang.String.<init>(String.java:442)
    at serp.bytecode.lowlevel.ConstantPoolTable.readString(ConstantPoolTable.java:112)
    at serp.bytecode.lowlevel.ConstantPoolTable.readString(ConstantPoolTable.java:174)
    at org.apache.openjpa.lib.meta.ClassAnnotationMetaDataFilter.matches(ClassAnnotationMetaDataFilter.java:90)
    at weblogic.application.utils.ClassFinderMetaDataEnumaration.hasMoreElements(ClassFinderMetaDataEnumaration.java:59)
    at weblogic.servlet.internal.WebAnnotationProcessorImpl.getAnnotatedClasses(WebAnnotationProcessorImpl.java:139)
    at weblogic.application.compiler.WARModule$WarModuleWebAppHelper.getAnnotatedClasses(WARModule.java:619)
    at weblogic.servlet.internal.WebAnnotationProcessorImpl.processAnnotations(WebAnnotationProcessorImpl.java:84)
    at weblogic.application.compiler.WARModule.processAnnotations(WARModule.java:433)
    at weblogic.application.compiler.EARModule.processAnnotations(EARModule.java:227)
    at weblogic.application.compiler.WARModule.merge(WARModule.java:483)
    at weblogic.application.compiler.flow.SingleModuleMergeFlow.proecessModule(SingleModuleMergeFlow.java:16)
    at weblogic.application.compiler.flow.SingleModuleFlow.compile(SingleModuleFlow.java:36)
    at weblogic.application.compiler.FlowDriver$FlowStateChange.next(FlowDriver.java:69)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
    at weblogic.application.compiler.FlowDriver.nextState(FlowDriver.java:36)
    at weblogic.application.compiler.FlowDriver$CompilerFlowDriver.compile(FlowDriver.java:96)
    at weblogic.application.compiler.ReadOnlyWarMerger.merge(ReadOnlyWarMerger.java:27)
    at weblogic.application.compiler.flow.AppMergerFlow.mergeInput(AppMergerFlow.java:88)
    at weblogic.application.compiler.flow.AppMergerFlow.compile(AppMergerFlow.java:41)
    at weblogic.application.compiler.FlowDriver$FlowStateChange.next(FlowDriver.java:69)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
    at weblogic.application.compiler.FlowDriver.nextState(FlowDriver.java:36)
    ... 72 more

我添加了 web.xml 和 weblogic.xml - 因为 java EE 5 的性质:

web.xml :

<?xml version="1.0"?>
   <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee    http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
    <display-name>Spring Boot Liberty</display-name>

    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
    </welcome-file-list>
</web-app>

weblogic.xml:

<?xml version="1.0" encoding="UTF-8"?>
<wls:weblogic-web-app xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-web-app" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee         
                        http://xmlns.oracle.com/weblogic/weblogic-web-app        
                        http://xmlns.oracle.com/weblogic/weblogic-web-app/1.3/weblogic-web-app.xsd">
    <wls:weblogic-version>10.3.x</wls:weblogic-version>
    <wls:context-root>app</wls:context-root>
    <wls:container-descriptor>
<!--         <wls:prefer-web-inf-classes>true</wls:prefer-web-inf-classes> -->
        <wls:prefer-application-packages>
            <wls:package-name>org.springframework.*</wls:package-name>
        </wls:prefer-application-packages>
    </wls:container-descriptor>
</wls:weblogic-web-app>

build.gradle:

buildscript {
    ext {
        springBootVersion = '2.0.0.RELEASE'
    }
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
    }
}

apply plugin: 'java'
apply plugin: 'eclipse-wtp'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'war'

group = 'com.mypackage'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8

repositories {
    mavenCentral()
    mavenLocal()
}

configurations {
    providedRuntime
}

dependencies {
    compile('org.springframework.boot:spring-boot-starter-web')
    compile('org.springframework.ws:spring-ws-core')
    compile('org.mybatis.spring.boot:mybatis-spring-boot-starter:1.3.2')
    compile('org.projectlombok:lombok:1.16.20')
    compile('com.oracle:ojdbc8:12.0.2')
    compileOnly('org.springframework.boot:spring-boot-devtools:2.0.0.RELEASE')
    compileOnly('javax.servlet:javax.servlet-api:3.1.0')

    providedRuntime('org.springframework.boot:spring-boot-starter-tomcat')
    testCompile('org.springframework.boot:spring-boot-starter-test')
    testCompile('org.springframework.security:spring-security-test')
}

    /*compile('org.springframework.boot:spring-boot-starter-data-jpa')
    compile('org.springframework.boot:spring-boot-starter-data-rest')
    compile('org.springframework.boot:spring-boot-starter-security')
    compile('org.springframework.session:spring-session-core')
    */

    bootJar {
    baseName = 'gs-consuming-web-service'
    version =  '0.1.0'

  //  from genJaxb.classesDir
}

SpringBootServletInitializer :

@SpringBootApplication
@MapperScan(basePackages = { "com.mypackage" })
public class MainClass extends SpringBootServletInitializer  implements WebApplicationInitializer{

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(MainClass.class);
    }

    public static void main(String[] args) {
        SpringApplication.run(MainClass.class, args);
    }
}

编辑 1: 我发现如果没有定义 servlet,web.xml 在 servlet 规范 2.5 中不是强制性的,所以我将它与 weblogic.xml 一起删除了 .. 但错误仍然存​​在

编辑 2: 我尝试在 tomcat 8(servlet 规范 3.1)上部署生成的 war 并且它工作正常 - 我的意思是独立实例不是 STS 嵌入式

编辑 3: 我尝试在 tomcat 6(servlet 规范 2.5)上部署生成的 war - 在删除 web.xml 之后,但它没有用

这个错误消失了 weblogic.xml :

<?xml version="1.0" encoding="UTF-8"?>
<wls:weblogic-web-app xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-web-app" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.3/weblogic-web-app.xsd">
    <wls:weblogic-version>10.3.6</wls:weblogic-version>
    <wls:context-root>OnlineChannelBackend</wls:context-root>
    <wls:container-descriptor>
        <wls:prefer-application-packages>           
            <wls:package-name>org.springframework.*</wls:package-name>
            <wls:package-name>org.springframework.util.MultiValueMap.*</wls:package-name>
            <wls:package-name>org.slf4j.*</wls:package-name>
            <wls:package-name>com.fasterxml.jackson.databind.*</wls:package-name>
            <wls:package-name>com.fasterxml.jackson.*</wls:package-name>
            <wls:package-name>com.fasterxml.jackson.datatype.jsr310.*</wls:package-name>
        </wls:prefer-application-packages>
    </wls:container-descriptor>
</wls:weblogic-web-app>