Where do I put jar files in Tomcat 6?
- by Simon
I am having trouble getting my JSP page to load a Java class which is in a jar file. The message I get appears to indicate a class not found exception:
Jan 6, 2011 12:21:45 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 72 in the jsp file: /xmlloader.jsp
FactArray cannot be resolved to a type
69: sourceType = "1";
70: }
71:
72: FactArray fa = new FactArray();
73: Fact f;
74:
75: /***********************/
The Type FactArray is one of my classes in a package com.mypackage.fact.FactArray which exists in myjar.jar. myjar.jar is a separate Java project (using NetBeans, but I don't think that's relevant).
I include the package in my JSP as follows:
<%@ page import="com.mypackage.fact.*" %>
I deploy my web site and JSPs into Tomcat 6 as a WAR file. I include myjar.jar in that WAR in WEB-INF/lib but that doesn't work. I tried putting myjar.jar in my tomcat/lib folder, but that doesn't work either.
I have bounced the server several times between changes. I have read a whole bunch of questions on here which say "put it in WEB-INF/lib" but that isn't working, so I'm asking my own question.
Where do I need to put common JAR files so they get picked up by Tomcat?