Announcement Announcement Module
No announcement yet.
ServletEndpointSupport no container callbacks Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • ServletEndpointSupport no container callbacks

    I am implementing an axis ws implementation in tomcat 6. I am attempting to gain access to the spring context using ServletEndpointSupport. This is something i have done successfully in several other containers, but as i step through the service interface the container callbacks to init are not happening. As a result, I am never able to inject the neccessarry business interfaces and always throw a null pointer exception when attempting to use them. Is there something i am missing about deployment in this container?
    Below are my context config files as well as the webapp deployment descriptor.


    /*******************App Config***********************************/
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "">

    - JCDC application context. Please follow patterns for injection patterns.

    <!-- JNDI reference -->
    <bean id="jcdcDataSource"
    class="org.springframework.jndi.JndiObjectFactoryB ean">
    <property name="jndiName" value="java:comp/env/jdbc/SaasDB" />
    <!-- Session Factory -->
    <bean id="jcdcSessionFactory"
    class="org.springframework.orm.hibernate3.LocalSes sionFactoryBean">
    <property name="dataSource" ref="jcdcDataSource" />
    <property name="mappingResources">
    <!-- I dont like this but spring isn't playing fair -->
    <!-- <value>hibernate.cfg.xml</value>-->
    <value>org\dol\jobcorps\axis\dao\beans\W2Address.h bm.xml</value>
    <value>org\dol\jobcorps\axis\dao\beans\Student.hbm .xml</value>
    <property name="hibernateProperties">
    <!-- Transaction Manager -->
    <bean id="txManager"
    class="org.springframework.orm.hibernate3.Hibernat eTransactionManager">
    <property name="sessionFactory" ref="jcdcSessionFactory" />
    <!-- Transaction Proxy -->
    <!-- base transaction proxy for which medrec spring beans inherit-->
    <bean id="baseTransactionProxy"
    class="org.springframework.transaction.interceptor .TransactionProxyFactoryBean"
    <property name="transactionManager" ref="txManager" />
    <property name="transactionAttributes">
    <prop key="save*">PROPAGATION_REQUIRED</prop>
    <prop key="update*">PROPAGATION_REQUIRED</prop>
    <prop key="*">PROPAGATION_REQUIRED</prop>

    <!-- DAO and BO implementations -->

    <!-- Student DAO -->
    <bean id="XXDao"
    <property name="sessionFactory" ref="jcdcSessionFactory" />
    <!-- XXAddress Dao -->
    <bean id="XXAddressDao"
    <property name="sessionFactory" ref="jcdcSessionFactory" />
    <!-- XX BO -->
    <bean id="XXBusiness" parent="baseTransactionProxy"
    <property name="target">
    <bean class="">
    <property name="XXDao" ref="studentDao" />

    <!-- MailSender implementation for JavaMail -->
    <!-- <bean id="mailSender" class="org.springframework.mail.javamail.JavaMailS enderImpl">
    <property name="host" value="${}"/>

    /**********************web.xml********************* ************/
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app id="WebApp_ID" version="2.4" xmlns="" xmlns:xsi="" xsi:schemaLocation="">
    <!-- JNDI reference for this project -->
    /WEB-INF/jcdc-app.xml /WEB-INF/jcdc-app-servlet.xml
    /WEB-INF/applicationContext.xml /WEB-INF/schedulingContext-timer.xml
    <!-- Spring and Axis context loader -->
    <listener-class>org.springframework.web.context.ContextLoade rListener</listener-class>
    <!-- <listener>
    <listener-class>org.apache.axis.transport.http.AxisHTTPSessi onListener</listener-class>
    <listener-class>org.springframework.web.util.Log4jConfigList ener</listener-class>

    <!-- Some but not all of the below will be required -->

    Apache-Axis Servlet</display-name>


  • #2
    Please use [ code][/code ] tags when posting code, that way we can decipher what you posted...


    • #3

      Originally posted by mdeinum View Post
      Please use [ code][/code ] tags when posting code, that way we can decipher what you posted...
      sorry about that...its my first time posting in this i have been able to solve all of my previous problems myself. will do in the future.




      • #4
        Problem Solved

        All in the spring community. While I am sure you will be laughing at me, oddly enough nothing new to me in software. I thought I would post the solution to the/my issue.

        The cruxt of the issue is whether or not the implementation class listed in the wsdd is a skeleton or implementation class. While obfuscating the implementation with a skeleton interface, and allowing that to make a call to the implementation (which works quite nicely in axis 1.x), this never allows the spring context loader to be aware that the jax-rpc implementation is extending ServletEndpointSupport. As a result, the container callbacks never occurr, and the implementation class never gets reference to the spring context.

        So, always deploy your service with the concrete implementation if you hope to get reference back to the spring context. For alot of us, probably not the first thing that came to mind.

        Anyway, thought this might help some struggling idiot like myself (what just drove me nuts about this as I have deployed this stack in 4 other containers without a hitch).

        Cheers ---> Mike