[jboss-user] [JBoss Web Services] - Web Service annotated with @PostConstruct - wrong order w.r.t Listener

Mike Norman do-not-reply at jboss.com
Tue Jun 29 12:01:32 EDT 2010


Mike Norman [http://community.jboss.org/people/mwnorman] replied to the discussion

"Web Service annotated with @PostConstruct - wrong order w.r.t Listener"

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

--------------------------------------------------------------
Yes, it does cause problems - I have some initialization code that I hope to maintain across four AppServers (Glassfish, WebLogic,
WebSphere and JBoss). The main job of the ServletContextListener is to grab the ServletContext so that later in the @PostConstruct
init-method on the Web service, I can load some resources that are only available from the ServletContext's classloader. So far,
I'm hitting 0.750 (I should be in the majors!)

Here is my deployment descriptor for my 'Simple' Web service:

<?xml version="1.0" encoding="UTF-8"?>
<web-app
  xmlns="http://java.sun.com/xml/ns/javaee" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
  version="2.5">  
  <listener>
    <listener-class>_dbws.ProviderListener</listener-class>
  </listener>
  <servlet>
    <servlet-name>_dbws.SimpleProvider</servlet-name>
    <servlet-class>_dbws.SimpleProvider</servlet-class>
    <load-on-startup>0</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>_dbws.SimpleProvider</servlet-name>
    <url-pattern>/simple</url-pattern>
  </servlet-mapping>
</web-app>

--------------------------------------------------------------

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

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/20100629/d7875a99/attachment.html 


More information about the jboss-user mailing list