`
koudailidexiaolong
  • 浏览: 96209 次
  • 性别: Icon_minigender_1
  • 来自: 西安
社区版块
存档分类
最新评论

com/opensymphony/xwork2/spring/SpringObjectFactory.java:209:-1

 
阅读更多

今天遇到了这个问题

严重: Exception starting filter struts2
Class: com.opensymphony.xwork2.spring.SpringObjectFactory
File: SpringObjectFactory.java
Method: getClassInstance
Line: 209 - com/opensymphony/xwork2/spring/SpringObjectFactory.java:209:-1
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:431)
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:4072)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4726)
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:1317)
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:1065)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
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)
Caused by: java.lang.NullPointerException
at com.opensymphony.xwork2.spring.SpringObjectFactory.getClassInstance(SpringObjectFactory.java:209)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.verifyResultType(XmlConfigurationProvider.java:519)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addResultTypes(XmlConfigurationProvider.java:490)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:446)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:264)
at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:111)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:193)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:55)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:374)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:418)
... 29 more
2013-4-16 20:41:42 org.apache.catalina.core.StandardContext start
严重: Error filterStart
2013-4-16 20:41:42 org.apache.catalina.core.StandardContext start
严重: Context [/Book1] startup failed due to previous errors
2013-4-16 20:41:42 org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
严重: The web application [/Book1] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10@607135]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;@1a88001]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
2013-4-16 20:41:42 org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
严重: The web application [/Book1] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10@18532dc]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;@1ce1387]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
2013-4-16 20:41:43 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory docs
2013-4-16 20:41:43 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory EasyBuySystem
2013-4-16 20:41:44 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory examples
2013-4-16 20:41:44 org.apache.catalina.core.ApplicationContext log
信息: ContextListener: contextInitialized()
2013-4-16 20:41:44 org.apache.catalina.core.ApplicationContext log
信息: SessionListener: contextInitialized()
2013-4-16 20:41:44 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory ROOT
2013-4-16 20:41:45 org.apache.coyote.http11.Http11Protocol start
信息: Starting Coyote HTTP/1.1 on http-8080
2013-4-16 20:41:45 org.apache.jk.common.ChannelSocket init
信息: JK: ajp13 listening on /0.0.0.0:8009
2013-4-16 20:41:45 org.apache.jk.server.JkMain start
信息: Jk running ID=0 time=0/32 config=null
2013-4-16 20:41:45 org.apache.catalina.startup.Catalina start
信息: Server startup in 7968 ms

其实之前也遇到了这个问题 突然间想到了是没有在web里配置spring支持

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext.xml</param-value>
</context-param>
<!-- 配置监听 -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

加上这句话就好了

一时的粗心导致错误!与大家分享一哈哈哈

<wbr></wbr>
分享到:
评论

相关推荐

    java异常解决方案.docx

    * Exception starting filter struts2 Class: com.opensymphony.xwork2.spring.SpringObjectFactory + 解决方案:检查 Struts2 的配置文件是否正确,是否存在语法错误或格式不正确的问题。 * org.springframework....

    java 遇到的各种异常

    Exception starting filter struts2: Class: com.opensymphony.xwork2.spring.SpringObjectFactory** - **异常描述**:启动过滤器时出现异常。 - **原因分析**:通常是因为Struts2配置错误或类路径问题。 - **解决...

    spring与struts2的整合-src.zip

    首先,你需要在Struts2的配置文件(通常为`struts.xml`)中定义Action类,这里Action类应继承自Spring提供的`org.springframework.web.struts2.SpringAware`或`com.opensymphony.xwork2.spring.SpringObjectFactory`...

    struts2.0jar包及struts2.0与spring的整合jar包.rar

    但整合后,Action实例由Spring容器创建并管理,通过`&lt;action&gt;`标签的`class`属性设置为`com.opensymphony.xwork2.spring.SpringObjectFactory`,使得Struts2能从Spring容器获取Action实例。 4. **AOP结合**:Spring...

    struts2整合spring实现拦截器

    Struts2 和 Spring 的整合是Java Web开发中的常见实践,这两种框架的结合可以极大地提高应用的可维护性和灵活性。在本文中,我们将深入探讨如何实现Struts2与Spring的集成,以及利用拦截器来增强应用的功能。 首先...

    Struts2+Spring

    5. **Action类设计**:Action类通常需要继承自`org.springframework.web.struts2.support.SpringAware`或`com.opensymphony.xwork2.spring.SpringObjectFactory`,以便于Struts2能够利用Spring的IoC容器找到并实例化...

    Spring+Struts2整合例子

    3. **Action 类**:Action 类应继承自 Spring 提供的 `org.springframework.web.struts2.SpringAware` 或 `com.opensymphony.xwork2.spring.SpringObjectFactory` 类,这样 Struts2 就可以识别并利用 Spring 容器来...

    Struts+Spring

    5. **Action和Service**:编写Action类,通常需要实现`com.opensymphony.xwork2.ActionSupport`接口,并使用`@Autowired`注解从Spring容器中获取服务。服务层(Service)则负责业务逻辑。 ```java public class ...

    Struts2的第一个入门实例(三)--Struts2与Guice整合

    &lt;constant name="struts.objectFactory" value="com.opensymphony.xwork2.spring.SpringObjectFactory"/&gt; &lt;package name="default" extends="struts-default"&gt; &lt;interceptor-stack name="guiceStack"&gt; ...

    简易SSI框架搭建与验证

    在本文中,我们将探讨如何搭建一...&lt;bean type="com.opensymphony.xwork2.spring.SpringObjectFactory" id="strutsSpringObjectFactory"&gt; &lt;property name="applicationContext" ref="applicationContext"/&gt; &lt;/bean&gt; ...

    SSH集成代理1.2版第一种和struts.xml中DelegatingActionProxy代理搭配

    2. **配置Struts**:在`struts.xml`中,需要将Action配置为Spring管理的Bean,通常使用`&lt;action&gt;`标签的`class`属性设置为`com.opensymphony.xwork2.spring.SpringObjectFactory# springspring-proxy`。这告诉Struts...

Global site tag (gtag.js) - Google Analytics