Bugs item #945568, was opened at 2004-05-01 01:43
Message generated for change (Comment added) made by raja05
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=945568&group_id=22866

Category: JBossMX
Group: v3.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Hussein Badakhchani (nogdog)
Assigned to: Nobody/Anonymous (nobody)
Summary: Deployment order in EAR, dependencies not resolved.

Initial Comment:
OS: Windows Professional, Linux Red Hat 7.2
Java version 1.4.2_04

Steps to create the bug:

1) Create an EAR with one EJB and one JMX bean.
2) The JMX bean should depend on the EJB, this 
dependency should be described in the jboss-service.xml 
file of the mbean.
3) Deploy the EAR file.

Jboss deploys the JMX sar file before the EJB causing an 
error like:

org.jboss.deployment.DeploymentException: create 
operation failed for package file:/C:/jboss-3.2.3/s 
erver/default/deploy/xibms.ear/sessionjmxmanager.sar; - 
nested throwable: (org.jboss.deployment.Depl 
oymentException: ejb not bound; - nested throwable: 
(javax.naming.NameNotFoundException: ejb not bou 
nd)) 

The background to this possible bug, and all relevant 
information can be traced in the forum

http://www.jboss.org/index.html?
module=bb&op=viewtopic&t=48859

regards,
hoos

----------------------------------------------------------------------

Comment By: Rajagopal Venkataraman (raja05)
Date: 2004-05-04 21:59

Message:
Logged In: YES 
user_id=206536

So here is the problem. You have the jndi lookup in ur 
constructor(Sorry had to decompile ur source, u dint provide 
the source ;-)), Anyway, the way the dependencies are 
managed is after the mbean is instantiated, i.e. the 
constructor called. Since ur mbean constructor had this 
lookup in constructor it failed. So what you can do is follow 
the SErvice lifecycle in ur mbean. Just create a 
public void start() throws Exception method in ur MBean 
interface as well as ur implementation class and move the 
whole code from constructor into this method. 
Readup the jboss docs to know more about the SErvice 
Lifecycle. The way i suggested above is only way, there are 
other ways to do this but the bottom line is move the code 
out of the constructor. 

Please post back if you are still getting the bug. 

So to reiterate, ur MBeanInterface would be something like
public class HelloWorldMBean {
       public void setTimer (...)
       public void getTimer() ;;;
        ............
       public void start() throws Exception(); //Lifecycle 
method

    
}

and implement the start method in ur implementation class.

Cheers
Raja

----------------------------------------------------------------------

Comment By: Hussein Badakhchani (nogdog)
Date: 2004-05-04 01:26

Message:
Logged In: YES 
user_id=489731

Raja,

I have attached two versions of a simple ear, one with 
integrated sar file and another with seperate components. 
The application depends on a timer service, I have included 
this in the user_service.xml file. Try the following.

1) copy the user-service.xml to jboss deploy dir
2) copy the deptest.ear under seperate into the deploy dir
3) start jboss
4) copy the helloworld.sar file under seperate into deploy dir

Everything should deploy correctly and you will notice every 
10 seconds the getMessage method of the HelloworldBean is 
invoked by the HelloWorldMBean

5) Stop jboss
6) remove the deptest.ear and helloworld.sar file from deploy 
dir
7) start jboss
8) copy deptest.ear into deploy dir. 

The application fails because the EJB is Not bound i.e the Sar 
file is deployed before the EAR (even with depends tags in the 
jboss-service.xml). I have tried a number of different JNDI 
names.

Good luck,
Hoos

----------------------------------------------------------------------

Comment By: Hussein Badakhchani (nogdog)
Date: 2004-05-04 01:23

Message:
Logged In: YES 
user_id=489731

Raja,

I have attached two versions of a simple ear, one with 
integrated sar file and another with seperate components. 
The application depends on a timer service, I have included 
this in the user_service.xml file. Try the following.

1) copy the user-service.xml to jboss deploy dir
2) copy the deptest.ear under seperate into the deploy dir
3) start jboss
4) copy the helloworld.sar file under seperate into deploy dir

Everything should deploy correctly and you will notice every 
10 seconds the getMessage method of the HelloworldBean is 
invoked by the HelloWorldMBean

5) Stop jboss
6) remove the deptest.ear and helloworld.sar file from deploy 
dir
7) start jboss
8) copy deptest.ear into deploy dir. 

The application fails because the EJB is Not bound i.e the Sar 
file is deployed before the EAR (even with depends tags in the 
jboss-service.xml). I have tried a number of different JNDI 
names.

Good luck,
Hoos

----------------------------------------------------------------------

Comment By: Rajagopal Venkataraman (raja05)
Date: 2004-05-03 23:00

Message:
Logged In: YES 
user_id=206536

Can you create a sample EAR file with ur setup and mail me 
at raja0576 at yahoo dot com

or maybe attach it here, Im really interested in this 

Thanks
Raja

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=945568&group_id=22866


-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE. 
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to