Re: Classloading issue

2011-09-23 Thread sebb
On 20 September 2011 23:04, Philippe Mouawad philippe.moua...@gmail.com 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


-
To unsubscribe, e-mail: dev-unsubscr...@jakarta.apache.org
For additional commands, e-mail: dev-h...@jakarta.apache.org



Re: Classloading issue

2011-09-23 Thread Philippe Mouawad
Hello,
I added a note to:

   - https://issues.apache.org/bugzilla/show_bug.cgi?id=51854

Regards
Philippe

On Fri, Sep 23, 2011 at 1:46 PM, sebb seb...@gmail.com wrote:

 On 20 September 2011 23:04, Philippe Mouawad philippe.moua...@gmail.com
 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
 

 -
 To unsubscribe, e-mail: dev-unsubscr...@jakarta.apache.org
 For additional commands, e-mail: dev-h...@jakarta.apache.org




-- 
Cordialement.
Philippe Mouawad.
Ubik-Ingénierie