在log4j info级别下不会出现,debug下就会出现:
No bean named 'org.apache.struts2.dispatcher.ServletDispatcherResult' found in org.springframework.beans.factory.support.DefaultListableBeanFactory@1958bf9:defining beans [propertyConfigurer,dataSource,sessionFactory,jbpmConfiguration,transactionManager,txAdvice,org.springframework.aop.config.internalAutoProxyCreator,allServiceMethod,org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0,personService,PersonAction,personDao]; root of factory hierarchy
Ignoring constructor [public org.apache.struts2.dispatcher.ServletDispatcherResult(java.lang.String)] of bean 'org.apache.struts2.dispatcher.ServletDispatcherResult': org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.apache.struts2.dispatcher.ServletDispatcherResult': Unsatisfied dependency expressed through constructor argument with index 0 of type [java.lang.String]: : No unique bean of type [java.lang.String] is defined: Unsatisfied dependency of type [class java.lang.String]: expected at least 1 matching bean; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [java.lang.String] is defined: Unsatisfied dependency of type [class java.lang.String]: expected at least 1 matching bean运行完全正常, 配置文件好像也没问题。 请大侠们帮忙找一下问题所在, 拜托了

解决方案 »

  1.   

    No bean named 'org.apache.struts2.dispatcher.
    大哥   还是认真看下你配置文件吧   或是你导入的东西   说的很明显了 找不到那个逗号
      

  2.   

    你的struts 配置文件不对。 拦截器。。 
      

  3.   


    能说具体点吗?  我检查了下struts2的配置文件,好像没啥问题<struts>
    <package name="person" extends="base">
    <action name="personAction" class="PersonAction">
    <result>/common/success.jsp</result>
    </action>
    </package>
    </struts>struts-base.xml如下:<?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
    "http://struts.apache.org/dtds/struts-2.0.dtd">
    <struts>
    <package name="base" extends="struts-default">
    <global-results>
    <result>/common/success.jsp</result>
    <result name="error">/common/error.jsp</result>
    <result name="input">/common/input.jsp</result>
    </global-results>
    <global-exception-mappings>
    <exception-mapping result="error" exception="com.lx.cc.exception.SystemException" />
    </global-exception-mappings>
    </package>
    </struts>
      

  4.   

    spring中配置的某个bean注入的类型有问题?
      

  5.   


    没有问题啊。 PersonAction中就只放了一句return ...
      

  6.   

    web.xml 的strtus 拦截器配置错了吧~~2.0左右的版本是跟2.1以上的有点不同的具体的看struts包的例子.
      

  7.   

    <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>
    classpath:spring/spring-application.xml
    </param-value>
    </context-param>


    <listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

        <listener>   
            <listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class>   
        </listener>    <listener>
            <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
        </listener> <filter>
    <filter-name>lazyLoadingFilter</filter-name>
    <filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
    </filter>
    <filter>
    <filter-name>struts2</filter-name>
    <filter-class>
    org.apache.struts2.dispatcher.FilterDispatcher
    </filter-class>
    </filter>
    <filter>
    <filter-name>encodingFilter</filter-name>
    <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
    <init-param>
    <param-name>encoding</param-name>
    <param-value>UTF-8</param-value>
    </init-param>
    </filter>

    <filter-mapping>
    <filter-name>lazyLoadingFilter</filter-name>
    <url-pattern>*.action</url-pattern>
    </filter-mapping>
    <filter-mapping>
    <filter-name>struts2</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping>