Hi ,
I know that it is not the right place to ask this question but I'm sure you've got the
solution.
I'd like to know if it is possible to load a class that is already loaded or to remove
from the classloader a loaded class ?
Indeed, I've got 3 classes with the same name and prototypes
anonymous wrote : However, I cannot understand why you got LinkageError when you
| loaded c.Bat. Is c a package name? If yes, c.Bat is a different class
| from a.Bat and b.Bat. I suppose that your program (a.Bat or b.Bat)
| accidentally had been linked with an older version of c.Bat.
|
javassist.NotFoundException;
|
| /**
| * @author Batoussa Mougamadou
| */
| public class MyClassLoader extends ClassLoader {
|
| private final ClassPool originalPool = ClassPool.getDefault();
|
|
| public String getPackage() {
| try
Well done Mr Chiba ! It works ... except for the classpath of course, but it doesn't
matter in my app, I can manage it.
View the original post :
http://www.jboss.org/index.html?module=bbop=viewtopicp=3843388#3843388
Reply to the post :
I've tested the solution proposed by budevik, abd it works ... so use reflection to
call ClassLoader class.
Regards
Batoussa
View the original post :
http://www.jboss.org/index.html?module=bbop=viewtopicp=3842917#3842917
Reply to the post :
http://www.jboss.org/index.html?module=bbop
anonymous wrote : yes it works, but use your code inside web-app and deploy it in
container... btw, could you share this code?
Yeah, you're right, the problem comes from Javassist wich cannot found the right class
in his pool.
Have anyone got any tips in how using javassist in web application ?
Have a look here
http://www.jboss.org/index.html?module=bbop=viewtopict=47263postdays=0postorder=ascstart=10
View the original post :
http://www.jboss.org/index.html?module=bbop=viewtopicp=3842935#3842935
Reply to the post :
Hi !
I'd like to do the same thing, i.e cast a modified class at runtime but i get a
ClassCastException too.
I understood that this is in java virtual machine specification that when a class is
loaded by two classloaders, it can not be cast.
So, is there any solution (even if it's forbidden by