"maeste" wrote : Hi Jason,
| The problem is on finding class in library's jars after an hot deployment. It
doesn't work and we get a ClassNotFoundException (not always the same calss) when we
invoke the endpoint operation.
|
You mention that the invocation fails. Does the service class actually load successfully?
Are you caching object references?
Is this code running in container? Are you hot deploying the client code? If so, the
output folder will cease to exist after a hot deploy. The reason is that when you deploy
your app its extracted in a tmp directory. Any relative file writes go there. When you
redeploy a new directory is created, and thus the classes would be gone. If this is the
case then you either need to regenerate them per redeploy, or store them in some absolute
path name.
anonymous wrote :
|
| Our class loading related code is:
|
| | classLoader = new URLClassLoader(new URL[]{outputDir.toURL()},
Thread.currentThread().getContextClassLoader());
| | URLClassLoader classLoader = new URLClassLoader(new URL[]{outputDir.toURL()},
Thread.currentThread().getContextClassLoader());
| | Thread.currentThread().setContextClassLoader(classLoader);
| |
| | serviceClass = JavaUtils.loadJavaType("it.javalinux.ws." + className
, classLoader);
| | service = serviceClass.newInstance();
| |
|
Be careful when replacing the context loader when running in a container. If you do this
you should restore the original thread context loader.
-Jason
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4021281#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...