weblogic 14c: ClassNotFoundException во время развертывания приложения osgi

Я переношу веб-приложение osgi с сервера java 7 и weblogic 12c на java 8 и weblogic 14. В приложении я хотел бы предоставить библиотеки трикотажа без «предоставленной» области, и при развертывании приложения я получаю следующую ошибку:

      <4-gen-2023 9.33.59,936 CET> <Error> <Console> <BEA-240003> <Administration Console encountered the following error: weblogic.application.ModuleException: java.lang.ClassNotFoundException: org.glassfish.jersey.servlet.init.JerseyServletContainerInitializer
        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.ClassNotFoundException: org.glassfish.jersey.servlet.init.JerseyServletContainerInitializer
        at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:1035)
        at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:996)
        at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:101)
        at weblogic.utils.classloaders.GenericClassLoader.doFindClass(GenericClassLoader.java:617)
        at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:547)
        at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:500)
        at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:71)
        at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:53)
        at weblogic.servlet.internal.WebAppServletContext.initContainerInitializer(WebAppServletContext.java:1418)
        at weblogic.servlet.internal.WebAppServletContext.initContainerInitializers(WebAppServletContext.java:1388)
        at weblogic.servlet.internal.WebAppServletContext.initContainerInitializers(WebAppServletContext.java:1368)
        at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1952)
        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)
>

веб-приложение состоит из родительского модуля и подмодулей, включая модуль веб-приложения. Ниже приведены poms, файл web.xml и weblogic. XML

родитель пом

      <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>group.id/groupId>
                <artifactId>mdp-be-webapp</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>javax.servlet</groupId>
                <artifactId>javax.servlet-api</artifactId>
                <version>3.0.1</version>
                <scope>provided</scope>
            </dependency>
            
            <!-- 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>           
            <!-- 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>
            </dependency>
            <!-- JERSEY -->
            
            <!-- JACKSON -->
            <dependency>
                  <groupId>com.fasterxml.jackson.datatype</groupId>
                  <artifactId>jackson-datatype-joda</artifactId>
                  <version>2.9.9</version>
            </dependency>
            <!-- JACKSON -->
            .
                        .
                        .
                        other dependencies
        </dependencies>
    </dependencyManagement>

веб-приложение пом

      <project xmlns="..." xmlns:xsi="..." xsi:schemaLocation="...">

    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>group.id</groupId>
        <artifactId>mdp-be-parent</artifactId>
        <version>2.18.55</version>
    </parent>

    <artifactId>mdp-be-webapp</artifactId>
    <packaging>war</packaging>
    <name>BackEnd WebApp</name>
    
    <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>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>
        
        <dependency>
            <groupId>jakarta.el</groupId>
            <artifactId>jakarta.el-api</artifactId>
            <scope>provided</scope>
        </dependency>
    </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>

weblogic.xml

      <?xml version="1.0" encoding="UTF-8"?>
<weblogic-web-app ...>
  <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>

Я думаю, что в файле weblogic.xml в разделе пакетов отсутствует какая-то конфигурация, но я не могу понять, что именно. Может ли кто-нибудь сказать мне, где я ошибаюсь?

Спасибо.

Я с нетерпением жду решения исключения, выданного сервером во время развертывания.

0 ответов

Другие вопросы по тегам