Struts2-java.lang.IllegalAccessException: Class ognl. ognlruntime can not access a member

Source: Internet
Author: User

This is a very tangled problem that I encountered. If this problem occurs for the first time, it will definitely make you quite confused. Haha

[C-sharp] view plaincopyprint? 01.2010-10-19 18:27:22 COM. opensymphony. xwork2.util. logging. JDK. jdklogger warn 02. warning: Error setting expression 'nnew. ntitle 'with value' [ljava. lang. string; @ df804e '03. ognl. nosuchpropertyexception: COM. center. VO. news_table.ntitle [Java. lang. illegalaccessexception: Class ognl. ognlruntime can not access a member of class COM. center. VO. news_table with modifiers "private"] 04. at ognl. ognlruntime. setfieldvalue (ognlruntime. java: 1663) 05. at ognl. objectpropertyaccessor. setpossibleproperty (objectpropertyaccessor. java: 87) 06. at ognl. objectpropertyaccessor. setproperty (objectpropertyaccessor. java: 162) 07. at COM. opensymphony. xwork2.ognl. accessor. objectaccessor. setproperty (objectaccessor. java: 27) 08. at ognl. ognlruntime. setproperty (ognlruntime. java: 2245) 09. at ognl. astproperty. setvaluebody (astproperty. java: 127) 10. at ognl. simplenode. evaluatesetvaluebody (simplenode. java: 220) 11. at ognl. simplenode. setvalue (simplenode. java: 301) 12. at ognl. astchain. setvaluebody (astchain. java: 227) 13. at ognl. simplenode. evaluatesetvaluebody (simplenode. java: 220) 14. at ognl. simplenode. setvalue (simplenode. java: 301) 15. at ognl. ognl. setvalue (ognl. java: 737) 16. at COM. opensymphony. xwork2.ognl. ognlutil. setvalue (ognlutil. java: 209) 17. at COM. opensymphony. xwork2.ognl. ognlvaluestack. trysetvalue (ognlvaluestack. java: 173) 18. at COM. opensymphony. xwork2.ognl. ognlvaluestack. setvalue (ognlvaluestack. java: 160) 19. at COM. opensymphony. xwork2.ognl. ognlvaluestack. setvalue (ognlvaluestack. java: 151) 20. at COM. opensymphony. xwork2.interceptor. parametersinterceptor. setparameters (parametersinterceptor. java: 288) 21. at COM. opensymphony. xwork2.interceptor. parametersinterceptor. dointercept (parametersinterceptor. java: 199) 22. at COM. opensymphony. xwork2.interceptor. methodfilterinterceptor. intercept (methodfilterinterceptor. java: 98) 23. at COM. opensymphony. xwork2.defaactionactioninvocation. invoke (defaactionactioninvocation. java: 248) 24. at COM. opensymphony. xwork2.interceptor. parametersinterceptor. dointercept (parametersinterceptor. java: 207) 25. at COM. opensymphony. xwork2.interceptor. methodfilterinterceptor. intercept (methodfilterinterceptor. java: 98) 26. at COM. opensymphony. xwork2.defaactionactioninvocation. invoke (defaactionactioninvocation. java: 248) 27. at COM. opensymphony. xwork2.interceptor. staticparametersinterceptor. intercept (staticparametersinterceptor. java: 190) 28. at COM. opensymphony. xwork2.defaactionactioninvocation. invoke (defaactionactioninvocation. java: 248) 29. at Org. apache. struts2.interceptor. multiselectinterceptor. intercept (multiselectinterceptor. java: 75) 30. at COM. opensymphony. xwork2.defaactionactioninvocation. invoke (defaactionactioninvocation. java: 248) 31. at Org. apache. struts2.interceptor. checkboxinterceptor. intercept (checkboxinterceptor. java: 94) 32. at COM. opensymphony. xwork2.defaactionactioninvocation. invoke (defaactionactioninvocation. java: 248) 33. at Org. apache. struts2.interceptor. fileuploadinterceptor. intercept (fileuploadinterceptor. java: 243) 34. at COM. opensymphony. xwork2.defaactionactioninvocation. invoke (defaactionactioninvocation. java: 248) 35. at COM. opensymphony. xwork2.interceptor. modeldriveninterceptor. intercept (modeldriveninterceptor. java: 100) 36. at COM. opensymphony. xwork2.defaactionactioninvocation. invoke (defaactionactioninvocation. java: 248) 37. at COM. opensymphony. xwork2.interceptor. scopedmodeldriveninterceptor. intercept (scopedmodeldriveninterceptor. java: 141) 38. at COM. opensymphony. xwork2.defaactionactioninvocation. invoke (defaactionactioninvocation. java: 248) 39. at Org. apache. struts2.interceptor. debugging. debugginginterceptor. intercept (debugginginterceptor. java: 267) 40. at COM. opensymphony. xwork2.defaactionactioninvocation. invoke (defaactionactioninvocation. java: 248) 41. at COM. opensymphony. xwork2.interceptor. chaininginterceptor. intercept (chaininginterceptor. java: 142) 42. at COM. opensymphony. xwork2.defaactionactioninvocation. invoke (defaactionactioninvocation. java: 248) 43. at COM. opensymphony. xwork2.interceptor. prepareinterceptor. dointercept (prepareinterceptor. java: 166) 44. at COM. opensymphony. xwork2.interceptor. methodfilterinterceptor. intercept (methodfilterinterceptor. java: 98) 45. at COM. opensymphony. xwork2.defaactionactioninvocation. invoke (defaactionactioninvocation. java: 248) 46. at COM. opensymphony. xwork2.interceptor. i18ninterceptor. intercept (i18ninterceptor. java: 176) 47. at COM. opensymphony. xwork2.defaactionactioninvocation. invoke (defaactionactioninvocation. java: 248) 48. at Org. apache. struts2.interceptor. servletconfiginterceptor. intercept (servletconfiginterceptor. (Java: 164) 49. at COM. opensymphony. xwork2.defaactionactioninvocation. invoke (defaactionactioninvocation. java: 248) 50. at COM. opensymphony. xwork2.interceptor. aliasinterceptor. intercept (aliasinterceptor. java: 190) 51. at COM. opensymphony. xwork2.defaactionactioninvocation. invoke (defaactionactioninvocation. java: 248) 52. at COM. opensymphony. xwork2.interceptor. predictionmappinginterceptor. intercept (exceptionmappinginterceptor. java: 187) 53. at COM. opensymphony. xwork2.defaactionactioninvocation. invoke (defaactionactioninvocation. java: 248) 54. at org.apache.struts2.impl.strutsactionproxy.exe cute (strutsactionproxy. java: 52) 55. at Org. apache. struts2.dispatcher. dispatcher. serviceaction (dispatcher. java: 485) 56. at Org. apache. struts2.dispatcher. filterdispatcher. dofilter (filterdispatcher. java: 395) 57. at Org. apache. catalina. core. applicationfilterchain. internaldofilter (applicationfilterchain. java: 235) 58. at Org. apache. catalina. core. applicationfilterchain. dofilter (applicationfilterchain. java: 206) 59. at Org. apache. catalina. core. standardwrappervalve. invoke (standardwrappervalve. java: 233) 60. at Org. apache. catalina. core. standardcontextvalve. invoke (standardcontextvalve. java: 191) 61. at Org. apache. catalina. core. standardhostvalve. invoke (standardhostvalve. java: 128) 62. at Org. apache. catalina. valves. errorreportvalve. invoke (errorreportvalve. java: 102) 63. at Org. apache. catalina. core. standardenginevalve. invoke (standardenginevalve. java: 109) 64. at Org. apache. catalina. connector. coyoteadapter. service (coyoteadapter. java: 293) 65. at Org. apache. coyote. http11.http11processor. process (http11processor. java: 849) 66. at Org. apache. coyote. http11.http11protocol $ http11connectionhandler. process (http11protocol. java: 583) 67. at org.apache.tomcat.util.net. jioendpoint $ worker. run (jioendpoint. java: 454) 68. at java. lang. thread. run (unknown source) 69. caused by: Java. lang. illegalaccessexception: Class ognl. ognlruntime can not access a member of class COM. center. VO. news_table with modifiers "private" 70. at sun. reflect. reflection. ensurememberaccess (unknown source) 71. at java. lang. reflect. field. dosecuritycheck (unknown source) 72. at java. lang. reflect. field. getfieldaccessor (unknown source) 73. at java. lang. reflect. field. set (unknown source) 74. at ognl. ognlruntime. setfieldvalue (ognlruntime. java: 1655)

This is because the attribute name is invalid !! As shown in the preceding error message, the set and get methods for generating attribute names such as "Ntitle" are nonstandard! Therefore, passing Parameters Using domainmodel in struts2 may cause a "misunderstanding" in struts2 "!! Is it really tangled?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.