Camunda BPM Spring启动无法启动weblogic - 也许是泽西问题

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Camunda BPM Spring启动无法启动weblogic - 也许是泽西问题相关的知识,希望对你有一定的参考价值。

我有使用camunda和spring boot的应用程序,并使用嵌入式tomcat。但现在我需要安装应用程序作为战争。 使用独立的tomcat一切都还可以,但是使用weblogic我无法启动应用程序。我收到以下错误:

<Sep 5, 2018 9:59:42,539 PM MSK> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID "24521744092298" for task "1" on [partition-name: DOMAIN]. Error is: "weblogic.application.ModuleException: java.lang.AbstractMethodError"
weblogic.application.ModuleException: java.lang.AbstractMethodError
    at weblogic.application.internal.ExtensibleModuleWrapper.start(ExtensibleModuleWrapper.java:140)
    at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:124)
    at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:233)
    at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:228)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)
    Truncated. see log file for complete stacktrace
Caused By: java.lang.AbstractMethodError
    at org.glassfish.jersey.server.ApplicationHandler$4.get(ApplicationHandler.java:408)
    at org.glassfish.jersey.server.ApplicationHandler$4.get(ApplicationHandler.java:399)
    at org.glassfish.jersey.internal.util.collection.Values$LazyValueImpl.get(Values.java:340)
    at org.glassfish.jersey.server.ApplicationHandler$3.call(ApplicationHandler.java:350)
    at org.glassfish.jersey.server.ApplicationHandler$3.call(ApplicationHandler.java:347)
    Truncated. see log file for complete stacktrace
> 
<Sep 5, 2018 9:59:42,543 PM MSK> <Error> <Deployer> <BEA-149202> <Encountered an exception while attempting to commit the 9 task for the application "order-management-service_war_exploded" on [partition-name: DOMAIN].> 
<Sep 5, 2018 9:59:42,545 PM MSK> <Warning> <Deployer> <BEA-149004> <Failures were detected while initiating deploy task for application "order-management-service_war_exploded".> 
<Sep 5, 2018 9:59:42,545 PM MSK> <Warning> <Deployer> <BEA-149078> <Stack trace for message 149004
weblogic.application.ModuleException: java.lang.AbstractMethodError
    at weblogic.application.internal.ExtensibleModuleWrapper.start(ExtensibleModuleWrapper.java:140)
    at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:124)
    at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:233)
    at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:228)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)
    Truncated. see log file for complete stacktrace
Caused By: java.lang.AbstractMethodError
    at org.glassfish.jersey.server.ApplicationHandler$4.get(ApplicationHandler.java:408)
    at org.glassfish.jersey.server.ApplicationHandler$4.get(ApplicationHandler.java:399)
    at org.glassfish.jersey.internal.util.collection.Values$LazyValueImpl.get(Values.java:340)
    at org.glassfish.jersey.server.ApplicationHandler$3.call(ApplicationHandler.java:350)
    at org.glassfish.jersey.server.ApplicationHandler$3.call(ApplicationHandler.java:347)
    Truncated. see log file for complete stacktrace

并不重要,我使用camunda企业版还是标准版。我的pom包含以下依赖项:

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <dependency>
        <groupId>org.camunda.bpm.springboot</groupId>
        <artifactId>camunda-bpm-spring-boot-starter-webapp-ee</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-tomcat</artifactId>
        <scope>provided</scope>
    </dependency>

我怎么解决这个问题?

