一、异常日志
2015-10-4 21:16:54 org.apache.catalina.core.StandardContext filterStart@b@严重: Exception starting filter struts2@b@Cannot locate the chosen ObjectFactory implementation: spring - [unknown location]@b@ at org.apache.struts2.config.BeanSelectionProvider.alias(BeanSelectionProvider.java:224)@b@ at org.apache.struts2.config.BeanSelectionProvider.alias(BeanSelectionProvider.java:195)@b@ at org.apache.struts2.config.BeanSelectionProvider.register(BeanSelectionProvider.java:153)@b@ at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload(DefaultConfiguration.java:131)@b@ at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:52)@b@ at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:395)@b@ at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:452)@b@ at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:205)@b@ at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:295)@b@ at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)@b@ at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:115)@b@ at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4001)@b@ at org.apache.catalina.core.StandardContext.start(StandardContext.java:4651)@b@ at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)@b@ at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)@b@ at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)@b@ at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)@b@ at org.apache.catalina.startup.Embedded.start(Embedded.java:825)@b@ at org.codehaus.mojo.tomcat.AbstractRunMojo.startContainer(AbstractRunMojo.java:558)@b@ at org.codehaus.mojo.tomcat.AbstractRunMojo.execute(AbstractRunMojo.java:255)@b@ at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:107)@b@ at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)@b@ at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)@b@ at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)@b@ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)@b@ at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)@b@ at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)@b@ at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)@b@ at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)@b@ at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)@b@ at org.apache.maven.cli.MavenCli.execute(MavenCli.java:534)@b@ at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)@b@ at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)@b@ at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)@b@ at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)@b@ at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)@b@ at java.lang.reflect.Method.invoke(Method.java:597)@b@ at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)@b@ at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)@b@ at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)@b@ at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)@b@2015-10-4 21:16:54 org.apache.catalina.core.StandardContext start@b@严重: Error filterStart@b@2015-10-4 21:16:54 org.apache.catalina.core.StandardContext start@b@严重: Context [/cvp_oms] startup failed due to previous errors@b@2015-10-4 21:16:54 org.apache.catalina.core.ApplicationContext log
二、解决问题
1. maven项目在pom添加依赖,如下所示
<dependency>@b@ <groupId>org.apache.struts</groupId>@b@ <artifactId>struts2-json-plugin</artifactId>@b@ <version>2.2.1</version>@b@ </dependency> @b@ <dependency>@b@ <groupId>org.apache.struts</groupId>@b@ <artifactId>struts2-plugins</artifactId>@b@ <version>2.0.14</version>@b@ </dependency>
2. web项目,复制struts2-spring-plugin-2.0.14.jar、struts2-json-plugin-2.2.1.jar、struts2-core-2.0.14.jar到lib目录下面去