> I ran into this issue and thought it was a classpath problem, but after
> reading the JSP spec, discovered that you have to use the fully qualified
> classname for beans.  You might want to take a look in the 1.1 spec under
> the section for <jsp:useBean>.

That shouldn't be the issue at all.  In my JSP page, I use a fully qualified
name to create that JSP bean.  But that bean then may call on other Java
classes, such as a class that does JDBC or JMS calls.  What I seem to be
experiencing is that those other classes don't have access to the same
classpath for finding what they are looking for.  I put the database and JMS
jar files in the WEB-INF/lib folder, but they still could not find the
drivers stored in them.  But when I modified the CLASSPATH just before
starting Tomcat to include those same JAR files (pointing to the same
WEB-INF/lib files), then it seemed to work fine.

JSP -> usebean: com.myeastside.jsp.User -> calls method in
com.myeastside.jdbc.UserManager -> calls method in
com.myeastside.jdbc.ConnectionPool -> calls method Class.forName() to load
the Postgresql driver.  But it could not find the driver, even those the
postgresql.jar file is in the WEB-INF/lib directory.  But when I add to the
tomcat classpath, then it works.

To be honest, I don't really understand how any of that works.  Somehow
Jasper creates a classpath for its own use to resolve classes it loads as it
processes JSP pages.  But it seems that the classes those beans use don't
necessarily use the same classloader/classpath.  Is that possible?  I
thought a class would always use the same classloader/classpath as it used
to bring in classes it references.

David


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to