I have a JAX-WS 2.0 RI based project deployed on JBoss 4.0.4.GA that I am upgrading to
JBoss 4.2.1.GA with JBossWS 2.0.1.GA.
An endpoint packaged in a war makes use of @PostConstruct, as well as some Handlers that
make use of @PostConstruct as well. @PostContruct on the web service class is never
invoked, however @PostConstruct on on of the Handlers does get invoked. I'll try
experimenting with removing the handlers, and see if it's something like JBossWS will
only invoker one @PostConstruct method per web service.
The following port interface was generated from the WSDL:
| @WebService(name="ImportPort",
targetNamespace="urn:HVODWebService")
| @HandlerChain(file="ImportPort_handler.xml")
| @SOAPBinding(parameterStyle=SOAPBinding.ParameterStyle.BARE)
| public interface ImportPort {
|
| @WebMethod
| @WebResult(name="ImportResponse",
| targetNamespace="urn:HVODWebServiceTypes",
| partName="response")
| public ImportResponse submitJob(@WebParam(name="ImportRequest",
|
targetNamespace="urn:HVODWebServiceTypes",
| partName="request")
| ImportRequest request)
| throws ServiceFault;
|
| }
|
The following implementation makes use of @PostConstruct, but never gets invoked:
|
@WebService(endpointInterface="com.xo.nextgen.hvodwebservice.wsdl.ImportPort")
| public class ImportWebService implements ImportPort {
|
| @Resource
| private WebServiceContext context;
|
| @PostConstruct
| public void initialize() {
| ...
| }
|
| @PreDestroy
| public void destroy() {
| ...
| }
|
| public ImportResponse submitJob(ImportRequest request)
| throws ServiceFault {
| ...
| }
|
| }
|
The following handler.xml is used to inject two Handlers:
| <?xml version="1.0" encoding="UTF-8"?>
| <javaee:handler-chains
xmlns:javaee="http://java.sun.com/xml/ns/javaee">
| <javaee:handler-chain>
| <javaee:handler>
| <javaee:handler-name>SchemaValidation</javaee:handler-name>
|
<javaee:handler-class>com.xo.nextgen.hvodwebservice.wsdl.handler.SchemaValidationHandler</javaee:handler-class>
| </javaee:handler>
| <javaee:handler>
| <javaee:handler-name>FaultNotification</javaee:handler-name>
|
<javaee:handler-class>com.xo.nextgen.hvodwebservice.wsdl.handler.FaultNotificationHandler</javaee:handler-class>
| </javaee:handler>
| </javaee:handler-chain>
| </javaee:handler-chains>
|
The following Handler interestingly does have it @PostConstruct method invoked:
| public class SchemaValidationHandler
| implements LogicalHandler<LogicalMessageContext> {
|
| @PostConstruct
| public void initialize() throws WebServiceException {
| ...
| }
|
| @PreDestroy
| public void destroy() {
| }
|
|
| public boolean handleMessage(LogicalMessageContext context) {
| ...
| }
|
| public boolean handleFault(LogicalMessageContext context) {
| ...
| }
|
| public void close(MessageContext context) {
| ...
| }
|
| }
|
Also the exact same behavior occurs with JBoss 4.2.1.GA with it's native JBossWS 1.2.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4096238#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...