Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This is a sign of classpath pollution. The JSP/Servlet API libraries are appserver implementation dependent and belongs in case of Tomcat 6 in the <code>Tomcat/lib</code> folder and should in <strong>no way</strong> be moved nor duplicated somewhere else. It's recipe for portability trouble and collisions in classloading as you've encountered now. The libraries in webapp have precedence in classloading. If the <code>servlet-api.jar</code> is encountered there, it is in turn looking for its dependencies there, but they were apparently missing in there.</p> <p>You must remove any appserver-specific libraries from the webapp's <code>Webapp/WEB-INF/lib</code>. You should <em>only</em> put webapp-specific libraries in there. Keep appserver-specific libraries in the appserver's own default classpath, which is the <code>Tomcat/lib</code> in your case. Keep it untouched. You can at most add libraries which you'd like to share among all webapps in there, or even better, configure the <code>shared.loader</code> in <code>Tomcat/conf/catalina.properties</code> for that.</p> <p>Also remove any appserver-specific and webapp-specific libraries from the <code>JDK/lib</code> and <code>JRE/lib</code> folders, if any. I've seen too often that some starters move/copy the libraries there because "it otherwise doesn't compile". You should never copy non-JRK/JRE-specific libraries in there. It is recipe for portability trouble as well. When compiling classes with <code>javac</code>, you should use the <code>-cp</code> argument to specify the dependent libraries.</p> <p><strong>Update</strong>: in case of an IDE (you seem to use one as you're talking about "build path"), you need to associate the web project with an application server. In Eclipse for example, you have the option to do that during creation of a <em>Dynamic Web Project</em>. You need to integrate the server instance in Eclipse prior to project creation. You can do that through the <code>Servers</code> view (assuming that you're using <em>Eclipse for Java <strong>EE</strong> developers</em>, else upgrade). You can also change it afterwards through the <em>Servers</em> entry in the project properties. Choose one which you'd like to use as the "default" server and then its libraries will automagically be included in the project's build path. There's absolutely no need to copy/move them somewhere else. See also <a href="https://stackoverflow.com/questions/4076601/how-do-i-import-the-javax-servlet-api-in-my-eclipse-project">How do I import the javax.servlet API in my Eclipse project?</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload