我的应用程序在带有 Tomcat 7 和 JDK 7u6 for Mac OS X 的 Spring Tool Suite 中的 Mac OS X 上运行得很好。当我在带有 Jdk7u6 的 RHEL 6 上运行它时,相同的应用程序给了我错误
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'apiAwareAuthenticationEntryPoint' defined in class path resource [spring-security.xml]: Unsatisfied dependency expressed through constructor argument with index 0 of type [java.lang.String]: Ambiguous constructor argument types - did you specify the correct bean references as constructor arguments?
这是相关的bean参考/定义
<beans:bean id="apiAwareAuthenticationEntryPoint" class="com.example.ApiAwareAuthenticationEntryPoint">
<beans:constructor-arg name="loginUrl" value="/login" type="java.lang.String" index="0" />
</beans:bean>
这是代码片段
public class ApiAwareAuthenticationEntryPoint extends LoginUrlAuthenticationEntryPoint
{
public ApiAwareAuthenticationEntryPoint(String loginUrl)
{
super(loginUrl);
}
什么可能导致这样的问题?