Announcement Announcement Module
Collapse
No announcement yet.
CastorMarshaller in Spring WS Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • CastorMarshaller in Spring WS

    Hi. I am trying to use Castor in Spring WS.
    I have configured my beans as shown below:
    Code:
    <bean id="sysRefCodeInquireTemplate" class="SomeClass" parent="webServiceTemplate">
    
         <property name="defaultUri" value="${SOME_URL}"/>
    
          <property name="marshaller" ref="sysRefCodeInquireMarshaller"/>
    
          <property name="unmarshaller" ref="sysRefCodeInquireMarshaller"/>
    
          <property name="interceptors">
    
          <list>
    
               <ref bean="headerInterceptor"/>
    
                <bean class="...">
    
                       <property name="soapAction" value="..."/>
    
                </bean>
    
         </list>
    
         </property>
    
     </bean>
    
    <bean id="sysRefCodeInquireMarshaller" class="org.springframework.oxm.castor.CastorMarshaller" parent="abstractCastorMarshallerBean" >
    
         <property name="mappingLocation" value="/castorMaps/referenceCodeMap.xml"/>
    
         <property name="validating" value="false"/>
    
          <property name="ignoreExtraElements" value="true"/>
    
     </bean>
    I am using Castor1.3.1 and Spring WS 1.5.8.
    But when I start my server, I see an IllegalStateException which says:

    Caused by: org.springframework.beans.ConversionNotSupportedEx ception: Failed to convert property value of type 'org.springframework.oxm.castor.CastorMarshaller' to required type 'org.springframework.oxm.AbstractMarshaller' for property 'marshaller'; nested exception is java.lang.IllegalStateException

    : Cannot convert value of type [org.springframework.oxm.castor.CastorMarshaller] to required type [org.springframework.oxm.AbstractMarshaller] for property 'marshaller': no matching editors or conversion strategy found

    at org.springframework.beans.BeanWrapperImpl.convertI fNecessary(BeanWrapperImpl.java:462)

    at org.springframework.beans.BeanWrapperImpl.convertF orProperty(BeanWrapperImpl.java:499)

    at org.springframework.beans.BeanWrapperImpl.convertF orProperty(BeanWrapperImpl.java:493)

    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.convertForProperty(Abst ractAutowireCapableBeanFactory.java:1363)

    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.applyPropertyValues(Abs tractAutowireCapableBeanFactory.java:1322)

    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.populateBean(AbstractAu towireCapableBeanFactory.java:1076)

    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:517)

    ... 53 more

    Caused by: java.lang.IllegalStateException: Cannot convert value of type [org.springframework.oxm.castor.CastorMarshaller] to required type [org.springframework.oxm.AbstractMarshaller] for property 'marshaller': no matching editors or conversion strategy found

    at org.springframework.beans.TypeConverterDelegate.co nvertIfNecessary(TypeConverterDelegate.java:231)

    at org.springframework.beans.BeanWrapperImpl.convertI fNecessary(BeanWrapperImpl.java:447)

    ... 59 more


    I have tried googling this issue but could not find any proper solution. Any solution/idea/comment would be very much welcome.

    Thanks,
    Samrat

  • #2
    Judging from the stack trace you are using spring 3... Spring 3 and Spring ws 1.5.x are incompatible..
    If that isn't the case check your class path as then you might be having different jars/classes in different class loaders (and class identity is based on classname AND class loader they reside in).

    Comment


    • #3
      Thanks Marten for your reply. You are correct that I am using Spring 3. But I am removing the Spring WS 1.5.8's transitive dependency on Spring 2.5. I am using Maven and in the POM file I have these:

      Code:
      <dependency>
      			<groupId>org.springframework.ws</groupId>
      			<artifactId>spring-ws-core</artifactId>
      			<version>1.5.8</version>
      			<exclusions>
      				<exclusion>
      					<groupId>org.springframework</groupId>
      					<artifactId>spring-aop</artifactId>
      				</exclusion>
      				<exclusion>
      					<groupId>org.springframework</groupId>
      					<artifactId>spring-beans</artifactId>
      				</exclusion>
      				<exclusion>
      					<groupId>org.springframework</groupId>
      					<artifactId>spring-core</artifactId>
      				</exclusion>
      				<exclusion>
      					<groupId>org.springframework</groupId>
      					<artifactId>spring-context</artifactId>
      				</exclusion>
      				<exclusion>
      					<groupId>org.springframework</groupId>
      					<artifactId>spring-context-support</artifactId>
      				</exclusion>
      				<exclusion>
      					<groupId>org.springframework</groupId>
      					<artifactId>spring-web</artifactId>
      				</exclusion>
      				<exclusion>
      					<groupId>org.springframework</groupId>
      					<artifactId>spring-webmvc</artifactId>
      				</exclusion>
      			</exclusions>
      		</dependency>
      		<dependency>
      			<groupId>org.springframework.ws</groupId>
      			<artifactId>spring-oxm</artifactId>
      			<version>1.5.8</version>
      			<exclusions>
      				<exclusion>
      					<groupId>org.springframework</groupId>
      					<artifactId>spring-beans</artifactId>
      				</exclusion>
      				<exclusion>
      					<groupId>org.springframework</groupId>
      					<artifactId>spring-core</artifactId>
      				</exclusion>
      				<exclusion>
      					<groupId>org.springframework</groupId>
      					<artifactId>spring-context</artifactId>
      				</exclusion>
      			</exclusions>
      		</dependency>
      		<dependency>
      			<groupId>org.springframework.ws</groupId>
      			<artifactId>spring-xml</artifactId>
      			<version>1.5.8</version>
      			<exclusions>
      				<exclusion>
      					<groupId>org.springframework</groupId>
      					<artifactId>spring-beans</artifactId>
      				</exclusion>
      				<exclusion>
      					<groupId>org.springframework</groupId>
      					<artifactId>spring-core</artifactId>
      				</exclusion>
      				<exclusion>
      					<groupId>org.springframework</groupId>
      					<artifactId>spring-context</artifactId>
      				</exclusion>
      			</exclusions>
      		</dependency>
      As of your second point, here too I am using Maven to load the dependencies. So I guess that the different jars/classes shouldn't be happening. But I'm not sure.

      Comment


      • #4
        As I stated spring 3.0 and Spring WS 1.5.x aren't compatible... Spring WS 1.5 has its own OXM implementation which as of Spring 3 is part of spring, with different classes etc. So they simply aren't compatible...

        Comment

        Working...
        X