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

  • UnsatisfiedDependencyException

    Hi,

    I seem to have problems running the latest XFire with Spring.

    the spring xml file supplied with XFire is buggy on my machine, so I'm trying to fix it, but can't understand where the problem comes :

    Code:
      <bean id="xfire.serviceRegistry" class="org.codehaus.xfire.service.DefaultServiceRegistry"
        singleton="true" />
    
      <bean id="xfire.transportManager" class="org.codehaus.xfire.transport.DefaultTransportManager"
        singleton="true">
        <constructor-arg index="0">
          <ref bean="xfire.serviceRegistry" />
        </constructor-arg>
      </bean>
    
      <bean id="xfire" class="org.codehaus.xfire.DefaultXFire" singleton="true">
        <constructor-arg index="0">
          <ref bean="xfire.serviceRegistry" />
        </constructor-arg>
        <constructor-arg index="1">
          <ref bean="xfire.transportManager" />
        </constructor-arg>
      </bean>
    
      <bean id="xfire.typeMappingRegistry"
        class="org.codehaus.xfire.aegis.type.DefaultTypeMappingRegistry"
        init-method="createDefaultMappings" singleton="true">
      </bean>
    
      <bean id="xfire.aegisBindingProvider" class="org.codehaus.xfire.aegis.AegisBindingProvider"
        singleton="true">
        <constructor-arg index="0">
          <ref bean="xfire.typeMappingRegistry" />
        </constructor-arg>
      </bean>
    
      <bean id="xfire.serviceFactory" class="org.codehaus.xfire.service.binding.ObjectServiceFactory"
        singleton="true">
        <constructor-arg index="0">
          <ref bean="xfire.transportManager" />
        </constructor-arg>
        <constructor-arg index="1">
          <ref bean="xfire.aegisBindingProvider" />
        </constructor-arg>
      </bean>
    
      <bean id="xfire.messageServiceFactory"
        class="org.codehaus.xfire.service.binding.ObjectServiceFactory">
        <constructor-arg index="0" ref="xfire.transportManager" />
        <constructor-arg index="1" ref="xfire.messageBindingProvider" />
        <property name="style" value="message" />
      </bean>
    
      <bean id="xfire.messageBindingProvider"
        class="org.codehaus.xfire.service.binding.MessageBindingProvider" />
    
      <bean id="xfire.servletController"
        class="org.codehaus.xfire.transport.http.XFireServletController" singleton="true">
        <constructor-arg index="0">
          <ref bean="xfire" />
        </constructor-arg>
      </bean>
    The bean that has problems is the xfire.servletController. When I remove its definition, my WebContext loads without any problem. When I add it, it gives me this exception :
    org.springframework.beans.factory.UnsatisfiedDepen dencyException: Error creating
    bean with name 'xfire.servletController' defined in class path resource [spring
    /xfire.xml]: Unsatisfied dependency expressed through constructor argument with
    index 1 of type [javax.servlet.ServletContext]: Ambiguous constructor argument t
    ypes - did you specify the correct bean references as generic constructor argume
    nts?

    Does anyone have any idea where it could come from ?

    the XfireServletController class is described at :
    http://xfire.codehaus.org/maven/xfir...ontroller.html

    and its only constructor argument is of type XFire, which is implemented by DefaultXFire .
    So, I really can't see where the probmel comes from.

    Thanks a lot for any help
    Regards,
    Sami Dalouche

  • #2
    I get that exception if I have two constructor-args with the same index, but it doesn't look like you have that problem.....

    Comment


    • #3
      Originally posted by yatesco
      I get that exception if I have two constructor-args with the same index, but it doesn't look like you have that problem.....
      This problem is really weird because I seem to be the only guy on earth to have this problem. Tons of users seem to use XFire SOAP support without any problem, and I can't even deploy it because of this Spring error...

      Comment


      • #4
        Are you 100% sure there is not in fact an older version of XFire somewhere in your classpath (look in your servlet container's lib dir for example), which possibly is being picked up (and has a constructor with two arguments)?

        Comment


        • #5
          This is definitely what is happening here. You are actually instantiating an old version of XFire, which is somewhere on your classpath: The constructor in this class changed some time back in February. See here:

          http://cvs.xfire.codehaus.org/viewre...?r1=1.7&r2=1.8

          Comment


          • #6
            Originally posted by Colin Sampaleanu
            This is definitely what is happening here. You are actually instantiating an old version of XFire, which is somewhere on your classpath: The constructor in this class changed some time back in February. See here:

            http://cvs.xfire.codehaus.org/viewre...?r1=1.7&r2=1.8
            Waouh !!! It was exactly the problem, since geronimo stores an old version of xfire in its repository..
            Really nice guess, congrats, and thank you very much !! Your help has been very useful to me!

            Sami Dalouche

            Comment

            Working...
            X