I had to cludge my way around the deployment of a SAR and EJB from the same
EAR to ensure that the Mbean did not use the EJB until the EAR deployment
was complete.

Even though the EJB was deployed first, the MBean in my SAR failed when
looking up the JNDI name of the EJB.  It seems like the JNDI names are not
actually visible until after the whole contents of the EAR were deployed.
Is the EAR deployment (and the JNDI names it registers) transactional in
nature?

-----Original Message-----
From: Brian Wallis [mailto:[EMAIL PROTECTED]
Sent: Thursday, 20 March 2003 10:58 a.m.
To: [EMAIL PROTECTED]
Subject: Re: [JBoss-user] Deploying scheduler after EAR deployment


On Thu, 20 Mar 2003 01:12, Krishnakumar N wrote:

>  You can do this by using the deployment sorters specified in
> /conf/jboss-service.xml. For example, you can use the
> PrefixDeploymentSorter and call your scheduler service xml 1blahblah.xml.

Yep, that will work, but I think in a large project with multiple
dependencies 
it gets hard to manage. There are other ways...

If it is just classes that you need I would put the service.xml in a sar and

add a Class-Path: entry to the manifest (and put the sar in the ear as
well). 
ie: you have a sar file with 
META-INF/MANIFEST.MF
META-INF/jboss-service.xml      <-- your scheduler service.xml file

MANIFEST.MF has a line like so:
  Class-Path: yourjar.jar

This means the yourjar.jar should now be on your classpath when the
scheduler 
is started.

If your scheduler requires another mbean to be available, make the scheduler

mbean dependent on the other mbean like so: 

  <mbean code="org.jboss.varia.scheduler.Scheduler"
    name="ot.notificationservice:service=Scheduler,name=DBCleanerScheduler">
     <attribute
name="SchedulableMBean">ot.notificationservice:name=DBCleaner
     </attribute>
    <attribute
     name="SchedulableMBeanMethod">cleanup(
NOTIFICATION,DATE,SCHEDULER_NAME)
    </attribute>
    <attribute name="InitialStartDate">NOW</attribute>
    <attribute name="SchedulePeriod">30000</attribute>
    <attribute name="InitialRepetitions">-1</attribute>
    <!--Make sure the DBCleaner MBean has been 'started' before we call
it-->
    <depends>ot.notificationservice:name=DBCleaner</depends>
  </mbean>

Similar for ejbs where you can use the ejb mbean name in the dependency, 
usually a name something like 
  jboss.j2ee:jndiName=ejb/notification/EFD,service=EJB

brian wallis...



-------------------------------------------------------
This SF.net email is sponsored by: Does your code think in ink? 
You could win a Tablet PC. Get a free Tablet PC hat just for playing. 
What are you waiting for?
http://ads.sourceforge.net/cgi-bin/redirect.pl?micr5043en
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


-------------------------------------------------------
This SF.net email is sponsored by: Does your code think in ink? 
You could win a Tablet PC. Get a free Tablet PC hat just for playing. 
What are you waiting for?
http://ads.sourceforge.net/cgi-bin/redirect.pl?micr5043en
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to