TerrenceTian
2013-05-11 17:23
采纳率: 50%
浏览 381
已采纳

整合ssh时发生错误信息Dispatcher initialization failed Unable to load configuration. -

五月 11, 2013 5:16:55 下午 org.apache.catalina.core.AprLifecycleListener init
INFO: Loaded APR based Apache Tomcat Native library 1.1.27 using APR version 1.4.6.
五月 11, 2013 5:16:55 下午 org.apache.catalina.core.AprLifecycleListener init
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
五月 11, 2013 5:16:55 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:springtest' did not find a matching property.
五月 11, 2013 5:16:56 下午 org.apache.catalina.core.AprLifecycleListener initializeSSL
INFO: OpenSSL successfully initialized (OpenSSL 1.0.1d 5 Feb 2013)
五月 11, 2013 5:16:56 下午 org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-apr-8080"]
五月 11, 2013 5:16:56 下午 org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-apr-8009"]
五月 11, 2013 5:16:56 下午 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1980 ms
五月 11, 2013 5:16:56 下午 org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
五月 11, 2013 5:16:56 下午 org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.39
五月 11, 2013 5:17:01 下午 org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
五月 11, 2013 5:17:02 下午 org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
17:17:06,557 ERROR Dispatcher:38 - Dispatcher initialization failed
Unable to load configuration. - [unknown location]
    at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:70)
    at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:429)
    at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:471)
    at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
    at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)
    at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:281)
    at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:262)
    at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:107)
    at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4746)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5399)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
    at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: Cannot locate the chosen ObjectFactory implementation: spring - [unknown location]
    at org.apache.struts2.config.BeanSelectionProvider.alias(BeanSelectionProvider.java:391)
    at org.apache.struts2.config.BeanSelectionProvider.alias(BeanSelectionProvider.java:362)
    at org.apache.struts2.config.BeanSelectionProvider.register(BeanSelectionProvider.java:288)
    at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:215)
    at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
    ... 17 more
五月 11, 2013 5:17:06 下午 org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter struts2
Unable to load configuration. - [unknown location]
    at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:483)
    at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
    at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)
    at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:281)
    at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:262)
    at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:107)
    at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4746)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5399)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
    at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: Unable to load configuration. - [unknown location]
    at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:70)
    at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:429)
    at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:471)
    ... 15 more
Caused by: Cannot locate the chosen ObjectFactory implementation: spring - [unknown location]
    at org.apache.struts2.config.BeanSelectionProvider.alias(BeanSelectionProvider.java:391)
    at org.apache.struts2.config.BeanSelectionProvider.alias(BeanSelectionProvider.java:362)
    at org.apache.struts2.config.BeanSelectionProvider.register(BeanSelectionProvider.java:288)
    at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:215)
    at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
    ... 17 more

五月 11, 2013 5:17:06 下午 org.apache.catalina.core.StandardContext startInternal
SEVERE: Error filterStart
五月 11, 2013 5:17:06 下午 org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/springtest] startup failed due to previous errors
五月 11, 2013 5:17:06 下午 org.apache.catalina.core.ApplicationContext log
INFO: Closing Spring root WebApplicationContext
五月 11, 2013 5:17:06 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
SEVERE: The web application [/springtest] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
五月 11, 2013 5:17:06 下午 org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-apr-8080"]
五月 11, 2013 5:17:06 下午 org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-apr-8009"]
五月 11, 2013 5:17:06 下午 org.apache.catalina.startup.Catalina start
INFO: Server startup in 9955 ms
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
    "http://struts.apache.org/dtds/struts-2.3.dtd">

<struts>

    <constant name="struts.devMode" value="true" />
    <constant name="struts.i18n.encoding" value="UTF-8"/>
    <constant name="struts.objectFactory" value="spring"/>

    <package name="user" namespace="/user" extends="struts-default">
        <action name="user" class="userAction">
            <result name="SUCCESS">/list.jsp</result>
            <result name="ERROR">/error.jsp</result>
        </action>
    </package>

</struts>

 在整合ssh时发生以上错误,我main方法测试过spring3.2.2+hibernate4没有问题,数据可以正常新增。但与struts2整合时,发生了错误。

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

3条回答 默认 最新

  • liuzhao_ 2013-05-12 08:38
    已采纳

    应该是缺少一个被spring托管的包,spring和其他框架整合时,都需要初始化其最核心的服务,Dispatcher 配置初始化失败,就可能是【Struts2-Spring-plugin.jar】这个包有问题。如果没有就引用一下,有的话是否是版本的问题造成的。

    点赞 打赏 评论
  • zyn010101 2013-05-11 22:06

    把 去掉试试

    点赞 打赏 评论
  • lao19884wang 2013-05-12 05:02

    24.Unable to load configuration. - [unknown location]

    25. at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:70)

    配置文件没有被加载

    configuration 貌似是hibernate的配置文件 没有被加载 楼主 要不你把整合的配置文件全部贴出来

    点赞 打赏 评论

相关推荐 更多相似问题