Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / December 2005

Tip: Looking for answers? Try searching our database.

(jsp) class loader not finding generated JSP class

Thread view: 
unixfreak0037@gmail.com - 13 Dec 2005 21:27 GMT
I hope my subject line is close enough.  Assume a JSP file that calls a
static function "A" on some class.  "A" then goes down the stack
looking for what class called it.  It then tries to get a Class object
for that class with forName.

It works when the function is called from a class I create outside of
the JSP.  But when called from inside a JSP scriptlet, the className it
finds on the stack is one (I assume is) genated by the compile from JSP
into a Java class file, and it does not find that one.  I get the
ClassNotFound exception.

So I guess that means the class loader can't find it, so I would then
guess that there is more than one class loader and I'm not using the
right one in a call to forName.  Am I on the right track here?

I'm using Tomcat 5.5.7.

john
Andrea Desole - 14 Dec 2005 09:35 GMT
> I hope my subject line is close enough.  Assume a JSP file that calls a
> static function "A" on some class.  "A" then goes down the stack
[quoted text clipped - 10 lines]
> guess that there is more than one class loader and I'm not using the
> right one in a call to forName.  Am I on the right track here?

Probably. You can check it by looking at the class loader and its
parents, finding out where they look for classes. You should also be
able to debug the generated jsp, to see what class loader is used there.
How to solve the problem, I don't know. What you are trying to do is
very strange, and it's probably related to the specific
implementation/configuration of the server. Maybe you can add the needed
jars/directories to the classpath. I don't know what your goal is, but I
personally would think of a different solution.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.