Search code examples
javatomcatresteasy

RestEasy-Links: javax.el-3.0.0.jar is not loaded during the deployment on Tomcat


im going to write a little rest service and facing a issue when it comes to the link injection.

I´m using resteasy 3.0.7.Final and resteasy-links 3.0.7.Final. When i deploy the application to Tomcat (7.0.59) the log shows the following information:

INFORMATION: validateJarFile(/Users/user/Workspace/.metadata/.plugins/
org.eclipse.wst.server.core/tmp0/wtpwebapps/jaxrs-wnck/WEB-INF/lib/javax.el-3.0.0.jar)
- jar not loaded. See Servlet Spec 3.0, section 10.7.2. Offending class:
javax/el/Expression.class
Apr 04, 2015 6:29:48 PM org.apache.catalina.loader.WebappClassLoader validateJarFile

INFORMATION: validateJarFile(/Users/user/Workspace/.metadata/.plugins/org.eclipse.wst.
server.core/tmp0/wtpwebapps/jaxrs-wnck/WEB-INF/lib/jboss-el-api_3.0_spec-1.0.0.Final.jar)
- jar not loaded. See Servlet Spec 3.0, section 10.7.2. Offending class:
javax/el/Expression.class

The service starts but when im requesting a resource which performs a link injection into the RESTServiceDiscovery field, a java.lang.ClassNotFoundException: javax.el.StandardELContext is thrown.

- thank you !


Solution

  • In tomcat 7, Expression Language API specification version is 2.2 and StandardELContext is in version 3.0.

    From Servlet specification:

    As described in the Java EE license agreement, servlet containers that are not part of a Java EE product should not allow the application to override Java SE platform classes, such as those in the java.* and javax.* namespaces, that Java SE does not allow to be modified.

    So, you can:

    • update to tomcat 8;
    • deploy your application in a Java EE container, which allow the application to override;
    • use an older version of rest easy (3.0.5.Final should work);