You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Mete Kural <me...@touchtonecorp.com> on 2003/05/09 10:58:28 UTC

How do Tomcat classloaders work??

Hello all, 

I implemented the UserDatabase interface included in catalina.jar and put my implementation in server/classes directory. Since my webapp classloader needs access to this UserDatabase class, I had to set the privileged attribute of the Context element for this webapp in server.xml to "true". It worked fine on my Windows development PC. Then I tested this on our Linux development server and I get a NoClassDefFoundError when I try to create an instance of the UserDatabase class, although the webapp has the privileged attribute set to "true". I'm wondering why this works on my Windows desktop but not on the Linux server. The webapp on both machines are exactly the same. I also made sure that I copied my UserDatabase implementation into the server/classes directory of the Linux server. Both are Tomcat 4.1.24. Both use JDK 1.4.1. There are only two differences in the two environments that I can recognize. One is the operating system difference, henceforth the difference in the versions of the JVM, one for Windows, one for Linux. And the other difference is a slight difference in the Context element of this webapp. On the Windows machine, it's like this: 

<Context path="" docBase="C:\Documents and Settings\MeteK\My Documents\Projects\sofn" debug="0" privileged="true"> 

On the Linux server it's like this: 

<Context path="sofn" docBase="/usr/metek/tomcat/webapps/sofn" debug="0" privileged="true"> 

And here's the NoClassDefFoundError (root cause) that I get when I access the webapp via the browser: 

java.lang.NoClassDefFoundError: org/sofn/portal/wintouch/WintouchAccess 
at org.sofn.portal.util.ResourcesPlugIn.init(ResourcesPlugIn.java:49) 
at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:1156) 
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:472) 

Do you have any ideas why this could be occurring? Why would there be different behaviour between classloaders in Windows and in Linux? 

Thanks, 
Mete 


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


"XXX unknowon type 0" message in catalina output

Posted by Juan Dellarroquelle <ra...@usa.net>.
Hello I'm using Apache 2.0.44 binary distribution for W2K,
mod_jk2 and Tomcat 4.1.24.

I have the following Filter that I get from an earlier message
from this list, that I'm using hoping it will make IE6 to cache
my POSTed form data and let the user use its browser's
back button:

/**
* <p>Title: </p>
* <p>Description: Reset cache-control headers set by Tomcat.
* These headers are set by newer Tomcat versions in the case
* the request is for a protected URL. We consider this a bug
* in Tomcat. If we do not reset these headers nothing will be
* cached, so the back-button will not work properly, and also
* in the 'open/save'-dialog, open will not work.</p>
* @author Dennis van den Berg
* @version 1.0
*/
public class CacheControlFilter implements Filter
{
 FilterConfig filterConfig = null;

 public void init(FilterConfig filterConfig) throws ServletException
 {
  this.filterConfig = filterConfig;
 }

 public void doFilter(ServletRequest request, ServletResponse response,
   FilterChain chain) throws IOException, ServletException
 {
  /** reset headers set by new Tomcat Connector to enable caching */
  if (request instanceof HttpServletRequest)
  {
   HttpServletResponse httpResponse = (HttpServletResponse)response;
   httpResponse.setHeader("Pragma",null);
   httpResponse.setHeader("Cache-Control",null);
  }
  chain.doFilter(request, response);
 }

 public void destroy()
 {
  filterConfig = null;
 }

}

And I have set it up in my web.xml file as follows:

 <filter>
  <filter-name>CacheControl</filter-name>
  <filter-class>CacheControlFilter</filter-class>
 </filter>
 
 <filter-mapping>
  <filter-name>CacheControl</filter-name>
  <url-pattern>/myservlet</url-pattern>
 </filter-mapping>

Now, when I access the Servlet through Apache/mod_jk2,
I get the following message in the catalina output:
XXX unknowon type 0

But if I access the Servlet directly to Tomcat (using port 8080),
I doesn't show the messages.

Any idea of who might be writing that message in the output?

Note: the message SAYS "unknowon", not unknown

Thanks,
Juan.

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org