<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
JBoss 5.1.0AS and Datasource Initialization/Service Lifecycle Ordering
</h3>
<span style="margin-bottom: 10px;">
created by <a href="http://community.jboss.org/people/fiddleman">Mark Indictor</a> in <i>Beginner's Corner</i> - <a href="http://community.jboss.org/message/556689#556689">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><div id="2284993">Hi. I'm attempting to convert a web application that has a large number of services that has been running in <a class="jive-link-external-small" href="http://www.coderanch.com/forums/f-63/JBoss">JBoss</a> 4.3.2 without incident for several years to JBoss 5.1.0. It is proving to be more difficult than expected. <br/> <br/> The problem that is currently blocking me is the fact that this  application dynamically registers datasources based upon a "bootstrap"  datasource defined in a -ds.xml  file and the database names contained therein. This dynamic registration/initialization takes place in the  'CREATE' lifecycle phase. Unfortunately, at this point, the datasource  defined in the -ds.xml file has not yet been registered. It would seem  that the ordering of standard JBoss datasource registration with respect  to the 'CREATE' lifecycle phase is different in 5.1.0 than 4.2.3. <br/> <br/> An interesting extra piece of information is that if I start JBoss  without my .WAR and .SAR files in place, the server starts up fine (and  registers the default datasources). If I then hot-deploy the  application, since the datasources are already defined, the order  dependency becomes moot. I cannot practically deploy in this way on a  production server, however, so I do need to find a solution to this  problem. <br/> <br/> Does anyone out there know if there a way to control this ordering  through dependencies or some other means, or is there some fundamental  rule that I was breaking in JBoss 4.2.3 that is more strictly enforced  in 5.1.0. Any assistance would be greatly appreciated. <br/> <br/> Thanks. <br/> <br/> -mark</div><p><a href="http://www.coderanch.com/templates/default/images/spacer.gif"><span> http://www.coderanch.com/templates/default/images/spacer.gif </span></a></p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/556689#556689">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in Beginner's Corner at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2075">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>