el-api-1.0.jar - jar not loaded - 违规类:javax / el / Expression.class [英] el-api-1.0.jar - jar not loaded - Offending class: javax/el/Expression.class

查看:474
本文介绍了el-api-1.0.jar - jar not loaded - 违规类:javax / el / Expression.class的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用RestEasy运行一个简单的restful服务。以下是我的设置。

I'm trying to get a simple restful service running using RestEasy. Following is my setup.

Tomcat7
Eclipse& Maven
我Maven安装war文件并将其复制到webapps文件夹。

Tomcat7 Eclipse & Maven I Maven Install and copy the war file to webapps folder.

部署war文件时,catalina.out文件会显示此信息并且未部署应用程序。

When deploying the war file the catalina.out file shows this and the application is not deployed.

    Mar 24, 2013 9:44:38 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(/usr/share/tomcat7/webapps/buzzcore-1.0/WEB-INF/lib/el-api-1.0.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/el/Expression.class
Mar 24, 2013 9:44:40 PM org.apache.catalina.core.ContainerBase addChildInternal
SEVERE: ContainerBase.addChild: start: 
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/buzzcore-1.0]]

我不确定导致问题的原因。以下是我的pom.xml和web.xml。

I'm not sure what is causing the problem. Following are my pom.xml and web.xml.

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>buzzcore</groupId>
    <artifactId>buzzcore</artifactId>
    <packaging>war</packaging>
    <version>1.0</version>  
    <name>buzzcore</name>    

    <repositories>

        <repository>
         <id>org.jboss.resteasy</id>
         <url>http://repository.jboss.org/maven2/</url>
        </repository>

        <repository>
            <id>eap</id>
            <url>http://maven.repository.redhat.com/techpreview/all</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>eap</id>
            <url>http://maven.repository.redhat.com/techpreview/all</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.6</maven.compiler.source>
        <maven.compiler.target>1.6</maven.compiler.target>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.jboss.spec</groupId>
            <artifactId>jboss-javaee-6.0</artifactId>
            <version>3.0.0.Final-redhat-1</version>
            <type>pom</type>
            <scope>provided</scope>
        </dependency>

        <dependency>
             <groupId>org.jboss.resteasy</groupId>
             <artifactId>resteasy-jaxrs</artifactId>
             <version>2.3.5.Final</version>
        </dependency>

        <dependency>
             <groupId>org.jboss.resteasy</groupId>
             <artifactId>resteasy-jaxb-provider</artifactId>
             <version>2.3.5.Final</version>
        </dependency>

        <dependency>
              <groupId>org.jboss.resteasy</groupId>
              <artifactId>resteasy-jettison-provider</artifactId>
              <version>2.3.5.Final</version>
        </dependency>

    </dependencies>
    <profiles>
        <profile>
            <!-- When built in OpenShift the 'openshift' profile will be used when 
                invoking mvn. -->
            <!-- Use this profile for any OpenShift specific customization your app 
                will need. -->
            <!-- By default that is to put the resulting archive into the 'webapps' 
                folder. -->
            <!-- http://maven.apache.org/guides/mini/guide-building-for-different-environments.html -->
            <id>openshift</id>
            <build>
                <finalName>buzzcore</finalName>
                <plugins>
                    <plugin>
                        <artifactId>maven-war-plugin</artifactId>
                        <version>2.1.1</version>
                        <configuration>
                            <outputDirectory>webapps</outputDirectory>
                            <warName>ROOT</warName>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>

web.xml

<?xml version="1.0" encoding="UTF-8"?>

<web-app version="3.0"
         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_3_0.xsd"
         metadata-complete="false">


</web-app>

这是一个OpenShift应用程序,因此是openshift条目。我已经将RestEasy中的lib复制到src\main\webapp\WEB-INF \lib。

This is an OpenShift application, hence the openshift entries. I've copied the lib from RestEasy to src\main\webapp\WEB-INF\lib.

推荐答案

尝试再次将以下内容添加到pom文件和包中:

Try to add following to you pom file and package again:

        <dependency>
            <groupId>javax.el</groupId>
            <artifactId>el-api</artifactId>
            <scope>provided</scope>
            <version>1.0</version>
        </dependency>

这篇关于el-api-1.0.jar - jar not loaded - 违规类:javax / el / Expression.class的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