Re: Classloading issue

sebb <[email protected]> Fri, 23 Sep 2011 12:46:35 +0100
Newsgroups gmane.comp.jakarta.cactus.devel
Message-ID <CAOGo0VbK1hE8vcUN+Fbd1_==Vnv6SD-ztuerBa_cc=rCt3W5-Q@mail.gmail.com>
On 20 September 2011 23:04, Philippe Mouawad <[email protected]> wrote:
> Hello,
> I am implementing a specific RequestView for a particular kind of requests.
> I package my JAR and put it in lib/ext.
> I run JMeter but my RequestView is not found.
> I debugged RequestPanel constructor:
>
> try {
>           classesToAdd =
> JMeterUtils.findClassesThatExtend(RequestView.class);
>       } catch (IOException e1) {
>           // ignored
>       }
>
> This finds my class.
> But this code:
> final RequestView requestView =
>     (RequestView)   Class.forName(clazz).newInstance();
>
> Fails with ClassNotFoundException.
>
> To workaround I changed this to :
> final RequestView requestView = (RequestView)
> Thread.currentThread().getContextClassLoader().loadClass(clazz).newInstance();
> and it worked.
>
> Is there something wrong in my approach or should I submit a patch ?
> This issue also occurs on 2.5

Just for completeness - this has been fixed, it was an issue with
Eclipse configuration, not JMeter.

> I opened issue 51854.
> Thank you
> Regards
> Philippe Mouawad
>
>
> --
> Cordialement.
> Philippe Mouawad.
> Ubik-Ingénierie
>
>
>
>
>
>
> --
> Cordialement.
> Philippe Mouawad.
> Ubik-Ingénierie
>