zoukankan      html  css  js  c++  java
  • 异常HTTP Status 500

    Exception report

    message Illegal access to constructor, is it public?

    description The server encountered an internal error that prevented it from fulfilling this request.

    exception

    Illegal access to constructor, is it public?
    	com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:297)
    	com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:393)
    	com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:194)
    	org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:63)
    	org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39)
    	com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:58)
    	org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:534)
    	org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
    	org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)
    

    root cause

    java.lang.IllegalAccessException: Class com.opensymphony.xwork2.ObjectFactory can not access a member of class action.CoreAction with modifiers ""
    	sun.reflect.Reflection.ensureMemberAccess(Reflection.java:109)
    	java.lang.Class.newInstance(Class.java:368)
    	com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:131)
    	com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:162)
    	com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:151)
    	com.opensymphony.xwork2.ObjectFactory.buildAction(ObjectFactory.java:121)
    	com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:293)
    	com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:393)
    	com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:194)
    	org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:63)
    	org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39)
    	com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:58)
    	org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:534)
    	org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
    	org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)
    解决办法:有两个办法

    1、原因是 自己的粗心造成的你的javaBean忘记写public关键字了

    解决方法:javaBean类前加上public的修饰符

    2、原因是 Class com.opensymphony.xwork2.ObjectFactory与JavaBean不在同一个包下,java的默认修饰符范围在同一个包下

    解决方法:javaBean的构造方法不写或者加个public的修饰符

  • 相关阅读:
    位图索引(Bitmap Index)的故事
    Oracle 用户管理
    Linux中hosts文件的修改
    oracle 错误码 ORA-00119 / ORA-00130
    Oracle 外键约束
    Oracle Basic Ready Notes
    SQL语句Tips
    AWK 简明教程
    JObject对json的操作
    C#Stopwatch的使用,性能测试
  • 原文地址:https://www.cnblogs.com/XiDaPuBen/p/8723103.html
Copyright © 2011-2022 走看看