We could also enhance JMeter to read classpath info from a config file. -Mike
On 23 Sep 2003 at 16:24, peter lin wrote: > > one of the many reason lots of java stuff override the system classpath is people may have different version of xerces/xalan which are not compatible. Therefore, lots of people ignore the system classpath and force users to use the default directory, or write custom classloaders. > > the way to load your own classes in the sampler is this: > > 1. create a custom classloader that extends URL classloader > 2. read the necessary paths/jars from a config file. > 3. before your sampler creates any objects, instantiate an instance of your classloader > 4. use your classloader to look it up and then use it to create a new instance > 5. do your normal sampler process > > > I hope that helps. If you want an example of how to extend URLClassloader, look at the standardLoader in tomcat. > > > > > peter > > Clifton Craig <[EMAIL PROTECTED]> wrote: > Thank you Peter, > > However, my code is calling code that I have no control over. This code uses > the System classpath to locate resources. I set the system classpath prior > to invoking JMeter but it appears that JMeter is altering the system > classpath upon execution. Please, I'm a beginner with class loaders and > such. Could someone help me with a good solution? > > Clifton C. Craig > Intelligent Computer Systems > A division of Global Beverage Group > [EMAIL PROTECTED] > (717) 295-7977 > ----- Original Message ----- > From: "peter lin" > To: "JMeter Users List" > Sent: Monday, September 22, 2003 9:01 PM > Subject: Re: CLASSPATH woes with Java Request Sampler > > > > > > if you wrote your own sampler, the cleanest way is to write a custom > classloader that extends URLClassLoader. then use your classloader to load > those resources. > > > > this should give you the control needed. hope that helps. > > > > > > peter > > > > > > Clifton Craig wrote: > > Hello all: > > > > I've created a Java Request Sampler that I intend to use to test my EJB > app. > > However it is necessary that my Java request sampler have some additional > > entries in the CLASSPATH. These entries include classes which are in > > development along with some EJB server specific stuff. According to the > > JMeter docs it appears that I need to have any additional resources jarred > > and stored in the lib/ext folder. This approach is impractical to my > > scenario. I've experimented with using Class-Path headers in the jar > > manifest for my Java Request sampler but they seemed to not work. Are > there > > any other workarounds. I looked briefly at the NewDriver.java file in > > JMeter's core jar file and it seems as though it is filtering all entries > > from the CLASSPATH that do not end with ".jar". I need help. How can I get > > my Java Requester to see the rest of my app without jarring everything up? > > > > Clifton C. Craig > > Intelligent Computer Systems > > A division of Global Beverage Group > > [EMAIL PROTECTED] > > (717) 295-7977 > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: jmeter-user- [EMAIL PROTECTED] > > For additional commands, e-mail: jmeter-user- [EMAIL PROTECTED] > > > > > > --------------------------------- > > Do you Yahoo!? > > Yahoo! SiteBuilder - Free, easy-to-use web site design software > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: jmeter-user- [EMAIL PROTECTED] > For additional commands, e-mail: jmeter-user- [EMAIL PROTECTED] > > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software -- Michael Stover [EMAIL PROTECTED] Yahoo IM: mstover_ya ICQ: 152975688 AIM: mstover777 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

