tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Lynn Rice" <dr...@dmotorworks.com>
Subject getting error message "Cannot create bean of class beanProperties"
Date Mon, 24 Jul 2000 22:55:25 GMT
########## Environment
Tomcat: 3.1 SunJDK: 1.2.2 Linux

I am trying to implement an interface that contains some global strings in a
very simple interface:

public interface Properties {
	public static final String FOO_INFORMATION = "Information";
}

I use this interface to give static String properties to several classes and
servlets, but I also need to be able to get to these Properties from a jsp.
And, in order to use it in a jsp, I implement a dummy class like this (it is
in WEB-INF classes):

public class beanProperties implements Properties { }

This way I can instantiate the beanProperties object and access these
strings using something like this:

<jsp:useBean id="prop" scope="page" class="beanProperties" />

and

<%= prop.FOO_INFORMATION %>



########## Problem

If I recompile ANY classes, then I get a ServletException that says "Cannot
create bean of class beanProperties"

It looks like the Jasper engine generates the following piece of code:
	try {
		prop = (beanProperties) Beans.instantiate(getClassLoader(),
"beanProperties");
	} catch (Exception exc) {
		throw new ServletException (" Cannot create bean of class
"+"beanProperties\n");
	}

and according to the API instantiate can either return a IOException or a
ClassNotFoundException, but I can't tell what type of exception is being
thrown.

Basically, I cannot figure out why this is happening, but it is preventing
me from using the Class reloading feature because I end up restarting tomcat
everytime I recompile anything.

~David


Mime
View raw message