2

Possible Duplicate:
org.apache.jasper.el.ELContextImpl cannot be cast to org.apache.jasper.runtime.ELContextImpl

I export a web service project (contains jsp pages) from Eclipse in a war file and deploy it in Jetty 8.1.5. It works fine on my machine. But after deploying the same war file on Jetty 8.1.3 on another machine (windows server 2003) it gives HTTP Error 500 and the following exception when I go to the index.jsp page:

org.apache.jasper.el.ELContextImpl cannot be cast to org.apache.jasper.runtime.ELContextImpl

the full trace and more details in this question which I posted two days ago. while all the jars that I have in WEB_INF/lib are provided in these two screenshots:

enter image description here enter image description here

two days of looking around the internet for a solution resulted in knowing that the problem is caused by conflicts between the jars shipped in the war file and other jars (I guess the jetty jars).

The question is: how can I find out which jar is causing the problem? I tried browsing the contents of these jars looking for the class ElContextImpl but did not find anything ? Any thoughts?


EDIT:

I tried copying my local whole Jetty 8.1.5 into the server and statrted jetty from there.. but still no success.

Community
  • 1
  • 1
Sami
  • 7,797
  • 18
  • 45
  • 69
  • Did you try to rebuild your war with jetty-*-8.1.3 dependencies insteead of jetty-*-8.1.5 dependencies and then redeploy it on jetty 8.1.3 ? – Stephan Sep 13 '12 at 13:20
  • @Stephan Trying it now .. but deployed the war as it is in jetty 8.1.3 (same version as on the server) on local machine and it worked normally. But still does not on the server. – Sami Sep 13 '12 at 13:56
  • @Stephan just tried it .. still the same exception – Sami Sep 13 '12 at 14:01
  • Can you post updates such as the screenshot above in the original question. We prefer that you use additional questions to provide extra information. Thanks. – Kev Sep 17 '12 at 23:12

1 Answers1

1

Your WAR file contains some unnecessary JARs like servlet-api-2.4.jar which should be part of the Jetty installation (maybe in another version).

At first sight you should remove all jetty-*.jar, servlet-api-2.4.jar, javax.servlet.*.jar. If you have taken these from your 8.1.5 Jetty installation then it could cause conflicts with your 8.1.3 installation.

vanje
  • 10,180
  • 2
  • 31
  • 47
  • I have just did that locally, and the deployment on my machine (which used to work) is broken now and it gives many exceptions about missing classes from jetty such as : `java.lang.NoClassDefFoundError: org/eclipse/jetty/util/component/AbstractLifeCycle` and i get HTTP ERROR 503 on the browser. – Sami Sep 13 '12 at 15:52
  • Maybe you should restart with a fresh Jetty installation. On my installation this class is contained in `lib/jetty-util-8.1.5.v20120716.jar`. If you start Jetty correctly then this class should be present. – vanje Sep 13 '12 at 16:09
  • I can see the library in `lib/` folder of jetty. I start it by going to the jetty directory and typing `java -jar start.jar`. Is there anything wrong with this command? – Sami Sep 13 '12 at 16:14
  • `jetty-servlets-*.jar` (note the extra 's' at the end) and `jetty-websockets-*.jar` are both valid for `WEB-INF/lib/` as they are user-space dependencies. The rest (like `jetty-util` and `jetty-io` just come along for the ride). Do not worry about `jetty-*.jar` in your WEB-INF/lib as those are isolated in their own WebAppClassLoader and will not conflict with the server jars. – Joakim Erdfelt Sep 14 '12 at 20:40