I should have mentioned that I've previously tried explicitly getting the
classLoader and loading the class using ClassLoader methods which did not
work.
I have the following setup -
WEB-INF/lib/struts.jar, WEB-INF/lib/xerces.jar
WEB-INF/classes/com/netnumina\tech\cart\struts\CategoryListAction.class,
CategoryForm.class
I did try what you suggest below - and it still does not work. The class
loader is a JRunServletLoader and it doesn't work in only one odd case. It
is capable of loading my servlet and other classes out of the struts.jar
file. It also loaded the CategoryForm.class, but CategoryListAction
inherits from org/apache/struts/action/Action.class (which is in the
struts.jar file) and when I try to load CategoryListAction I get class not
found for Action.class. If I try and load the Action class manually
immediately before trying to load CategoryListAction I am able to load the
Action class, but CategoryListAction still doesn't find it. Seems like it
probably has something to do with the fact that it's a super class, but I
can't figure out why if I load it right before trying to load it again that
it doesn't work.
Cheers
>>>>>>>>>>>>>>>>>>>>>>>>>
When using Class.forName with just the name of the class that you want to
load, you will be using the primordial ClassLoader which only knows about
the system classpath. What you probably want to do is use one of the
overloaded Class.forName methods that allows you to supply the ClassLoader
to use:
Object o = Class.forName("ClassName", true,
getClass().getClassLoader()).newInstance()
This will supply the ClassLoader of the current object (your servlet) to be
used to resolve the class.
Hope this helps,
Karl.
-----Original Message-----
From: Jay Walters [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 12, 2000 1:32 PM
To: JRun-Talk
Subject: Classpath for war file
I am having some problems loading classes from the <appname>/WEB-INF/classes
and <appname>/WEB-INF/lib directories. From the log files these are on my
classpath, but when trying to load classes using Class.forName() for example
I can't find the classes unless they are in servers/<servername>/lib. Any
ideas on this? I'm running JRun 3.0 on Windows 2K.
Cheers
----------------------------------------------------------------------------
--
Archives: http://www.egroups.com/group/jrun-interest/
Unsubscribe:
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/jrun_talk
or send a message to [EMAIL PROTECTED] with 'unsubscribe'
in the body.
------------------------------------------------------------------------------
Archives: http://www.egroups.com/group/jrun-interest/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/jrun_talk
or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the
body.