Hi newsgroup,
I am using JBoss 3.2.2 + MySQL + MyEclipseIDE.
I am facing the following problem:
Having a local bean MyBeanLocal and also having
MyBeanLocalHome I fail to lookup for it after I
redeployed the bean using hot deployment (
or better redeploy without restarting the server).
Code:
public void setUp() throws Exception {
InitialContext context=new InitialContext();
LanguageLocalHome home=
(LanguageLocalHome)
context.lookup(LanguageLocalHome.JNDI_NAME);
}
This code is part of the cactus JUnit test cases. It rans in the same
container. It works well if the server starts and the bean was
deployed for the first time. But after redeploying the bean
(by redeploying the ear containing the bean) the code throws
a ClassCastException on the class cast after performing the lookup.
Q1: Why does the exception occur after redeployment of the bean
took place?
Q2: Any solution known to the problem? It is annoying to restart
the server anytime you need to redeploy it.
Thanks,
Martin Kersten
Martin Kersten - 22 Nov 2003 22:24 GMT
I have found the solution:
Reason:
The test cases are loaded using the static class loader of jboss and not
the dynamic one. This indicates that the cactus related stuff must also be
loaded by the dynamic class loader.
Solution:
Remove all cactus related libraries from servername/lib (shared library
directory) and add the required libraries to your ear directly (I put 'em
all in the web/WEB-INF/lib directory).
Now it seams to work,
Martin Kersten
> Hi newsgroup,
>
[quoted text clipped - 30 lines]
>
> Martin Kersten