java 网络逻辑14c:服务器异常,

hrirmatl  于 2023-01-16  发布在  Java
关注(0)|答案(1)|浏览(103)

我已将OSGi Web应用程序从java 7和服务器weblogic 12 c迁移到java 8和weblogic 14 c。Web应用程序将jax-rs和jersey库用于Web服务。在以前的环境中未提供这些库,在新环境中,我希望将它们保留在未提供的范围内。当我在weblogic 14 c服务器上部署Web应用程序时,我收到此奇怪的异常:

<11-gen-2023 14.55.55,013 CET> <Error> <Console> <BEA-240003> <Administration Console encountered the following error: weblogic.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)
        at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:78)
        at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:52)
        at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:752)
        at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)
        at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:262)
        at weblogic.application.internal.SingleModuleDeployment.activate(SingleModuleDeployment.java:52)
        at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:165)
        at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:90)
        at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:631)
        at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:171)
        at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:121)
        at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:348)
        at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:914)
        at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1475)
        at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:466)
        at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:181)
        at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:217)
        at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:14)
        at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:69)
        at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:677)
        at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:352)
        at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:337)
        at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:57)
        at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)
        at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:651)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:420)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:360) 
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:626)
        at org.glassfish.jersey.server.ResourceConfig.configureAutoDiscoverableProviders(ResourceConfig.java:789)
        at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:322)
        at org.glassfish.jersey.server.ApplicationHandler.lambda$initialize$1(ApplicationHandler.java:293)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:292)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:274)
        at org.glassfish.jersey.internal.Errors.processWithException(Errors.java:232)
        at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:292)
        at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:259)
        at org.glassfish.jersey.servlet.WebComponent.<init>(WebComponent.java:311)
        at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:154)
        at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:346)
        at javax.servlet.GenericServlet.init(GenericServlet.java:203)
        at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:356)
        at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:307)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:344)
        at weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:197)
        at weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203)
        at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71)
        at weblogic.servlet.internal.StubSecurityHelper.initServletInstance(StubSecurityHelper.java:99)
        at weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:87)
        at weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:74)
        at weblogic.servlet.internal.StubLifecycleHelper.<init>(StubLifecycleHelper.java:57)
        at weblogic.servlet.internal.StubLifecycleHelper.<init>(StubLifecycleHelper.java:31)
        at weblogic.servlet.internal.ServletStubImpl.initStubLifecycleHelper(ServletStubImpl.java:674)
        at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:613)
        at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:2099)
        at weblogic.servlet.internal.WebAppServletContext.loadServletsOnStartup(WebAppServletContext.java:2076)
        at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1965)
        at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3254)
        at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1879)
        at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:934)
        at weblogic.application.internal.ExtensibleModuleWrapper$StartStateChange.next(ExtensibleModuleWrapper.java:360)
        at weblogic.application.internal.ExtensibleModuleWrapper$StartStateChange.next(ExtensibleModuleWrapper.java:356)
        at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)
        at weblogic.application.internal.ExtensibleModuleWrapper.start(ExtensibleModuleWrapper.java:138)

父pom

