I'm creating a javax.mail.session from the static getDefaultInstance method. the method is overloaded with 2 signatures, one with just a props, and a second with props and an authenticator. For some reason spring refuses to call just the one with a single props parameter.. here is my setup, ive tried specifiying index=0 etc, doesn't seem to help:
Log file error:Code:<bean name="javaMailSession" class="javax.mail.Session" factory-method="getDefaultInstance"> <constructor-arg> <props> <prop key="mail.smtp.auth">true</prop> <prop key="mail.smtp.host"></prop> <prop key="mail.smtp.port"></prop> <prop key="mail.smtp.user"></prop> <prop key="mail.smtp.password"></prop> </props> </constructor-arg> </bean>
Any ideas? Thanks!Code:2005-06-24 16:00:58,203 [DEBUG] support.DefaultListableBeanFactory - Ignoring factory method [public static javax.mail.Session javax.mail.Session.getDefaultInstance(java.util.Properties,javax.mail.Authenticator)] of bean 'javaMailSession': could not satisfy dependencies org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'javaMailSession' defined in ServletContext resource [/WEB-INF/spring/tecas.xml]: Unsatisfied dependency expressed through constructor argument with index 1 of type [javax.mail.Authenticator]: Ambiguous constructor argument types - did you specify the correct bean references as generic constructor arguments?


Reply With Quote