Apologies if you're also on SERVLET-INTEREST -- I inadvertantly sent this
message there first.  It's not so much a cross-post as a miss post.  Feel
free to flame me for idiocy.
===

I'm probably missing something very obvious here, but it's got me flummoxed
right now.  I'm running Tomcat 4.01, JDK 1.3.1_01, and I'm having trouble
with exceptions when trying to read Bean properties:

2001-12-06 09:52:24 StandardWrapperValve[jsp]: Servlet.service() for servlet
jsp threw exception
org.apache.jasper.JasperException: Cannot find a method to read property
'carYear' in a bean of type 'QuoteCalculationBean'

I've been having this problem in an intermittent fashion within this
particular Bean (not seen it in others => almost certainly my fault!) on
various different properties.  There are appropriate get/set methods for the
properties it can't find.  In the case of carYear they are:
int getCarYear();
void setCarYear(int v);
void setCarYear(String v);
The problem always occurs for a given property (i.e. it is intermittent in
which properties it affects, not in when it gets called -- if a property
fails, it always fails.  However, the failing properties change sometimes
when the Bean is changed.  Perhaps intermittent is the wrong word.)


The Bean has a no-args constructor (I would post the code to the Bean, but
it's a bit sizable).  Some of the properties work correctly, and the version
of the Bean it is using is definitely up-to-date (I've stopped Tomcat,
erased everything under the work/myapp tree and everything under
webapps/myapp, and then redeployed a new version and restarted Tomcat).  On
the instance of Tomcat I execute locally, on a Win2k box, it has no problem
with property carYear, but does have trouble with other properties.  On the
instance of Tomcat on the "main" server, a Win NT box, it fails on carYear
but succeeds on other properties (both are running exactly the same version
of Tomcat/JDK and have identical copies of the webapp/myapp folder).  In
both cases I can successfully read the properties of the Bean using <%=%>
tags (e.g. <%= mybean.getCarYear() %> returns the right value with no
problems).  Thus, the problem would appear to lie with the introspection
mechanism, of which I know (very) little.

Anybody have any ideas?

--Chris Tucker

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to