Title: RE: [JBoss-user] Multiple EARs / Classloading / Singletons

Thanks very much, the jboss-app.xml solution worked a treat.

Graham


-----Original Message-----
From: David Jencks [mailto:[EMAIL PROTECTED]]
Sent: 21 June 2002 13:47
To: [EMAIL PROTECTED]
Subject: Re: [JBoss-user] Multiple EARs / Classloading / Singletons


The default setup for jboss 3 is to have one server-wide dynamically
updatable classloader.  This enables you to for instance have a very large
app deployed in many ears yet still be able to redeploy the ears one at a
time.

In 3.0, (but not yet 3.1), you can specify a separate classloader
(repository) for each ear by including a jboss-app.xml file next to your
application.xml file, like this:

<jboss-app>
   <loader-repository>jboss.test.cts:loader=cts-cmp2v2.ear</loader-repository>
</jboss-app>


where you supply a different object name for each package.  In jboss 3.0.1
cvs, you can have several ears with the same loader-repository; I think in
3.0 if you use this feature you can only have one ear in each repository.

It might not work for you here, but you might consider using an mbean
rather than a singleton, thus completely sidestepping the classloader issue
(as long as the classes are truly identical in both apps).  If you try this
out you will want to load only one copy of each class, so one app will be
"configuration only"

david jencks



On 2002.06.21 07:10:46 -0400 Graham French wrote:
> Hi,
> I'm relatively new to Jboss 3 so I may have missed something here.....
>
> I have two EARs deployed in the same instance of JBoss3.0.0. The code
> libraries/EJB's are identical, the EJB's are identified by different JNDI
> namespaces. Inside each EAR there are identical library jars that are
> specified on the manifest class paths of the EJB jars contained within
> each
> EAR
>
> Each application EAR has a singleton class that is configured differently
> for each EAR and all the EJBS in each EAR have access to this singleton.
>
> However it seems that when the applications are run, there appears to be
> only one singleton instance per JVM rather than one singleton per EAR and
> hence both EARs 'use' the singleton that happens to be instantiated
> first.
>
> What is going on here? I was under the impression that EARs are supposed
> to
> have their own private class loader. Does this mean I have to run each
> application in a separate Jboss on a separate JVM? Or do I have to start
> writing my own classloader which I don't really want to do.
>
> Using Weblogic 6.1, which we are trying to migrate from, each EAR has its
> own singleton instance and everything works fine.
>
>
> Any suggestions would be gratefully accepted.
>
> Thanks
> Graham
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
> <HTML>
> <HEAD>
> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
> <META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2653.12">
> <TITLE>Multiple EARs / Classloading / Singletons</TITLE>
> </HEAD>
> <BODY>
>
> <P><FONT SIZE=2>Hi,</FONT>
> <BR><FONT SIZE=2>I'm relatively new to Jboss 3 so I may have missed
> something here.....</FONT>
> </P>
>
> <P><FONT SIZE=2>I have two EARs deployed in the same instance of
> JBoss3.0.0. The code libraries/EJB's are identical, the EJB's are
> identified by different JNDI namespaces. Inside each EAR there are
> identical library jars that are specified on the manifest class paths of
> the EJB jars contained within each EAR</FONT></P>
>
> <P><FONT SIZE=2>Each application EAR has a singleton class that is
> configured differently for each EAR and all the EJBS in each EAR have
> access to this singleton.</FONT></P>
>
> <P><FONT SIZE=2>However it seems that when the applications are run,
> there appears to be only one singleton instance per JVM rather than one
> singleton per EAR and hence both EARs 'use' the singleton that happens to
> be instantiated first.</FONT></P>
>
> <P><FONT SIZE=2>What is going on here? I was under the impression that
> EARs are supposed to have their own private class loader. Does this mean
> I have to run each application in a separate Jboss on a separate JVM? Or
> do I have to start writing my own classloader which I don't really want
> to do. </FONT></P>
>
> <P><FONT SIZE=2>Using Weblogic 6.1, which we are trying to migrate from,
> each EAR has its own singleton instance and everything works
> fine.</FONT></P>
> <BR>
>
> <P><FONT SIZE=2>Any suggestions would be gratefully accepted.</FONT>
> </P>
>
> <P><FONT SIZE=2>Thanks</FONT>
> <BR><FONT SIZE=2>Graham</FONT>
> </P>
>
> </BODY>
> </HTML>
>


-------------------------------------------------------
Sponsored by:
ThinkGeek at http://www.ThinkGeek.com/
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to