<!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;">
    Lazy EJB3.1 timerservice deployment starting JBoss AS 6.0.0.M5
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/jaikiran">jaikiran pai</a> in <i>EJB 3.0</i> - <a href="http://community.jboss.org/docs/DOC-15884">View the full document</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><h5>Background:</h5><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span>EJB3.1 timerservice support was introduced in AS 6.0.0.M4 </span><a class="jive-link-external-small" href="http://community.jboss.org/docs/DOC-15643" target="_blank">http://community.jboss.org/wiki/EJB31inJBossAS600M4</a><span>. The implementation is based on JPA (Hibernate as the provider in JBoss AS). This added around 3-4 second increase in the boot time of the JBoss AS server, due the initialization involved for deploying the timerservice jar. Since the timerservice was only applicable for EJB3.x deployments, it did not make sense to increase the default boot time if the server doesn't have any EJB3.x deployments. Hence we decided to "lazily" deploy the timerservice.</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><h5>Forum discussion:</h5><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><a class="jive-link-external-small" href="http://community.jboss.org/thread/155800" target="_blank">http://community.jboss.org/thread/155800</a></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><h5>Details:</h5><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span>Starting JBoss AS 6.0.0.M5, which was released recently </span><a class="jive-link-external-small" href="http://community.jboss.org/blogs/donnamishelly/2010/09/24/jboss-as-600m5-released" target="_blank">http://community.jboss.org/blogs/donnamishelly/2010/09/24/jboss-as-600m5-released</a><span>, the jboss-ejb3-timerservice-mk2.jar now resides in JBOSS_HOME/common/deploy folder. This jar will be deployed lazily by the server. The server will&#160; deploy this jar only when the first EJB3.x deployment is made available in the server. By default, JBoss AS doesn't ship any EJB3.x deployments and hence the lazy deployment of timerservice jar saves a few seconds of the server boot time.</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><h5>How to disable the "lazy" timerservice deployment:</h5><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>If users want to disable the "lazy" deployment of timerservice and instead deploy it always, irrespective of the presence of an EJB3.x deployment, then follow the steps mentioned below:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><ul><li>Move (cut/paste) jboss-ejb3-timerservice-mk2.jar from JBOSS_HOME/common/deploy to JBOSS_HOME/server/&lt; servername&gt;/deploy folder. Ex: Move it to JBOSS_HOME/server/default/deploy folder, if you use the "default" server config.</li></ul><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><ul><li>Edit the JBOSS_HOME/server/&lt; servername&gt;/deployers/ejb3.deployer/META-INF/ejb3-as-deployers-jboss-beans.xml and comment out (or remove) the following MC bean configuration:</li></ul><p>&#160;&#160;&#160; <br/>&#160;&#160;&#160; <br/></p><pre class="jive-pre"><code class="jive-code jive-xml"><span class="jive-xml-tag">&lt;bean name="EJB3MetadataOnDemandDeploymentDeployer" class="org.jboss.ejb3.deployers.EJB3MetadataOnDemandDeploymentDeployer"&gt;</span>
&#160;&#160;&#160;&#160;&#160; 
&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;property name="profileService"&gt;</span><span class="jive-xml-tag">&lt;inject bean="jboss.profileservice:service=ProfileService"/&gt;</span><span class="jive-xml-tag">&lt;/property&gt;</span>
 
&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-comment">&lt;!-- Build a profile from the contents of this single URI --&gt;
&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;property name="deploymentRoot"&gt;</span>${jboss.common.base.url}deploy<span class="jive-xml-tag">&lt;/property&gt;</span>
&#160;&#160;&#160;&#160;&#160; 
&#160;&#160;&#160;&#160;&#160; &lt;!--&#160; We just have a single on-demand deployment - the jboss-ejb3-timerservice-mk2.jar
&#160;&#160;&#160;&#160;&#160;&#160;&#160; Note: If there are multiple deployments which need to be deployed on-demand, then 
&#160;&#160;&#160;&#160;&#160;&#160;&#160; set the "deploymentNames" collection property *instead of* "singleDeployment"
&#160;&#160;&#160;&#160;&#160;&#160;&#160; property
&#160;&#160;&#160;&#160;&#160;&#160; --&gt;
&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;property name="singleDeployment"&gt;</span>jboss-ejb3-timerservice-mk2.jar<span class="jive-xml-tag">&lt;/property&gt;</span><span>
&#160;&#160;&#160;&#160;&#160; 
&#160;&#160;&#160;&#160;&#160; &lt;!-- 
&#160;&#160;&#160;&#160;&#160;&#160;&#160; Whether activation of the profile (i.e. deployment of the URI contents)
&#160;&#160;&#160;&#160;&#160;&#160;&#160; should be deferred until the first EJB3.x deployment (true) or done as part of
&#160;&#160;&#160;&#160;&#160;&#160;&#160; the start of this bean (false).
&#160;&#160;&#160;&#160;&#160;&#160;&#160; 
&#160;&#160;&#160;&#160;&#160;&#160;&#160; WARNING: This configuration option may be altered in a subsequent AS 6.0
&#160;&#160;&#160;&#160;&#160;&#160;&#160; milestone release.
&#160;&#160;&#160;&#160;&#160;&#160;&#160; 
&#160;&#160;&#160;&#160;&#160;&#160;&#160; FIXME: </span><a class="jive-link-external-small" href="https://jira.jboss.org/jira/browse/JBAS-7714" target="_blank">https://jira.jboss.org/jira/browse/JBAS-7714</a><span>&#160;&#160;&#160;&#160;&#160;&#160;&#160; 
&#160;&#160;&#160;&#160;&#160;&#160;&#160; --&gt;</span></span>
&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;property name="activateOnDemand"&gt;</span>${jboss.as.deployment.ondemand:true}<span class="jive-xml-tag">&lt;/property&gt;</span>

&#160;&#160; <span class="jive-xml-tag">&lt;/bean&gt;</span>
</code></pre><h5><br/>&#160;&#160; <br/>Issues/questions:</h5><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span>If you have any related issues or questions, please report/ask them in our user forum here </span><a class="jive-link-external-small" href="http://community.jboss.org/community/ejb3" target="_blank">http://community.jboss.org/community/ejb3?view=discussions</a><span>&#160;&#160; </span></p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Comment by <a href="http://community.jboss.org/docs/DOC-15884">going to Community</a></p>

        <p style="margin: 0;">Create a new document in EJB 3.0 at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=102&containerType=14&container=2029">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>