tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From estu...@eas.san-jose.ca.us
Subject Re: Servlet bug??
Date Tue, 24 Apr 2001 16:40:05 GMT
On 24 Apr, Larry Isaacs wrote:
> Hi,
> 
> Normally you should post questions like this to
> tomcat-user@jakarata.apache.org.
> 
> As for the problem, in your Servlet you can override init() or
> init(ServletConfig config).  If you override init(ServletConfig config),
> you must call "super.init(config)" in your method.  If you don't,
> I think you will encounter a symptom like what you are seeing.
> 
> Hope this helps,
> Larry

I think I am trying to report a bug.  I modified my init() code per
your suggestion. It now looks like this.

51    public void init(ServletConfig config) throws ServletException {
52	super.init(config);
53	props = new Properties(System.getProperties());
54	for (Enumeration e = config.getInitParameterNames(); e.hasMoreElements();) {
55	    String p = (String)e.nextElement();
56	    props.setProperty(p, config.getInitParameter(p));
57	}
58 	try {
59 	    InputStream is = config.getServletContext().getResourceAsStream("/WEB-INF/easMail.Properties");
60 	    props.load(is);
61 	}
62 	catch (Exception ex) {
63	    throw  new ServletException( "easMail Initialization problem: " + ex.getMessage());
64 	}

Here is the result:

A Servlet Exception Has Occurred

javax.servlet.ServletException: easMail Initialization problem: null
	at easMail.EasMailServlet.init(EasMailServlet.java:63)
	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:802)
	at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:583)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:231)




Mime
View raw message