Announcement Announcement Module
Collapse
No announcement yet.
Failed to convert property value of type [$Proxy0] to required type [org.openuri.www Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Failed to convert property value of type [$Proxy0] to required type [org.openuri.www

    Hi Guys,

    When I am trying to use JaxRpcPortProxyFactoryBean, I am getting TypeMismatchException

    Here is the stack trace,

    org.apache.axis.i18n.resource::handleGetObject(eng ineConfigLoadFactory)
    DEBUG 2008-03-19 22:44:31,277 [main] org.apache.axis.configuration.EngineConfigurationF actoryFinder: FException in thread "main" org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'service' defined in class path resource [applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateExcep tion; nested PropertyAccessExceptions (1) are:
    PropertyAccessException 1: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [$Proxy0] to required type [org.openuri.www.AttachmentsSoap] for property 'service'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [$Proxy0] to required type [org.openuri.www.AttachmentsSoap] for property 'service': no matching editors or conversion strategy foundactory org.apache.axis.configuration.EngineConfigurationF actoryServlet Ignored: unable to load/resolve class.
    DEBUG 2008-03-19 22:44:31,277 [main] org.apache.axis.i18n.ProjectResourceBundle: org.apache.axis.i18n.resource::handleGetObject(eng ineFactory)
    DEBUG 2008-03-19 22:44:31,277 [main] org.apache.axis.configuration.EngineConfigurationF actoryFinder: Got EngineFactory: org.apache.axis.configuration.EngineConfigurationF actoryDefault
    DEBUG 2008-03-19 22:44:31,277 [main] org.apache.axis.AxisEngine: Enter: AxisEngine::init
    DEBUG 2008-03-19 22:44:31,808 [main] org.apache.axis.i18n.ProjectResourceBundle: org.apache.axis.i18n.resource::handleGetObject(att achEnabled)
    DEBUG 2008-03-19 22:44:32,074 [main] org.apache.axis.utils.JavaUtils: Attachment support is enabled? true
    DEBUG 2008-03-19 22:44:32,136 [main] org.apache.axis.encoding.ser.JAFDataHandlerDeseria lizerFactory: Enter/Exit: JAFDataHandlerDeserializerFactory(class java.lang.String, {http://xml.apache.org/xml-soap}PlainText)
    DEBUG 2008-03-19 22:44:32,136 [main] org.apache.axis.i18n.ProjectResourceBundle: org.apache.axis.i18n.resource::handleGetObject(odd Digits00)
    DEBUG 2008-03-19 22:44:32,136 [main] org.apache.axis.i18n.ProjectResourceBundle: org.apache.axis.i18n.resource::handleGetObject(bad Chars01)
    DEBUG 2008-03-19 22:44:32,293 [main] org.apache.axis.encoding.ser.JAFDataHandlerDeseria lizerFactory: Enter/Exit: JAFDataHandlerDeserializerFactory(class java.awt.Image, {http://xml.apache.org/xml-soap}Image)
    DEBUG 2008-03-19 22:44:32,293 [main] org.apache.axis.encoding.ser.JAFDataHandlerDeseria lizerFactory: Enter/Exit: JAFDataHandlerDeserializerFactory(class javax.mail.internet.MimeMultipart, {http://xml.apache.org/xml-soap}Multipart)
    DEBUG 2008-03-19 22:44:32,293 [main] org.apache.axis.encoding.ser.JAFDataHandlerDeseria lizerFactory: Enter/Exit: JAFDataHandlerDeserializerFactory(interface javax.xml.transform.Source, {http://xml.apache.org/xml-soap}Source)
    DEBUG 2008-03-19 22:44:32,293 [main] org.apache.axis.encoding.ser.JAFDataHandlerDeseria lizerFactory: Enter/Exit: JAFDataHandlerDeserializerFactory(class org.apache.axis.attachments.OctetStream, {http://xml.apache.org/xml-soap}octet-stream)
    DEBUG 2008-03-19 22:44:32,293 [main] org.apache.axis.encoding.ser.JAFDataHandlerDeseria lizerFactory: Enter/Exit: JAFDataHandlerDeserializerFactory()
    DEBUG 2008-03-19 22:44:32,418 [main] org.apache.axis.AxisEngine: Exit: AxisEngine::init
    DEBUG 2008-03-19 22:44:32,418 [main] org.springframework.remoting.jaxrpc.JaxRpcPortProx yFactoryBean: Using JAX-RPC dynamic calls for JAX-RPC port [{http://www.openuri.org/}AttachmentsSoap]
    DEBUG 2008-03-19 22:44:32,433 [main] org.springframework.core.CollectionFactory: Creating [java.util.IdentityHashMap]
    DEBUG 2008-03-19 22:44:32,433 [main] org.springframework.aop.framework.JdkDynamicAopPro xy: Creating JDK dynamic proxy: target source is EmptyTargetSource: no target class
    DEBUG 2008-03-19 22:44:32,496 [main] org.springframework.beans.factory.support.DefaultL istableBeanFactory: Creating shared instance of singleton bean 'service'
    DEBUG 2008-03-19 22:44:32,496 [main] org.springframework.beans.factory.support.DefaultL istableBeanFactory: Creating instance of bean 'service' with merged definition [Root bean: class [com.tony.service.TestWebService]; scope=singleton; abstract=false; lazyInit=false; autowireCandidate=true; autowireMode=0; dependencyCheck=0; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in class path resource [applicationContext.xml]]
    DEBUG 2008-03-19 22:44:32,496 [main] org.springframework.beans.CachedIntrospectionResul ts: Getting BeanInfo for class [com.tony.service.TestWebService]
    DEBUG 2008-03-19 22:44:32,496 [main] org.springframework.beans.CachedIntrospectionResul ts: Caching PropertyDescriptors for class [com.tony.service.TestWebService]
    DEBUG 2008-03-19 22:44:32,496 [main] org.springframework.beans.CachedIntrospectionResul ts: Found bean property 'class' of type [java.lang.Class]
    DEBUG 2008-03-19 22:44:32,496 [main] org.springframework.beans.CachedIntrospectionResul ts: Found bean property 'service' of type [org.openuri.www.AttachmentsSoap]
    DEBUG 2008-03-19 22:44:32,496 [main] org.springframework.core.CollectionFactory: Creating [java.util.LinkedHashMap]
    DEBUG 2008-03-19 22:44:32,496 [main] org.springframework.beans.factory.support.DefaultL istableBeanFactory: Eagerly caching bean 'service' to allow for resolving potential circular references
    DEBUG 2008-03-19 22:44:32,496 [main] org.springframework.beans.factory.support.DefaultL istableBeanFactory: Returning cached instance of singleton bean 'attachmentService'
    DEBUG 2008-03-19 22:44:32,496 [main] org.springframework.core.CollectionFactory: Creating [java.util.LinkedHashSet]
    INFO 2008-03-19 22:44:32,511 [main] org.springframework.beans.factory.support.DefaultL istableBeanFactory: Destroying singletons in org.springframework.beans.factory.support.DefaultL istableBeanFactory@b1c5fa: defining beans [helloWorld,helloAdvice,aop,advisor,attachmentServi ce,service]; root of factory hierarchy

    Caused by: org.springframework.beans.PropertyBatchUpdateExcep tion; nested PropertyAccessException details (1) are:
    PropertyAccessException 1:
    org.springframework.beans.TypeMismatchException: Failed to convert property value of type [$Proxy0] to required type [org.openuri.www.AttachmentsSoap] for property 'service'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [$Proxy0] to required type [org.openuri.www.AttachmentsSoap] for property 'service': no matching editors or conversion strategy found
    Caused by: java.lang.IllegalArgumentException: Cannot convert value of type [$Proxy0] to required type [org.openuri.www.AttachmentsSoap] for property 'service': no matching editors or conversion strategy found
    at org.springframework.beans.TypeConverterDelegate.co nvertIfNecessary(TypeConverterDelegate.java:231)
    at org.springframework.beans.TypeConverterDelegate.co nvertIfNecessary(TypeConverterDelegate.java:138)
    at org.springframework.beans.BeanWrapperImpl.setPrope rtyValue(BeanWrapperImpl.java:815)
    at org.springframework.beans.BeanWrapperImpl.setPrope rtyValue(BeanWrapperImpl.java:645)
    at org.springframework.beans.AbstractPropertyAccessor .setPropertyValues(AbstractPropertyAccessor.java:7 8)
    at org.springframework.beans.AbstractPropertyAccessor .setPropertyValues(AbstractPropertyAccessor.java:5 9)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.applyPropertyValues(Abs tractAutowireCapableBeanFactory.java:1122)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.populateBean(AbstractAu towireCapableBeanFactory.java:857)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:423)
    at org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 49)
    at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:155)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:246)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:160)
    at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:291)
    at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:352)
    at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:122)
    at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:66)
    at com.tony.service.TestWebService.main(TestWebServic e.java:34)


    The corresponding configuration file is as follows,

    <bean
    class="org.springframework.remoting.jaxrpc.JaxRpcP ortProxyFactoryBean"
    id="attachmentService">
    <property name="serviceFactoryClass">
    <value>org.apache.axis.client.ServiceFactory</value>
    </property>
    <property name="wsdlDocumentUrl">
    <value>http://anto.techmahindra.com:8080/ripple/service/AttachmentService?wsdl</value>
    </property>
    <property name="namespaceUri">
    <value>http://www.openuri.org/</value>
    </property>
    <property name="serviceInterface">
    <value>com.bt.btw.ripple.attachment.Attachments</value>
    </property>
    <property name="jaxRpcServiceInterface">
    <value>com.bt.btw.ripple.attachment.Attachments</value>
    </property>
    <property name="portName">
    <value>AttachmentsSoap</value>
    </property>


    </bean>
    <bean id="service" class="com.tony.service.TestWebService">
    <property name="service" ref="attachmentService"></property>
    </bean>
    </beans>

    Please help me out, Thanks in advance...

  • #2
    Hi there,

    Can you confirm that the org.openuri.www.AttachmentsSoap class/interface implements/extends com.bt.btw.ripple.attachment.Attachments? This is the most obvious explanation, so it'd be good to rule it out before exploring complex possibilities. =)

    Thanks.

    Comment


    • #3
      Perhaps org.openuri.www.AttachmentsSoap is a concret class that got proxied? This type of exception usually indicates that. If its a concrete class, then perhaps you need to use cglib to proxy classes instead of using JDK proxies.

      Comment


      • #4
        Originally posted by Chris Davies View Post
        Hi there,

        Can you confirm that the org.openuri.www.AttachmentsSoap class/interface implements/extends com.bt.btw.ripple.attachment.Attachments? This is the most obvious explanation, so it'd be good to rule it out before exploring complex possibilities. =)

        Thanks.

        AttachmentsSoap is an portName, it extends java.rmi.Remote as it is supposed to be. Attachments is a service name which contains methods to return Attachements soap.
        If you would like me to post WSDL file, I would be happy to post it for you.

        Comment


        • #5
          Originally posted by wpoitras View Post
          Perhaps org.openuri.www.AttachmentsSoap is a concret class that got proxied? This type of exception usually indicates that. If its a concrete class, then perhaps you need to use cglib to proxy classes instead of using JDK proxies.
          How do we choose cglib instead of JDK proxy? I have included cglib in my classpath.

          Comment


          • #6
            Well, this is pretty much what the error message is saying to you: "You want to inject a org.openuri.www.AttachmentsSoap instance to the 'service' property, but I only have a $Proxy0, which doesn't have a compatible interface."

            The interface that the $Proxy0 implements is com.bt.btw.ripple.attachment.Attachments, as this is what's specified as the 'serviceInterface' property of the bean factory that produces it.

            From this information, it seems to me that we can deduce that com.bt.btw.ripple.attachment.Attachments can't be cast to org.openuri.www.AttachmentsSoap - and this is the fundamental problem.

            As far as I can tell, it's not possible to instruct the JaxRpcPortProxyFactoryBean to explicitly use a different proxy strategy... someone else probably knows better than me on this though.

            I wish I had more experience playing around with SOAP stuff in Spring so I could actually help instead of guessing... I'll keep an eye on this thread though, since it's interesting to see what the fix is!

            Comment


            • #7
              When the object is proxied you need to set proxyTargetClass to be true. I'm not sure how the object is proxied, so I'm not sure where you would set it.

              Comment


              • #8
                Problem solved

                When I set AttachmentSoap which is the port Interface, as the service interface; it solves the problem. It probably arose out of my misunderstanding of the word service interface.

                Comment

                Working...
                X