编辑 据我所知,整个问题可能出现在依赖者camunda里面的球衣上。我编辑我的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://xmlns.oracle.com/weblogic/weblogic-web-app
http://xmlns.oracle.com/weblogic/weblogic-web-app/1.9/weblogic-web-app.xsd">

    <wls:container-descriptor>
        <wls:prefer-application-packages>
            <wls:package-name>org.apache.taglibs.*</wls:package-name>
            <wls:package-name>org.springframework.*</wls:package-name>
            <!--<wls:package-name>org.glassfish.*</wls:package-name>-->
            <wls:package-name>javax.persistence.*</wls:package-name>
            <wls:package-name>org.hibernate.*</wls:package-name>
            <wls:package-name>javax.validation.*</wls:package-name>
            <wls:package-name>javax.validation.bootstrap.*</wls:package-name>
            <wls:package-name>javax.validation.constraints.*</wls:package-name>
            <wls:package-name>javax.validation.groups.*</wls:package-name>
            <wls:package-name>javax.validation.metadata.*</wls:package-name>
            <wls:package-name>javax.validation.spi.*</wls:package-name>
            <wls:package-name>com.fasterxml.jackson.*</wls:package-name>
            <wls:package-name>org.slf4j.*</wls:package-name>
            <wls:package-name>org.apache.logging.*</wls:package-name>

            <!-- jsr311 -->
            <wls:package-name>javax.ws.rs.*</wls:package-name>
            <!-- javassist -->
            <wls:package-name>javassist.*</wls:package-name>
            <!-- aop repackaged -->
            <wls:package-name>org.aopalliance.*</wls:package-name>

            <!-- jersey 2 -->
            <wls:package-name>jersey.repackaged.*</wls:package-name>
            <wls:package-name>org.glassfish.jersey.*</wls:package-name>
            <wls:package-name>com.sun.research.ws.wadl.*</wls:package-name>
            <wls:package-name>com.sun.ws.rs.ext.*</wls:package-name>

            <!-- media providers -->
            <wls:package-name>org.eclipse.persistence.*</wls:package-name>
            <wls:package-name>org.codehaus.jackson.*</wls:package-name>
            <wls:package-name>org.codehaus.jettison.*</wls:package-name>

            <!-- hk2 -->
            <wls:package-name>org.glassfish.hk2.*</wls:package-name>
            <wls:package-name>org.jvnet.hk2.*</wls:package-name>
            <wls:package-name>org.jvnet.tiger_types.*</wls:package-name>

            <wls:package-name>org.objectweb.asm.*</wls:package-name>
            <wls:package-name>antlr.*</wls:package-name>


            <wls:package-name>com.sun.jersey.*</wls:package-name>

            <wls:package-name>jersey.repackaged.org.objectweb.asm.*</wls:package-name>

        </wls:prefer-application-packages>
        <wls:prefer-application-resources>
            <wls:resource-name>org.apache.taglibs.*</wls:resource-name>
            <wls:resource-name>org.springframework.*</wls:resource-name>
            <wls:resource-name>javax.persistence.*</wls:resource-name>
            <wls:resource-name>javax.validation.*</wls:resource-name>
            <wls:resource-name>org.hibernate.*</wls:resource-name>
            <wls:resource-name>com.fasterxml.jackson.*</wls:resource-name>
        </wls:prefer-application-resources>
    </wls:container-descriptor>
</wls:weblogic-web-app>

但它也不起作用,我得到这个错误:

ogic.application.ModuleException: java.lang.ClassCastException: weblogic.jaxrs.server.media.multipart.Jersey1MultiPartSupport cannot be cast to org.glassfish.jersey.internal.spi.AutoDiscoverable
    at weblogic.application.internal.ExtensibleModuleWrapper.start(ExtensibleModuleWrapper.java:140)
    at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:124)
    at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:233)
    at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:228)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)
    Truncated. see log file for complete stacktrace
Caused By: java.lang.ClassCastException: weblogic.jaxrs.server.media.multipart.Jersey1MultiPartSupport cannot be cast to org.glassfish.jersey.internal.spi.AutoDiscoverable
    at java.util.TreeMap.put(TreeMap.java:552)
    at java.util.TreeSet.add(TreeSet.java:255)
    at java.util.AbstractCollection.addAll(AbstractCollection.java:344)
    at java.util.TreeSet.addAll(TreeSet.java:312)
    at org.glassfish.jersey.model.internal.CommonConfig.configureAutoDiscoverableProviders(CommonConfig.java:599)
    Truncated. see log file for complete stacktrace
> 

我使用了最新的weblogic 12.2.1.3,spring boot 2.0.4和camunda 7.9.0(starter 3.0.0)

答案

