Looks like its classloders issue.
com.my.job interface is loaded by one classloader and e2 by another.
What could be solution for this ??
But when I move this interface out of ear and put it in server\all\lib , lookup is sucessful but isAssugableFrom fails !
Why do you want to move your interface to the server\all\lib?
Also, read through these classloader related documents:
I want to move this interface out of ear as this Interface is actually stub of e2 and will be provided by other module. I am aware of its JNDI details so that I can perform a lookup. It cant be bundled along with my ear.
e2 module owner will place it in server\all\lib directory.
Since lookup is sucessful , its able to find e2 , but as these are loaded by different classloader , isAssignableFrom (algorithm) is failing.
Have solved the problem.
Actually job.class was out in server\all\lib and also in e1 EAR.
So when I was checking for isAssignableFrom , the class versions were different as classloaders were different and isolation ear was enabled using jboss_app.xml.
I removed job.class from e1 ear and now have just one copy in lib and no other module will have it.
isAssignableFrom is returning correct value.