Hi - I am curious about how things get packaged in a WAR. But maybe I should start with the specifics of the error message.
The
JSP page I wrote opens a MySQL database and runs ad hoc queries that I type in. It's called "SQLGateway" and comes from a textbook on JSP/Servlets. It runs fine on my Eclipse
IDE, and on my desktop (local only) implementation of Apache (7.0) outside of the IDE.
I modified the
JDBC connection info to match a MySQL database on my ISP site, and tried running the program and got this as part of the error message:
root cause
java.lang.NoClassDefFoundError: javax/el/ELException
Am I correct to assume the first thing I need to handle is that this class has to be made available in the ISP context?
A little digging shows that within my IDE, this class is provided in EL-API.JAR which is included in a set of JARs associated with my Apache
Tomcat environment (grouped together as a "Server Environment" library).
General QUESTION #1) When I export a WAR and run it outside of the IDE but still on my desktop, how does
Java find javax.el? It IS in my local install of Apache, so, is that how is resource is found? I didn't place a copy of EL-API.JAR in WEB-INF.LIB, and as far as I know, I don't have a copy on my CLASSPATH, nor in any lib or ext folders for my Java runtime.
General Question #2) Should I include this jar in the WEB-INF.lib folder when I make my WAR and place it in the IDE? I'm unclear if this is a generally accepted practice, or if this functionality should be provided by the Tomcat implementation at the ISP.
(NOTE: I attempted to do this--include EL-API.JAR--and upload it to my IDE, but the configuration on that site is a bit messed up, and I can't delete the exploded WAR from the previous iteration--the permissions are set up wrong. I've got a request in to the ISP to work out this issue and it will probably be resolved sometime Monday.)
Question #3) A JavaRanch FAQ on the Tomcat page reads: "How do I enable the EL (Expression Language) for Tomcat 5?" So close! The ISP uses Apache 6, so I don't know if the answer to the FAQ pertains to my situation or not. My web.xml reads as follows:
Pretty close, but it differs from the xml in the FAQ answer in several particulars. I don't know how one would change the FAQ answer to handle Tomcat 6 to enable EL.
General Question #4) To what extent will a JSP that runs on my local Tomcat (7.0) be backwards compatible with at Tomcat 6.0 implementation? Should I be going to Apache rather than here for that question? Should I have a Tomcat 6.0 running on my home machine instead of 7.0 if the ISP is running 7.0 or do you think I can/should nudge the ISP to use 7.0?
Many, many thanks, as always.