我找到了解决方案。我编辑了我的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://xmlns.oracle.com/weblogic/weblogic-web-app
http://xmlns.oracle.com/weblogic/weblogic-web-app/1.9/weblogic-web-app.xsd">

    <wls:context-root>/order</wls:context-root>
    <wls:container-descriptor>

        <wls:prefer-application-packages>
            <wls:package-name>org.apache.taglibs.*</wls:package-name>
            <wls:package-name>org.springframework.*</wls:package-name>
            <wls:package-name>javax.persistence.*</wls:package-name>
            <wls:package-name>org.hibernate.*</wls:package-name>
            <wls:package-name>javax.validation.*</wls:package-name>
            <wls:package-name>javax.validation.bootstrap.*</wls:package-name>
            <wls:package-name>javax.validation.constraints.*</wls:package-name>
            <wls:package-name>javax.validation.groups.*</wls:package-name>
            <wls:package-name>javax.validation.metadata.*</wls:package-name>
            <wls:package-name>javax.validation.spi.*</wls:package-name>
            <wls:package-name>com.fasterxml.jackson.*</wls:package-name>
            <!--<wls:package-name>org.slf4j.*</wls:package-name>-->
            <wls:package-name>org.apache.logging.*</wls:package-name>

            <!-- jsr311 -->
            <wls:package-name>javax.ws.rs.*</wls:package-name>
            <!-- javassist -->
            <wls:package-name>javassist.*</wls:package-name>
            <!-- aop repackaged -->
            <wls:package-name>org.aopalliance.*</wls:package-name>

            <!-- jersey 2 -->
            <wls:package-name>jersey.repackaged.*</wls:package-name>
            <wls:package-name>org.glassfish.jersey.*</wls:package-name>
            <wls:package-name>com.sun.research.ws.wadl.*</wls:package-name>
            <wls:package-name>com.sun.ws.rs.ext.*</wls:package-name>

            <!-- media providers -->
            <wls:package-name>org.eclipse.persistence.*</wls:package-name>
            <wls:package-name>org.codehaus.jackson.*</wls:package-name>
            <wls:package-name>org.codehaus.jettison.*</wls:package-name>

            <!-- hk2 -->
            <wls:package-name>org.glassfish.hk2.*</wls:package-name>
            <wls:package-name>org.jvnet.hk2.*</wls:package-name>
            <wls:package-name>org.jvnet.tiger_types.*</wls:package-name>

            <wls:package-name>org.objectweb.asm.*</wls:package-name>
            <wls:package-name>antlr.*</wls:package-name>

            <wls:package-name>jersey.repackaged.org.objectweb.asm.*</wls:package-name>

        </wls:prefer-application-packages>
        <wls:prefer-application-resources>
            <wls:resource-name>org.apache.taglibs.*</wls:resource-name>
            <wls:resource-name>org.springframework.*</wls:resource-name>
            <wls:resource-name>javax.persistence.*</wls:resource-name>
            <wls:resource-name>javax.validation.*</wls:resource-name>
            <wls:resource-name>org.hibernate.*</wls:resource-name>
            <wls:resource-name>com.fasterxml.jackson.*</wls:resource-name>


            <!-- apis -->
            <wls:resource-name>javax.ws.rs.*</wls:resource-name>
            <!-- jersey -->
            <wls:resource-name>META-INF/services/org.glassfish.jersey.*</wls:resource-name>
            <wls:resource-name>com.sun.jersey.*</wls:resource-name>
            <wls:resource-name>org.glassfish.jersey.*</wls:resource-name>
            <wls:resource-name>jersey.repackaged.*</wls:resource-name>
            <!-- hk2 -->
            <wls:resource-name>META-INF/services/org.glassfish.hk2.*</wls:resource-name>
            <wls:resource-name>org.glassfish.hk2.*</wls:resource-name>
            <wls:resource-name>org.jvnet.hk2.*</wls:resource-name>
            <wls:resource-name>org.jvnet.hk2.tiger_types.*</wls:resource-name>

        </wls:prefer-application-resources>
    </wls:container-descriptor>
</wls:weblogic-web-app>

并启动webapp添加启动器休息(我不知道为什么,但它的工作原理)在pom.xml中排除了jersey-container-servlet:

            <dependency>
                <groupId>org.camunda.bpm.springboot</groupId>
                <artifactId>camunda-bpm-spring-boot-starter-rest</artifactId>
                <version>${camunda.spring.boot.starter.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.glassfish.jersey.containers</groupId>
                        <artifactId>jersey-container-servlet</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.camunda.bpm.springboot</groupId>
                <artifactId>camunda-bpm-spring-boot-starter-webapp</artifactId>
                <version>${camunda.spring.boot.starter.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.glassfish.jersey.containers</groupId>
                        <artifactId>jersey-container-servlet</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>

以上是关于Camunda BPM Spring启动无法启动weblogic - 也许是泽西问题的主要内容,如果未能解决你的问题,请参考以下文章

Camunda Spring启动事务问题

Camunda 与 camunda-bpm-camel 社区版的集成删除了路由之间的交换属性集

开源流程引擎Camunda BPM如何扩展数据库表

在挂起状态下启动camunda进程

BPM工作流引擎常见的术语和概念介绍

camunda流程实例启动的一些简单操作