Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
graham king
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • 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 ]
 
Herman Schelti
Ranch Hand
Posts: 387
  • Mark post as helpful
  • send pies
  • 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
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic