Announcement Announcement Module
Collapse
No announcement yet.
stupid little problem with factory Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • stupid little problem with factory

    Hi,

    when I try this :
    Code:
    <bean id="connFactory" class="oracle.jms.AQjmsFactory" 
    		factory-method="getQueueConnectionFactory" >
    		<constructor-arg>
    			<value>host</value>
    		</constructor-arg>
    		<constructor-arg>
    			<value>db</value>
    		</constructor-arg>
    		<constructor-arg type="int">
    			<value>1234</value>
    		</constructor-arg>
    		<constructor-arg>
    			<value>thin</value>
    		</constructor-arg>
    </bean> 
    <bean id="jmsConnector" class="org.mule.providers.jms.JmsConnector">
    	<property name="acknowledgementMode">
    			<value>1</value>
    	</property>
    	<property name="connectionFactory">
    			<ref local="connFactory" />
           </property>
    </bean>
    I get this error :
    Code:
    org.springframework.beans.factory.BeanDefinitionStoreException&#58; Cannot find matching factory method 'getQueueConnectionFactory' on class class oracle.jms.AQjmsFactory
    This method exists and returns a QueueConnectionFactory while the JmsConnector expects a ConnectionFactory. But QueueConnectionFactory is a ConnectionFactory, so shouldn't this work ?

    from the javadoc :
    Code:
    AQjmsFactory &#58;
    static javax.jms.QueueConnectionFactory 	getQueueConnectionFactory&#40;java.lang.String hostname, java.lang.String oracle_sid, int portno, java.lang.String driver&#41;
    JMSConnector :
    Code:
     void 	setConnectionFactory&#40;ConnectionFactory connectionFactory&#41;
    What am I doing wrong ?

    Thanks ,

    Henk

  • #2
    What Spring version are you using?
    You can help Spring resolve the method to call (as AQjmsFactory has two getQueueConnectionFactory) by providing property index or type in constructor-arg:
    Code:
    <bean id="connFactory" class="oracle.jms.AQjmsFactory" 
          factory-method="getQueueConnectionFactory" > 
          <constructor-arg index="0"> 
             <value>host</value> 
          </constructor-arg> 
          <constructor-arg index="1"> 
             <value>db</value> 
          </constructor-arg> 
          <constructor-arg  index="2"> 
             <value>1234</value> 
          </constructor-arg> 
          <constructor-arg index="3"> 
             <value>thin</value> 
          </constructor-arg> 
    </bean>
    HTH

    Comment


    • #3
      Thanks ! It works now.

      Henk

      Originally posted by irbouho
      What Spring version are you using?
      You can help Spring resolve the method to call (as AQjmsFactory has two getQueueConnectionFactory) by providing property index or type in constructor-arg:
      Code:
      <bean id="connFactory" class="oracle.jms.AQjmsFactory" 
            factory-method="getQueueConnectionFactory" > 
            <constructor-arg index="0"> 
               <value>host</value> 
            </constructor-arg> 
            <constructor-arg index="1"> 
               <value>db</value> 
            </constructor-arg> 
            <constructor-arg  index="2"> 
               <value>1234</value> 
            </constructor-arg> 
            <constructor-arg index="3"> 
               <value>thin</value> 
            </constructor-arg> 
      </bean>
      HTH

      Comment

      Working...
      X