Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / JavaBeans / November 2003

Tip: Looking for answers? Try searching our database.

[JBoss+XDoclet] Redeployment + getLocalHome -> Bad idea

Thread view: 
Martin Kersten - 22 Nov 2003 14:20 GMT
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.