Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Jboss Hot deployment
We have a EJB project that contains about 10 EJBs that are common to
most of our web and client applications. As the EJB are generic, so to
speak, this is packaged and deployed as the only thing in the ear
file. Everything works fine except for when we need to change any of
these EJBs and redeploy. When we redeploy, everything appears to
redeploy properly but the webapps then start generating class cast
exceptions and the only way to fix it is to restart jboss or redploy
every app that uses the ejbs. This happens on our single jboss server
and the 10 clustered machines we have (running jboss4.0.1sp1 on gentoo
with one the machines set-up as loadbalancer using mod_jk and apache).

Is this expected behaviour?
What is standard practice for this sort of common code. I am at a loss
as to how we can deploy to a live enviroment without any impact on the
users and client applications. I thought that this is what hot
deployment is all about but it doesn't seem to work.

BTW all the EJBs are stateless session beans that just provide glue
between web apps/clients and the Business Classes (using Data Factory
pattern).

I have asked the same question on the jboss forums but no one is
replying.  This may be a implementation issue.
I am not sure if the way in which I have designed the applications are
the correct j2ee way but I can find no pattern for common business
objects and ejbs.  I need to have one location with this code in that
can be referenced across various web and client apps, which is why I
chose ejbs as I thought this is what they are designed for!

Report this thread to moderator Post Follow-up to this message
Old Post
Jason Price
04-01-05 01:57 PM


Re: Jboss Hot deployment
Jason Price wrote:
>
> Is this expected behaviour?
>
> BTW all the EJBs are stateless session beans that just provide glue
> between web apps/clients and the Business Classes (using Data Factory
> pattern).
>

Just 2 questions from me:
1. what was changed before redeployment ?
Only the implementation code of the SLSB or did the interface
classes (Remote-/Local- Home and Object) change ?
2. where are those interface classes put in ?
In the ejb ear-file or in web- and client-apps ?

Report this thread to moderator Post Follow-up to this message
Old Post
Frank Langelage
04-01-05 01:57 PM


Re: Jboss Hot deployment
Jason Price wrote:

> these EJBs and redeploy. When we redeploy, everything appears to
> redeploy properly but the webapps then start generating class cast
> exceptions and the only way to fix it is to restart jboss or redploy
> every app that uses the ejbs. This happens on our single jboss server

Did you properly serialize the necessary classes (included the generated
ones that derive from Serializable)???

--
Ruurd
.o.
..o
ooo

Report this thread to moderator Post Follow-up to this message
Old Post
R.F. Pels
04-01-05 08:58 PM


Re: Jboss Hot deployment
Jason Price <FunkyHippy@gmail.com> wrote:
> file. Everything works fine except for when we need to change any of
> these EJBs and redeploy. When we redeploy, everything appears to
> redeploy properly but the webapps then start generating class cast
> exceptions and the only way to fix it is to restart jboss or redploy
> every app that uses the ejbs. This happens on our single jboss server

It's most likely JBoss' Unified Class Loader causing you troubles.  I've
been most successful disabling the UCL in Tomcat, so it doesn't
interfere with Tomcat's standard classloading.

Relative to your deploy directory, edit your
jbossweb-tomcat50.sar/META-INF/jboss-service.xml, change:
<attribute name="UseJBossWebLoader">true</attribute>
to:
<attribute name="UseJBossWebLoader">false</attribute>

After a restart then, you should be able to redeploy without getting
ClassCastExceptions.

The UCL tries to flatten the whole classloading hierarchy to make it
simpler for beginners (EJB interfaces deployed in ejb jar files will
magically be visible to the web components, without having to actually
be deployed in the war).  This causes confusion then when the EJB
interfaces are redeployed.

You can take further steps to properly isolate each EJB component from
others, by specifying custom UCL domains or something, but I've not
found that necessary yet.  Just getting Tomcat to ignore the UCL has
made things works as I'd expect.

Good luck.
--
John M Flinchbaugh
john@hjsoft.com

Report this thread to moderator Post Follow-up to this message
Old Post
John M Flinchbaugh
04-06-05 05:17 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Java Beans archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:00 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.