<!-- JAX-RS -->
            <!-- prova dipendenza sostituitiva -->
            <!-- dipendenza utilizzate al posto di jax-rs per il deploy su server veblogic 14c-->
            <!-- nelle build con java 7 questa dipendenza non è presente. aggiunta per prove -->
            <dependency>
                <groupId>jakarta.ws.rs</groupId>
                <artifactId>jakarta.ws.rs-api</artifactId>
                <version>2.1.5</version>
            </dependency>  
            <!-- JAX-RS -->
            
            <!-- JERSEY -->
            <dependency>
                <groupId>org.glassfish.jersey.media</groupId>
                <artifactId>jersey-media-jaxb</artifactId>
                <version>${jersey.version}</version>
                <!--<scope>provided</scope>--> 
            </dependency>
            <dependency>
                <groupId>org.glassfish.jersey.core</groupId>
                <artifactId>jersey-client</artifactId>
                <version>${jersey.version}</version>
                <!--<scope>provided</scope>-->
            </dependency>
            <dependency>
                <groupId>org.glassfish.jersey.containers</groupId>
                <artifactId>jersey-container-servlet</artifactId>
                <version>${jersey.version}</version>
                <!--<scope>provided</scope>-->
            </dependency>
            <dependency>
                <groupId>org.glassfish.jersey.media</groupId>
                <artifactId>jersey-media-json-jackson</artifactId>
                <version>${jersey.version}</version>
                <!--<scope>provided</scope>-->
            </dependency>
            <dependency>
                <groupId>org.glassfish.jersey.ext</groupId>
                <artifactId>jersey-bean-validation</artifactId>
                <version>${jersey.version}</version>
                <!--<scope>provided</scope>-->
            </dependency>           
            <!-- Librerie di test server side https://eclipse-ee4j.github.io/jersey.github.io/documentation/latest/test-framework.html -->
            <!-- ptrebbero non servire -->
            <!-- <dependency>
                <groupId>org.glassfish.jersey.test-framework.providers</groupId>
                <artifactId>jersey-test-framework-provider-inmemory</artifactId>
                <version>${jersey.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.glassfish.jersey.test-framework.providers</groupId>
                <artifactId>jersey-test-framework-provider-jetty</artifactId>
                <version>${jersey.version}</version>
                <scope>provided</scope>
            </dependency> -->
            
            
            <dependency>
                <groupId>org.glassfish.hk2</groupId>
                <artifactId>hk2-api</artifactId>
                <version>2.6.1</version>
                <!-- <scope>provided</scope> -->
            </dependency>
            <dependency>
                <groupId>org.glassfish.hk2</groupId>
                <artifactId>hk2-utils</artifactId>
                <version>2.6.1</version>
                <!-- <scope>provided</scope> -->
            </dependency>
            <dependency>
                <groupId>org.glassfish.hk2</groupId>
                <artifactId>hk2-locator</artifactId>
                <version>2.6.1</version>
                <!-- <scope>provided</scope> -->
            </dependency>
            <dependency>
                <groupId>jakarta.el</groupId>
                <artifactId>jakarta.el-api</artifactId>
                <version>3.0.2</version>
                <!-- <scope>provided</scope> -->
            </dependency>           
            <dependency>
                <groupId>org.glassfish.jersey.core</groupId>
                <artifactId>jersey-server</artifactId>
                <version>${jersey.version}</version>
                <!--<scope>provided</scope>-->
            </dependency>           
            <dependency>
                <groupId>org.glassfish.jersey.core</groupId>
                <artifactId>jersey-common</artifactId>
                <version>${jersey.version}</version>
                <!--<scope>provided</scope>-->
            </dependency>
            <!-- questa dipendenza serve per fare il deploy della webapp -->
            <dependency>
                <groupId>org.glassfish.jersey.inject</groupId>
                <artifactId>jersey-hk2</artifactId>
                <version>${jersey.version}</version>
            </dependency>
            
            <!-- JERSEY -->
            
            <!-- JACKSON -->
            <dependency>
                  <groupId>com.fasterxml.jackson.datatype</groupId>
                  <artifactId>jackson-datatype-joda</artifactId>
                  <version>${jackson.version}</version>
            </dependency>
            
            <dependency>
              <groupId>com.fasterxml.jackson.core</groupId>
              <artifactId>jackson-core</artifactId>
              <version>${jackson.version}</version>
            </dependency>
            <dependency>
              <groupId>com.fasterxml.jackson.core</groupId>
              <artifactId>jackson-databind</artifactId>
              <version>${jackson.version}</version>
            </dependency>
            <dependency>
              <groupId>com.fasterxml.jackson.module</groupId>
              <artifactId>jackson-module-jaxb-annotations</artifactId>
              <version>${jackson.version}</version>
            </dependency>
            <!-- JACKSON -->

网络应用程序pom

<modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>eu.sia.mdp</groupId>
        <artifactId>mdp-be-parent</artifactId>
        <version>2.18.55</version>
    </parent>

    <artifactId>mdp-be-webapp</artifactId>
    <packaging>war</packaging>
    <name>BackEnd WebApp</name>
    <description>A web application that acts as a bridge to proxy all request to the OSGi container</description>

    <build>
        <finalName>mdp-be</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.10</version>
                <executions>
                    <execution>
                        <id>copy-dependencies</id>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <verbose>true</verbose>
                            <outputDirectory>${project.build.directory}/osgi-lib</outputDirectory>
                            <includeScope>compile</includeScope>
                            <excludeScope>provided</excludeScope>
                            <excludeArtifactIds>
                                org.apache.felix.framework,
                                javax.servlet-api,
                                org.apache.felix.ipojo.annotations,
                                hazelcast-code-generator,
                                annotations,
                                minimal-json,
                                freemarker,
                                slf4j-simple,
                                ccf2,
                                eci,
                                eci-tools,
                                frame,
                                server,
                                client,
                                security,
                                transaction-api,
                                connector-api,
                                hamcrest-core,
                                slf4j-api,
                                logback-classic,
                                logback-core,
                                janino,
                                derby,
                                flyway-core,
                                jooq-codegen,
                                derbynet,
                                derbyclient,
                                hsqldb
                            </excludeArtifactIds>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.5</version>
                <configuration>
                    <warName>mdp-be</warName>
                    <webResources>
                        <resource>
                            <directory>${project.build.directory}/osgi-lib</directory>
                            <targetPath>WEB-INF/osgi-lib</targetPath>
                        </resource>
                    </webResources>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.sonarsource.scanner.maven</groupId>
                <artifactId>sonar-maven-plugin</artifactId>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>org.apache.maven.plugins</groupId>
                                        <artifactId>maven-dependency-plugin</artifactId>
                                        <versionRange>[2.0,)</versionRange>
                                        <goals>
                                            <goal>copy-dependencies</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore />
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
    <dependencies>
        <dependency>
            <groupId>eu.sia.mdp</groupId>
            <artifactId>mdp-database-osgi-bundle</artifactId>
        </dependency>
        <dependency>
            <groupId>eu.sia.mdp</groupId>
            <artifactId>rest-osgi-bundle</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>eu.sia.mdp</groupId>
            <artifactId>dataqueue-osgi-bundle</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.framework</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.http.proxy</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.http.bridge</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.compendium</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>it.zerounotribe.poste.context.posteID</groupId>
            <artifactId>posteIDCryptoLib</artifactId>
            <version>1.0</version>
        </dependency>
        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
        </dependency>
        <dependency>
            <groupId>org.codehaus.janino</groupId>
            <artifactId>janino</artifactId>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.hsqldb</groupId>
            <artifactId>hsqldb</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.flywaydb</groupId>
            <artifactId>flyway-core</artifactId>
            <scope>provided</scope>
        </dependency>
        
        <!-- PROVE -->
        <!-- package usato nel modulo webapp -->
        <dependency>
            <groupId>jakarta.el</groupId>
            <artifactId>jakarta.el-api</artifactId>
        </dependency>    
        <!-- <dependency>
            <groupId>jakarta.ws.rs</groupId>
            <artifactId>jakarta.ws.rs-api</artifactId>
            <version>2.1.5</version>
            <scope>provided</scope>
        </dependency>-->
        <dependency>
            <groupId>jakarta.ws.rs</groupId>
            <artifactId>jakarta.ws.rs-api</artifactId>
        </dependency>       
        <dependency>
            <groupId>org.glassfish.jersey.containers</groupId>
            <artifactId>jersey-container-servlet</artifactId>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.inject</groupId>
            <artifactId>jersey-hk2</artifactId>
        </dependency>

        <!--<dependency>
            <groupId>org.glassfish.hk2</groupId>
            <artifactId>hk2-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.glassfish.hk2</groupId>
            <artifactId>hk2-utils</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.glassfish.hk2</groupId>
            <artifactId>hk2-locator</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.media</groupId>
            <artifactId>jersey-media-jaxb</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.core</groupId>
            <artifactId>jersey-client</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.containers</groupId>
            <artifactId>jersey-container-servlet</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.media</groupId>
            <artifactId>jersey-media-json-jackson</artifactId>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.ext</groupId>
            <artifactId>jersey-bean-validation</artifactId>
            <scope>provided</scope>
        </dependency> -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
        </dependency>
        <!-- PROVE -->          
    </dependencies>

</project>

网页.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="..." xmlns="..." xsi:schemaLocation="..." version="3.0">
  <listener>
    <listener-class>org.apache.felix.http.proxy.ProxyListener</listener-class>
  </listener>
  <servlet>
    <servlet-name>felix-http-proxy</servlet-name>
    <servlet-class>org.apache.felix.http.proxy.ProxyServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    <async-supported>true</async-supported>
  </servlet>
  <servlet-mapping>
    <servlet-name>felix-http-proxy</servlet-name>
    <url-pattern>/*</url-pattern>
  </servlet-mapping>
  
  <resource-ref>
     <description>Database Motore dei Pagamenti</description>
     <res-ref-name>jdbc/MDPDB</res-ref-name>
     <res-type>javax.sql.DataSource</res-type>
     <res-auth>Container</res-auth>
  </resource-ref>  
  
  <security-constraint>
        <web-resource-collection>
          <web-resource-name>SecuredPages</web-resource-name>
          <url-pattern>/*</url-pattern>
        </web-resource-collection>
        <user-data-constraint>
          <transport-guarantee>CONFIDENTIAL</transport-guarantee>
        </user-data-constraint>
    </security-constraint>
  
</web-app>

网络逻辑.xml

<?xml version="1.0" encoding="UTF-8"?>
<weblogic-web-app xmlns="..." xmlns:xsi="..." xsi:schemaLocation="...">
  <container-descriptor>
    <!-- MUST USE THIS OR WEBLOGIC WILL USE SYSTEM CLASSPATH FIRST -->
    <prefer-application-packages>
      <package-name>org.slf4j.*</package-name>
      <package-name>org.apache.commons.logging.*</package-name>
      <!--<package-name>com.sun.jersey.*</package-name>
      <package-name>com.sun.mail.*</package-name>-->
      <package-name>org.glassfish.jersey.*</package-name>
      <package-name>org.glassfish.hk2.*</package-name>
      <package-name>org.jvnet.hk2.*</package-name>
      <package-name>jersey.repackaged.org.objectweb.asm.*</package-name>
      <package-name>org.objectweb.asm.*</package-name>
      <!--<package-name>com.sun.ws.rs.ext.*</package-name>-->
      <package-name>javax.ws.rs.*</package-name>
      <package-name>javax.persistence.*</package-name> 
      <package-name>javax.mail.*</package-name>
    </prefer-application-packages>
    
    <prefer-application-resources>
      <resource-name>org/slf4j/impl/StaticLoggerBinder.class</resource-name>
      <resource-name>org/slf4j/impl/StaticMDCBinder.class</resource-name>
      <resource-name>META-INF/services/javax.xml.ws.spi.Provider</resource-name>
      
    </prefer-application-resources>
  </container-descriptor>
  <resource-description>
    <res-ref-name>jdbc/MDPDB</res-ref-name>
    <jndi-name>jdbc/MDPDB</jndi-name>
  </resource-description>
  <context-root>mdp-be</context-root>
</weblogic-web-app>

有人能帮我明白我错在哪里吗?

olhwl3o2

olhwl3o21#

这似乎是一个类加载问题。
你的weblogic.xml有<package-name>org.glassfish.jersey.*</package-name>,也就是说,它通过一个应用程序类加载器加载Jersey,但是weblogic.jaxrs.server.media.multipart.Jersey1MultiPartSupport是由另一个(WLS默认)类加载器加载的。
修复程序将位于weblogic.xml中。您可以尝试以下几个选项:
1.更新您的prefer-application-resources。首先,添加

<resource-name>META-INF/services/org.glassfish.hk2.extension.*</resource-name>
<resource-name>META-INF/services/org.glassfish.jersey.*</resource-name>
<resource-name>META-INF/services/org.glassfish.jersey.internal.spi.*</resource-name>
...
<resource-name>jersey.repackaged.org.objectweb.asm.*</resource-name>
<resource-name>org.glassfish.jersey.*</resource-name>

1.从prefer-application-packages中删除Jersey。在14c中,有一个更新的Jersey,它可能会满足您的需要,特别是在当前的14.1.2中。
1.作为最后一个选项,捆绑Jersey1MultiPartSupport并更新prefer-application-packages。这不是一个好的解决方案,但取决于您的用例。

相关问题