Solved

Spring context config initialization error

Posted on 2013-12-23
4
848 Views
Last Modified: 2014-03-10
I am getting the following error shown below upon spring  context configuration file initialization, any help would be appreciated.

ServletWrappe E   SRVE0100E: Did not realize  init() exception thrown by servlet abc-ws: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'efgWebServiceTemplate' defined in ServletContext resource [/WEB-INF/efgSpringContext.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'interceptors' of bean class [org.springframework.ws.client.core.WebServiceTemplate]: Bean property 'interceptors' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?

I created a new web service that get called from within an exising web service.

The exisitng web service interceptor is configured as in the following:

<bean id="abcSecurityTokenInterceptor" class="com.pnc.ecommerce.util.spring.ws.security.SecurityTokenInterceptor">
<property name="verifySecurityHandler" ref="abcVerifySecurityHandler" />
<property name="timestampTokenHandler" ref="abcTimestampTokenHandler" />
</bean>

<bean class="org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpointMapping">
   <property name="mappings">
       <props>
……………….
……………….
………………
       </props>
   </property>
   <property name="interceptors">
      <list>
      <ref bean="abcSecurityTokenInterceptor"/>
      </list>
   </property>
</bean>

The new web service (which is called from within the existing  web service) has an interceptor that is configured as in the following:

<bean id="efgSecurityInterceptor"
 class="org.springframework.ws.soap.security.wss4j.Wss4jSecurityInterceptor">
<property name="securementActions" value="UsernameToken"/>
<property name="securementPasswordType" value="PasswordText"/>
</bean>

<bean id="efgWebServiceTemplate"
 class="org.springframework.ws.client.core.WebServiceTemplate">
<property name="messageFactory">
<bean
class="org.springframework.ws.soap.saaj.SaajSoapMessageFactory" />
</property>

<property name="marshaller" ref="efgMarshaller"/>
<property name="unmarshaller" ref="efgMarshaller"/>
<property name="interceptors">
<list>
<ref local="efgSecurityInterceptor" />
</list>
</property>
</bean>

Web.xml has the following:

<display-name>
ABCWebApp
</display-name>
<servlet>
<servlet-name>abc-ws</servlet-name>
<servlet-class>
org.springframework.ws.transport.http.MessageDispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:abc-ws-servlet.xml
/WEB-INF/efgSpringContext.xml
</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>


Thanks
Jeff
0
Comment
Question by:jeffreyjseaman
  • 3
4 Comments
 
LVL 35

Expert Comment

by:mccarl
ID: 39737170
What version of Spring WS are you using? And what version of Spring (ie. the core, beans, context, etc)?
0
 

Author Comment

by:jeffreyjseaman
ID: 39738427
I am using:  spring-ws-core-1.5.6.jar  Please see below.

Class-Path:
 lib/XMLStreamException.jar
 lib/jaxen-1.1.1.jar
 lib/jdom-1.1.jar
 lib/log4j-1.2.15.jar
 lib/saaj-api.jar
 lib/saaj-impl.jar
 lib/spring-2.0.8.jar
 lib/wsdl4j-1.6.1.jar
 lib/Phaos_Crypto.jar
 lib/Phaos_Security_Engine.jar
 lib/SmdClientJavaApp.jar
 lib/bcprov-jdk15-136.jar
 lib/smd-schemas.jar
 lib/spring-oxm-1.0.0.jar
 lib/spring-ws-core-1.5.6.jar
 lib/spring-ws-core-tiger-1.5.6.jar
 lib/spring-oxm-tiger-1.5.6.jar
 lib/spring-ws-security-1.5.6.jar
 lib/spring-xml-1.5.6.jar
 lib/stax-api-1.0.1.jar
 lib/wss4j-1.5.6.jar
 lib/xbean.jar
 lib/commons-codec-1.3.jar
 lib/jaxb-2.1-20090206/jaxb-api.jar
 lib/jaxb-2.1-20090206/jaxb-impl.jar
 lib/xmlsec-1.4.2.jar
 lib/wsp_cus_status-jaxb-1.0.jar

In the context xml file I have the following:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">


I wanted to mention that I don't see the issue when I run in local (using RAD / WAS 6.1), but the initialization fails in the QA environment.
0
 

Accepted Solution

by:
jeffreyjseaman earned 0 total points
ID: 39738428
When I comment out the interceptor, the context get loaded fine but then there will be no security applied to the client and then it will fail when the client make the call. :


       
      <!-- Seurity Interceptor -->
      <bean id="efgSecurityInterceptor"
              class="org.springframework.ws.soap.security.wss4j.Wss4jSecurityInterceptor">
            <property name="securementActions" value="UsernameToken"/>
            <property name="securementPasswordType" value="PasswordText"/>
      </bean>      

      <!-- WebServiceTemplate -->
      <bean id="efgWebServiceTemplate"
              class="org.springframework.ws.client.core.WebServiceTemplate">
            <property name="messageFactory">
                  <bean
                        class="org.springframework.ws.soap.saaj.SaajSoapMessageFactory" />
            </property>

            <property name="marshaller" ref="queryCustomerStatusMarshaller"/>
            <property name="unmarshaller" ref="queryCustomerStatusMarshaller"/>
            <!--<property name="interceptors">
                  <list>
                        <ref local="efgSecurityInterceptor" />
                  </list>
            </property> -->
      </bean>
0
 

Author Closing Comment

by:jeffreyjseaman
ID: 39916994
nobody else gave any answers and it was resolved by myself
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Eclipse Neon and jdk 1.8.0 11 138
JList custom Cell Renderer refresh 15 53
Java Options in Zimbra Server 2 46
fibonacci ten numbers 4 28
This article is about some of the basic and important steps to be used to improve the performance in web-sphere commerce application development. 1) Always leverage the Dyna-caching facility provided by the product 2) Remove the unwanted code …
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now