[jboss-user] [JBoss Web Services] - Is there a better way to initialize a JAX-WS web service?

George F. Santamarina do-not-reply at jboss.com
Thu Dec 9 17:07:46 EST 2010


George F. Santamarina [http://community.jboss.org/people/gfsantamarina] created the discussion

"Is there a better way to initialize a JAX-WS web service?"

To view the discussion, visit: http://community.jboss.org/message/575284#575284

--------------------------------------------------------------
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.
 
After looking at various posts (Initializing an Application on Deployment using JMX -  http://community.jboss.org/message/167063#167063 http://community.jboss.org/message/167063#167063 and ServiceLifecycle in JossWS 2.0.1 -  http://community.jboss.org/message/337582#337582 http://community.jboss.org/message/337582#337582), I've come to the conclusion that there is no real good way of initializing a web service.
 
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.
 
Is there any better way of doing this just using the web services framework without having to depend on servlets?
 
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 ( http://community.jboss.org/docs/DOC-13527 http://community.jboss.org/wiki/JBossWS-Tuning#Eager_initialization) though I'm not sure it would help us any since this is not a JAXB issue.
I am using JBoss [Trinity] 4.2.3.GA.

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.

After looking at various posts ( http://community.jboss.org/message/167063#167063 Initializing an Application on Deployment using JMX and  http://community.jboss.org/message/337582#337582 ServiceLifecycle in JossWS 2.0.1), I've come to the conclusion that there likely no good way of doing initialization within a JAX-WS web service.

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.

*Question: Is there any better way of doing this just using the web services framework without having to depend on servlets?*

JBoss 4.2.3 comes with jbossws-3.0.1-native-2.0.4.GA so I cannot take advantage of the  http://community.jboss.org/docs/DOC-13527#Eager_initialization org.jboss.ws.eagerInitializeJAXBContextCache flag in jbossws 3.0.3 though I'm not sure it would help any since this is not a JAXB issue.

Thanks.
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/575284#575284]

Start a new discussion in JBoss Web Services at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2044]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20101209/8f8aaba9/attachment.html 


More information about the jboss-user mailing list