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的修饰符

  • 相关阅读:
    四轴无人机原理
    python中同步、多线程、异步IO、多线程对IO密集型的影响
    匿名四轴上位机使用手册
    python异步编程--回调模型(selectors模块)
    Python多线程异步任务队列
    jenkins配置邮箱服务器(126邮箱)
    We wanted {"required":["value"]} and you sent ["text","value","id","sessionId"]
    Updates were rejected because the remote contains work that you do
    Git更新代码
    Git 从github克隆文件至本地
  • 原文地址:https://www.cnblogs.com/XiDaPuBen/p/8723103.html
Copyright © 2011-2022 走看看