Alex,

Are the class files from the supporting JARs loaded dynamically? Are
they loaded using Class.forName()? I've seen instances where this
doesn't work under JBoss. I guess this is due to the vaguaries of
the J2EE spec with regard to ClassLoaders.

Try:

 
Thread.currentThread().getContextClassLoader().loadClass(<name>).newInstance
();

(Although there's an argument which says keeping the supporting JARs
in the EAR file is the best place for them...)

Rgds,

Dan.

-- 
Danny Yates
 


-----Original Message-----
From: Alex Hornby [mailto:[EMAIL PROTECTED] 
Sent: 24 June 2003 10:12
To: jboss-user
Cc: [EMAIL PROTECTED]
Subject: Re: [JBoss-user] MBean deployment ignores <depends> tag


Hi David,

Just to say thanks for the suggestions. Packaging the ejb jar and
-service.xml into a .EAR worked well.

The one extra thing I had to do was package some support jars into the
EAR as well instead of installing them in deploy/../lib, otherwise I got
class not found errors.

Cheers,
Alex.

On Wed, 2003-06-18 at 18:36, Alex Hornby wrote:
> 
> Hi David,
> 
> After reading your and Scotts replies I've packaged the mbean classes
> and -service.xml into a .sar to try to get the classes loaded.
> 
> I have a problem that both my mbean .sar and my ejb .jar both need to
> use the EJB interfaces, so I've packaged the interfaces into both the
> .sar and the ejb .jar.
> 
> This cause problems with duplicate class errors like below. 
> 
> There is obviously a better way to do this - do I need to create a
> separare interfaces .jar? If so where would I deploy it to?
> 
> TIA,
> Alex.
> 
> 18:27:36,126 WARN  [ClassLoadingTask] Duplicate class found:
> com.anvil.ate.marke
> t.interfaces.OrderBookData
> Current CS:
> (file:/home/alex/output/i686-pc-linux-gnu/ate-head/release/support/j
>
boss/default/tmp/deploy/home/alex/output/i686-pc-linux-gnu/ate-head/release/
supp
> ort/jboss/default/deploy/ejb-anvil-market.jar/31.ejb-anvil-market.jar
> <no certif
> icates>)
> Duplicate CS:
> (file:/home/alex/output/i686-pc-linux-gnu/ate-head/release/support
>
/jboss/default/tmp/deploy/home/alex/output/i686-pc-linux-gnu/ate-head/releas
e/su
> pport/jboss/default/deploy/anvil-market.sar/12.anvil-market.sar <no
> certificates
> >)
> 
> 
> On Tue, 2003-06-17 at 22:07, David Jencks wrote:
> > To expand a little on Scott's answer,
> > 
> > In jb 3.2 and earlier, you have to have the mbean's class available
before
> > you try to deploy the mbean.  When you deploy the mbean, it is created
and
> > the attributes are set.  Then the dependency stuff starts, so create and
> > start are not called until the needed mbeans are created and started.
> > 
> > In jb4, if you try to deploy an mbean before its class is deployed, it
will
> > wait and deploy when the class becomes available (and undeploy when the
> > class is removed).  Also IIRC, there is a *-service.xml top level
depends
> > tag that you can use to depend on other mbeans, to make the
*-service.xml
> > wait for the DeploymentInfo mbean for the needed jar file.  (Also IIRC,
the
> > DeploymentInfo is an mbean only in jb4)
> > 
> > david jencks
> > /**********************************
> > * David Jencks
> > * Partner
> > * Core Developers Network
> > * http://www.coredevelopers.net
> > **********************************/
> > 
> > On 2003.06.09 09:37 Alex Hornby wrote:
> > > On Mon, 2003-06-09 at 14:25, Nicholas wrote:
> > > > Can you send them again ? I could not find them in the
> > > > archive.
> > > 
> > > Hmmm, looks like the sourceforge archive strips off attachments.
> > > 
> > > Here is the body of my reply to Scott and the attachment again:
> > > 
> > > I've attached a gzip'd jboss log from a jboss 3.2.1 startup showing
that
> > > the jboss-anvilmarket2-service.xml file is deployed before any of the
> > > EJBs in the ejb-anvil-market.jar are deployed, resulting in "class not
> > > found" error.
> > > 
> > > I think the <depends> tags in jboss-anvilmarket2-service.xml should
make
> > > the mbean deployment wait until after the named EJB has deployed,
> > > however this is not happening.
> > > 
> > > The very same ejb jar and -service.xml work fine if I force the
> > > deployment order by copying them into the deploy directory manually
one
> > > by one.
> > > 
> > > Cheers,
> > > Alex.
> > > 
> > > 
> > > <?xml version="1.0" encoding="UTF-8"?>
> > > 
> > > <server>
> > > 
> > >   <classpath codebase="lib" archives="quickfix.jar"/>
> > > 
> > >   <mbean code="com.anvil.ate.market.common.ApplicationConstants"
> > >    name="com.anvil.ate.market:service=ApplicationConstants">
> > >     <depends>jboss:service=Naming</depends> 
> > >
<depends>jboss.j2ee:jndiName=market/MarketData,service=EJB</depends> 
> > >     <attribute name="ServerName">localhost</attribute>
> > >     <attribute name="InOrderQ">inboundOrderQueue</attribute>
> > >     <attribute name="InQuoteQ">inboundQuoteQueue</attribute>
> > >     <attribute name="InSessionQ">inboundSessionQueue</attribute>
> > >     <attribute name="OutQ">outboundQueue</attribute>   
> > >   </mbean>
> > > 
> > > </server>
> > > 
> > 
> > 
> > -------------------------------------------------------
> > This SF.Net email is sponsored by: INetU
> > Attention Web Developers & Consultants: Become An INetU Hosting Partner.
> > Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
> > INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
> > _______________________________________________
> > JBoss-user mailing list
> > [EMAIL PROTECTED]
> > https://lists.sourceforge.net/lists/listinfo/jboss-user
> 
> 
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by: INetU
> Attention Web Developers & Consultants: Become An INetU Hosting Partner.
> Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
> INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user




-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


_____________________________________________________________________ 
Notice to recipient: 
The information in this internet e-mail and any attachments is confidential
and may be privileged. It is intended solely for the addressee. If you are
not the intended addressee please notify the sender immediately by
telephone. If you are not the intended recipient, any disclosure, copying,
distribution or any action taken or omitted to be taken in reliance on it,
is prohibited and may be unlawful. 

When addressed to external clients any opinions or advice contained in this
internet e-mail are subject to the terms and conditions expressed in any
applicable governing terms of business or client engagement letter issued by
the pertinent Bank of America group entity. 

If this email originates from the U.K. please note that Bank of America,
N.A., London Branch, Banc of America Securities Limited and Banc of America
Futures Incorporated are regulated by the Financial Services Authority.
_____________________________________________________________________ 




-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to