`
jerryzxm
  • 浏览: 48966 次
  • 性别: Icon_minigender_1
  • 来自: 天津
社区版块
存档分类
最新评论

OgnlException: target is null for setProperty

阅读更多

1. form提交的action错误

2. 没有getter/setter方法

3. 没有无参的构造函数

 

 

[WARN ] [10:00:22] com.opensymphony.xwork2.ognl.OgnlValueStack - Error setting expression 'post.content' with value '[Ljava.lang.String;@1fba8a1'
ognl.OgnlException: target is null for setProperty(null, "content", [Ljava.lang.String;@1fba8a1)
	at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:2219)
	at ognl.ASTProperty.setValueBody(ASTProperty.java:127)
	at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:220)
	at ognl.SimpleNode.setValue(SimpleNode.java:301)
	at ognl.ASTChain.setValueBody(ASTChain.java:227)
	at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:220)
	at ognl.SimpleNode.setValue(SimpleNode.java:301)
	at ognl.Ognl.setValue(Ognl.java:737)
	at com.opensymphony.xwork2.ognl.OgnlUtil.setValue(OgnlUtil.java:198)
	at com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:161)
	at com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:149)
	at com.opensymphony.xwork2.interceptor.ParametersInterceptor.setParameters(ParametersInterceptor.java:276)
	at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:187)
	at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
	at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)
	at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
	at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:179)
	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
	at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)
	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
	at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)
	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
	at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235)
	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
	at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89)
	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
	at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:130)
	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
	at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)
	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
	at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126)
	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
	at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138)
	at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
	at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:165)
	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
	at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
	at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:179)
	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
	at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)
	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
	at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
	at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488)
	at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
	at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:343)
	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
	at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
	at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:100)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
	at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:78)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
	at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
	at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:35)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
	at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:177)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
	at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:188)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
	at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
	at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
	at org.springframework.security.web.session.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:109)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
	at org.springframework.security.web.access.channel.ChannelProcessingFilter.doFilter(ChannelProcessingFilter.java:109)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:355)
	at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:149)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:216)
	at org.apache.coyote.http11.Http11NioProcessor.process(Http11NioProcessor.java:888)
	at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:624)
	at org.apache.tomcat.util.net.NioEndpoint$Worker.run(NioEndpoint.java:1465)
	at java.lang.Thread.run(Thread.java:619)
分享到:
评论
1 楼 quanwsx 2011-05-03  
log4j.logger.com.opensymphony.xwork2=ERROR

相关推荐

    解决mybatis-plus3.1.1版本使用lambda表达式查询报错的方法

    错误日志显示的是一个`MybatisPlusException`,提示“Your property named 'username' cannot find the corresponding database column name!”,这意味着MyBatis-Plus在尝试映射Java对象的属性(如`username`)到...

    STRUTS2.1z中的OGNL的表达式

    - **条件判断和循环**:OGNL支持if-else、for循环等结构,使得页面逻辑更加灵活多变。 #### 3. OGNL表达式的语法 OGNL表达式的语法较为直观,通常以“#”开头来标识,例如: - 访问对象属性:`#{bean.property}` - ...

    Struts2 Ongl文档

    例如,`#root.name` 可以用来获取 `root` 对象的 `name` 属性,而 `#root.setName('newName')` 可以用来设置 `name` 属性。 ### 4. 方法访问器 除了属性之外,OGNL 还支持方法调用。可以使用类似于属性访问的语法...

    Struts2的OGNL详解

    - `public static void setValue(Object tree, Map context, Object root, Object value) throws OgnlException;` 这些API主要用于获取和设置表达式的值。在使用这些API之前,需要构建OGNL的上下文环境。下面是一些...

    OGNL的使用

    user.setName("张三"); try { // 创建Ognl上下文 OgnlContext context = new OgnlContext(); // 将User对象压入值栈 context.put("user", user); // 使用OGNL表达式获取name属性 String name = (String) ...

    ONGL介绍

    import ognl.OgnlException; public class OgnlTest { public static void main(String[] args) { User user = new User(); user.setName("张三"); user.setAge(25); OgnlContext context = new OgnlContext...

    ognl源码.rar

    6. **异常处理**:源码中包含了丰富的异常处理逻辑,如`OgnlException`,用于捕获和报告OGNL执行过程中的错误。 ### 应用场景 1. **Spring框架**:在Spring MVC中,OGNL用于视图层的表达式语言,例如在Thymeleaf...

    OGNL静态方法定义

    10. 错误处理和异常:在处理OGNL表达式时,可能会遇到`OgnlException`,这通常表示表达式解析或执行时出错。此外,`NullPointerException`和`ClassCastException`也可能在尝试访问不存在的属性或错误类型转换时抛出...

    JAVA导出excel文件2003版,结合具体框架的实现

    import ognl.OgnlException; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.struts2.interceptor....

    在Java的Struts框架中ONGL表达式的基础使用入门

    比如,`<s:property value="propertyname" />`标签就是通过OGNL表达式来获取Action中的属性值并显示在页面上。 总之,理解和熟练使用ONGNL对于高效地开发Struts2应用至关重要,它简化了数据绑定和表达式处理,提高...

    Java中动态规则的实现方式示例详解

    } catch (OgnlException e) { e.printStackTrace(); } ``` - MVEL:是一个强大的表达式语言,最初用于Valhalla项目,现在是Drools规则引擎的一部分。MVEL提供了丰富的语法,支持多种操作,包括编译模式和解释模式,...

    OGNL.rar_ognl api_ognl._ognl源码_ognl源码分析_ongl download

    此外,`OGNLException`类处理在解析或执行表达式时可能出现的错误。 OGNL源码分析对于学习和调试OGNL至关重要。通过源码,你可以了解OGNL如何解析复杂的对象图导航表达式,如何查找和访问对象的属性,以及如何处理...

    ognl源码及API

    当OGNL表达式执行出错时,它会抛出`OgnlException`,通常伴随着详细的错误信息,帮助开发者定位问题。此外,ognl还支持自定义类型转换和方法解析策略,以适应不同的应用场景。 在实际使用中,ognl的API提供了很多...

    ognl全部源码---特别贡献

    在执行表达式时,可能会遇到各种异常,如`OgnlException`表示OGNL特有的错误,`NullPointerException`、`IllegalArgumentException`等标准Java异常也可能出现。源码中对这些异常进行了详细的处理。 7. **安全与...

Global site tag (gtag.js) - Google Analytics