• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Reflection Problem - I feel like a Vampire... No reflection found...

 
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hoping that someone may be able to help me make sense out of this. I'm doing some basic reflective calls that keep failing on the method.invoke().

Servlet call:


which calls:


which fails on the invoke:


here's the error message:


It had worked before... I'm not quite sure what I've done wrong.

TIA
[ March 19, 2007: Message edited by: graham king ]
 
Ranch Hand
Posts: 387
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi Graham,

can you post (some of) the code of the method(s) from AutoCompleteDel that you want to call?

Herman
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Servlet containers are tricky places: there is more than one ClassLoader in use, and seemingly weird things happen if the same class gets loaded by two different ClassLoaders. It's possible that this is what's happened here.

You might try logging the result of "method.getDeclaringClass().getClassLoader() == obj.getClass().getClassLoader()". You'd like this to be true. If it's false, then that explains your problem.
 
graham king
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, Earnest. Thought I was loosing my head. I rewrote the servlet call to work directly with the MirrorMaker class and found that I did indeed have a class loading issue, mainly a lingering .jar file in my WEB-INF/lib dir. I haven't put it back to how it was yet, I'll try it later, but, by removing it from the lib things are doing ok.

Thanks again.
 
You're not going crazy. You're going sane in a crazy word. Find comfort in this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic