在WebLogic上部署Web项目时,java.lang.ClassNotFoundException:org.glassfish.jersey.servlet.ServletContainer

时间:2015-12-14 06:45:59

标签: java maven servlets weblogic

我正在尝试使用web application管理控制台在.ear服务器上部署weblogic(以weblogic文件的形式)。当我将我的耳朵添加到控制台时,我收到以下错误 -

java.lang.ClassNotFoundException: org.glassfish.jersey.servlet.ServletContainer

我已经尝试了很多我能找到的其他线程的东西。但不知何故,他们似乎没有帮助。

以下是我的模块的pom.xml -

<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>ParentModule</groupId>
<artifactId>ParentModule</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>WARModule</artifactId>  
<packaging>war</packaging>
<name>WARModule Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
    <groupId>asm</groupId>
    <artifactId>asm</artifactId>
    <version>3.3.1</version>
</dependency>
<dependency>
    <groupId>com.sun.jersey</groupId>
    <artifactId>jersey-bundle</artifactId>
    <version>1.19</version>
</dependency>
<dependency>
    <groupId>com.sun.jersey</groupId>
    <artifactId>jersey-server</artifactId>
    <version>1.19</version>
</dependency>
<dependency>
    <groupId>com.sun.jersey</groupId>
    <artifactId>jersey-core</artifactId>
    <version>1.19</version>
</dependency>
</dependencies>
<build>
<finalName>WARModule</finalName>
    <plugins>
    <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.0.2</version>
            <inherited>true</inherited>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
            </configuration>
        </plugin>
<plugin>
    <artifactId>maven-war-plugin</artifactId>
    <version>2.4</version>
    <configuration>
    <warSourceDirectory>WebContent</warSourceDirectory>
    <failOnMissingWebXml>false</failOnMissingWebXml>
    </configuration>
</plugin>
</plugins>
</build>
<dependencyManagement>
<dependencies>
    <dependency>
        <groupId>org.glassfish.jersey</groupId>
        <artifactId>jersey-bom</artifactId>
        <version>2.6</version>
        <type>pom</type>
        <scope>import</scope>
    </dependency>
    <dependency>
        <groupId>com.fasterxml.jackson.jaxrs</groupId>
        <artifactId>jackson-jaxrs-json-provider</artifactId>
        <version>2.6.0</version>
    </dependency>
    <dependency>
        <groupId>javax</groupId>
        <artifactId>javaee-web-api</artifactId>
        <version>6.0</version> <!-- Put here the version of your Java EE app, in my case 7.0 -->
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <version>3.1.0</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>jstl</artifactId>
        <version>1.2</version>
    </dependency>
    <dependency>
        <groupId>org.glassfish.jersey.containers</groupId>
        <artifactId>jersey-container-servlet</artifactId>
        <version>2.6</version>
        <!-- use the following artifactId if you don't need servlet 2.x compatibility -->
        <!-- artifactId>jersey-container-servlet</artifactId -->
    </dependency>
    <dependency>
        <groupId>org.glassfish.jersey.media</groupId>
        <artifactId>jersey-media-moxy</artifactId>
        <version>2.3</version>
    </dependency>

</dependencies>

</dependencyManagement>

以下是我的模块中添加的dependencies - enter image description here

这就是我添加项目并尝试运行它时weblogic控制台的样子。

enter image description here

任何有关如何摆脱这一点的帮助都非常感谢,已经有一段时间了,因为我坚持这个!

此外,这就是我的WEB-INF/lib文件夹 - enter image description here

0 个答案:

没有答案
相关问题