Announcement Announcement Module

Spring Dynamic Modules forum decommissioned in favor of Eclipse Gemini Blueprint

With the official first release of Eclipse Gemini Blueprint shipped, the migration of the Spring Dynamic Modules code base to the Eclipse Foundation, as part of the Gemini project, has been completed.

As such, this forum has been decommissioned in favour of the Eclipse Gemini forums.
See more
See less
ApplicationContextAware issue Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • ApplicationContextAware issue

    I'm using spring ApplicationContextAware to set the Application context to my web services endpoint. There's no exception when I install and start the bundle. When I'm trying to call the service, I'getting a null pointer exception as the application context is showing up as "null". Here's the app context entry :
    <jaxws:endpoint id="taxonomyquery"  implementor="com.test.taxonomy.soap.query.service.TaxonomySoapQueryServiceImpl"
      address="/taxonomyquery" />
    And here's my sample code:
    @WebService(endpointInterface = "com.test.taxonomy.soap.query.service.ITaxonomySoapQueryService")
    public class TaxonomySoapQueryServiceImpl implements ITaxonomySoapQueryService, ApplicationContextAware {
     private static ApplicationContext ctx = null;
     private static Logger LOGGER = LoggerFactory.getLogger(TaxonomySoapQueryServiceImpl.class);
     public void setApplicationContext(ApplicationContext ctx) throws BeansException {
      this.ctx = ctx;
     public ProductReleaseResponse queryProductRelease(ProductReleaseRequest req) {
      ProductReleaseResponse response = new ProductReleaseResponse ();
      try {
       req.status = RequestHelper.transformStatus(req.status);
       ITaxonomySoapPluginQuery tp = (ITaxonomySoapPluginQuery) ctx.getBean("taxonomyQueryPlugin");
       response = tp.queryProductRelease(req);
      catch (Exception ex) {
       response.status = "ERROR";
      return response;
    The service is starting without any issues, which prompted me to believe that the Application Context should have been set correctly.

    I've also tried using BeanfactoryAware, but got the same exception.

    Any pointer will be appreciated.

    - Thanks

  • #2
    My bad, I declared it wrong in the spring config.

    <jaxws:endpoint id="taxonomyquery"
      address="/taxonomyquery" />
    <bean id="taxonomyqueryImpl" class="com.test.taxonomy.soap.query.service.TaxonomySoapQueryServiceImpl"/>
    This resolved the issue