Announcement Announcement Module
No announcement yet.
Spring-JAXWS error Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring-JAXWS error

    I am writing authenticate service using Spring 2.5.6 with both Hessian remoting implementation and jaxws web service implement. Hession remoting is working fine. However, there is still error in jaxws web service implementation. Basically, I follow the instruction of the link and have both JAXWS2.1.1 and jaxws-spring download . In the process, I got runtime modeler error: Wrapper class is not found. Have you run APT to generate them.
    I ran ant wsgen and resolve that issue. Now, I got another error like the following

    nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'authenticateServiceEndpoint': FactoryBean threw exception on object creation; nested exception is java.lang.NullPointerException
    at nitionValueResolver.resolveReference(BeanDefinitio
    at nitionValueResolver.resolveValueIfNecessary(BeanDe
    at AutowireCapableBeanFactory.applyPropertyValues(Abs
    at ationContext.finishBeanFactoryInitialization(Abstr
    at ationContext.refresh(AbstractApplicationContext.ja va:380)
    at org.springframework.web.context.ContextLoader.crea teWebApplicationContext(
    at org.springframework.web.context.ContextLoader.init WebApplicationContext(
    at org.springframework.web.context.ContextLoaderListe ner.contextInitialized( 45)
    at org.apache.catalina.core.StandardContext.listenerS tart(

    Caused by: org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'authenticateServiceEndpoint': FactoryBean threw exception on object creation; nested exception is java.lang.NullPointerException
    at eanRegistrySupport$
    at Method)
    at eanRegistrySupport.doGetObjectFromFactoryBean(Fact
    at eanRegistrySupport.getObjectFromFactoryBean(Factor
    at BeanFactory.getObjectForBeanInstance(AbstractBeanF
    at BeanFactory.doGetBean( )
    at BeanFactory.getBean(
    at BeanFactory.getBean(
    at nitionValueResolver.resolveReference(BeanDefinitio
    ... 42 more
    Caused by: java.lang.NullPointerException
    at 290)
    at org.jvnet.jax_ws_commons.spring.SpringService.getO bject(
    at org.jvnet.jax_ws_commons.spring.SpringService.getO bject(
    at eanRegistrySupport$

    Any idea, why, I attached both web.xml and applicationContext.xml. I am not using autowired. Thanks.

  • #2
    Spring-Jaxws error : resolved

    I resolved the problem myself. I checked with spring-jax-ws-core.xsd.html in my jaxws-spring jar, bindingID attribute rely upon SEI, which is impl attribute. That's required even though I have nested bean of the same class defined. I put back impl attribute and it started working.

    I had that attribute defined in the beginning. I took that out because I I got In order to solve that issue, I ran ant wsgen. wsgen does not like Autowired in my web service class. Therefore, I took Autowired out. I have to rely upon nested bean to inject the property in ws:service. To avoid define duplicate implementation class, I took impl attribute out. Apparently, jaxws-spring implementation think differently.

    If you want to use Spring-JAXWS implementation
    1) follow
    2) run wsgen on your web service implementation class.
    3) make sure you have impl attribute defined in ws:service even you define nested implementation bean.


    • #3
      Spring-JAXWS error : resolution correction

      Make one final correction. My previous settings:

      <ws:service id="authenticateWebService" impl=" iceEndpoint" >
      <bean class=" viceEndpoint">
      <property name="authenticateService" ref="ldapAuthenticateServiceImpl" />

      won't cause any error when deployed. However, nested bean does not take effect. Basically, it creates a default instance of impl class. Property authenticateService injection was not applied. Therefore, I got NullPointerException when the web service method was executed.

      The followings are final working configuration for your reference.

      <bean id="authenticateServiceEndpoint" class=" viceEndpoint">
      <property name="authenticateService" ref="ldapAuthenticateServiceImpl" />

      <wss:binding id="jax-ws.http" url="/webservice">
      <wss:service><!-- nested bean is of course fine -->
      <ws:service bean="#authenticateServiceEndpoint" />
      </wss:binding> does provide a sample of this flavor. Thanks.