el-api-1.0.jar - jar not loaded - Offending class:

2019-06-24 03:25发布

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

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

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]]

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>

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

1条回答
叛逆
2楼-- · 2019-06-24 03:46

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>
查看更多
登录 后发表回答