No mapping found for dependency [type=com.opensymphony.xwork2.ObjectFactory, nam

5580 단어
1. 먼저 이상 붙이기
   
2011-11-04 13:51:35 [main:5015] - [ERROR] Dispatcher initialization failed
com.opensymphony.xwork2.inject.DependencyException: com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException: No mapping found for dependency [type=com.opensymphony.xwork2.ObjectFactory, name='default'] in public void com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.setObjectFactory(com.opensymphony.xwork2.ObjectFactory).
	at com.opensymphony.xwork2.inject.ContainerImpl.addInjectorsForMembers(ContainerImpl.java:144)
	at com.opensymphony.xwork2.inject.ContainerImpl.addInjectorsForMethods(ContainerImpl.java:113)
	at com.opensymphony.xwork2.inject.ContainerImpl.addInjectors(ContainerImpl.java:90)
	at com.opensymphony.xwork2.inject.ContainerImpl.addInjectors(ContainerImpl.java:86)
	at com.opensymphony.xwork2.inject.ContainerImpl$1.create(ContainerImpl.java:71)
	at com.opensymphony.xwork2.inject.ContainerImpl$1.create(ContainerImpl.java:67)
	at com.opensymphony.xwork2.inject.util.ReferenceCache$CallableCreate.call(ReferenceCache.java:150)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at com.opensymphony.xwork2.inject.util.ReferenceCache.internalCreate(ReferenceCache.java:76)
	at com.opensymphony.xwork2.inject.util.ReferenceCache.get(ReferenceCache.java:116)
	at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:483)
	at com.opensymphony.xwork2.inject.ContainerImpl$6.call(ContainerImpl.java:523)
	at com.opensymphony.xwork2.inject.ContainerImpl$6.call(ContainerImpl.java:521)
	at com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:574)
	at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:521)
	at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:203)
	at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)
	at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:380)
	at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:424)
	at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:69)
	at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)
	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:295)
	at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)
	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:115)
	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4071)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4725)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
	at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1079)
	at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1002)
	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:506)
	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1315)
	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1061)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
	at org.apache.catalina.core.StandardService.start(StandardService.java:525)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

 
 
2. 이상을 일으키는 원인
    web.xml 파일에서struts2가 불러오는 프로필을 설정할 때 sturts2가 기본적으로 불러올 파일이 없습니다.
 
3. 솔루션
프로필에 기본적으로 불러올 파일을 설정합니다. 이 파일들은 반드시 있는 것은 아니지만 적어서 찾을 수 없는 것을 찾으면 상관없습니다.
<!-- Struts2  -->
<filter>
    <filter-name>struts2</filter-name>
    <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
    <!--   -->
    <init-param>
        <param-name>config</param-name>
        <param-value>platform-web.xml,struts-default.xml,struts-plugin.xml,resources/struts/struts.xml</param-value>
    </init-param>
</filter>

좋은 웹페이지 즐겨찾기