<!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;">
Is there a better way to initialize a JAX-WS web service?
</h3>
<span style="margin-bottom: 10px;">
created by <a href="http://community.jboss.org/people/gfsantamarina">George F. Santamarina</a> in <i>JBoss Web Services</i> - <a href="http://community.jboss.org/message/575284#575284">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">I've created a web service that uses a set of MBeans to hold configuration information for the web service.  I'd like to have the ability to configure the MBeans via the JMX console prior to the first web service call.</div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"> </div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span>After looking at various posts (Initializing an Application on Deployment using JMX - </span><a class="jive-link-external-small" href="http://community.jboss.org/message/167063#167063" target="_blank">http://community.jboss.org/message/167063#167063</a><span> and ServiceLifecycle in JossWS 2.0.1 - </span><a class="jive-link-external-small" href="http://community.jboss.org/message/337582#337582" target="_blank">http://community.jboss.org/message/337582#337582</a><span>), I've come to the conclusion that there is no real good way of initializing a web service.</span></div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"> </div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">The solution we're using right now is to create an initialization servlet with the <load-on-startup> node so that it loads on startup.  The only thing that the servlet does is have an init() method where we then put the MBeans initialization.  It seems to work.</div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"> </div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Is there any better way of doing this just using the web services framework without having to depend on servlets?</div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"> </div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span>We are using JBoss [Trinity] 4.2.3.GA that comes with jbossws-3.0.1-native-2.0.4.GA so we cannot take advantage of the org.jboss.ws.eagerInitializeJAXBContextCache flag in jbossws 3.0.3 (</span><a class="jive-link-external-small" href="http://community.jboss.org/docs/DOC-13527" target="_blank">http://community.jboss.org/wiki/JBossWS-Tuning#Eager_initialization</a><span>) though I'm not sure it would help us any since this is not a JAXB issue.</span></div><p>I am using JBoss [Trinity] 4.2.3.GA.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I've created a web service that uses a set of MBeans to hold configuration information for a JAX-WS web service.  I'd like to have the ability to configure the MBeans via the JMX console prior to the first incoming web service call.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>After looking at various posts (<a class="jive-link-message-small" href="http://community.jboss.org/message/167063#167063">Initializing an Application on Deployment using JMX</a> and <a class="jive-link-message-small" href="http://community.jboss.org/message/337582#337582">ServiceLifecycle in JossWS 2.0.1</a>), I've come to the conclusion that there likely no good way of doing initialization within a JAX-WS web service.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Right now, the solution I've settled on is to have a very simple initialization servlet that is loaded at startup time using the <load-on-startup> node in the web.xml.  The only thing that the servlet does is have an init() method where the MBeans for the web service are initialized.  It seems to work.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><strong>Question: Is there any better way of doing this just using the web services framework without having to depend on servlets?</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>JBoss 4.2.3 comes with jbossws-3.0.1-native-2.0.4.GA so I cannot take advantage of the <a class="" href="http://community.jboss.org/docs/DOC-13527#Eager_initialization">org.jboss.ws.eagerInitializeJAXBContextCache flag</a> in jbossws 3.0.3 though I'm not sure it would help any since this is not a JAXB issue.</p></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Thanks.</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/575284#575284">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss Web Services at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2044">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>