Score
0
Watch 425 Star 1.3K Fork 596

点狮 / JFinalOAJavaApache-2.0 Join Repository

上传文件报错

Open
roseberry  Opened this issue

步骤:

  1. admin/admin登陆
  2. 输入图片说明
  3. 点击编辑
  4. 在弹出的详情页上点击上传,然后选择文件,确定。后台出现以下异常
    Sql: select * from sys_org where id = ?
    java.lang.NullPointerException
    at com.jfinal.plugin.activerecord.Model.save(Model.java:513)
    at com.pointlion.sys.mvc.admin.sys.attachment.AttachmentController.attachmentUpload(AttachmentController.java:112)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.jfinal.aop.Invocation.invoke(Invocation.java:73)
    at com.pointlion.sys.interceptor.MainPageTitleInterceptor.intercept(MainPageTitleInterceptor.java:43)
    at com.jfinal.aop.Invocation.invoke(Invocation.java:67)
    at com.pointlion.sys.interceptor.ExceptionInterceptor.intercept(ExceptionInterceptor.java:57)
    at com.jfinal.aop.Invocation.invoke(Invocation.java:67)
    at com.pointlion.sys.interceptor.WorkFlowHisInterceptor.intercept(WorkFlowHisInterceptor.java:11)
    at com.jfinal.aop.Invocation.invoke(Invocation.java:67)
    at com.pointlion.sys.interceptor.IfLoginInterceptor.intercept(IfLoginInterceptor.java:24)
    at com.jfinal.aop.Invocation.invoke(Invocation.java:67)
    at com.pointlion.sys.plugin.shiro.ShiroInterceptor.intercept(ShiroInterceptor.java:59)
    at com.jfinal.aop.Invocation.invoke(Invocation.java:67)
    at com.jfinal.core.ActionHandler.handle(ActionHandler.java:78)
    at com.pointlion.sys.handler.GlobalHandler.handle(GlobalHandler.java:37)
    at com.jfinal.ext.handler.UrlSkipHandler.handle(UrlSkipHandler.java:46)
    at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:73)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
    at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
    at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
    at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
    at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:387)
    at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
    at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:745)
    !!!!!!!!!!!!!!!!!错误信息!!!!!!!!!!!!!!!!!!!:null
    2019-01-20 12:50:10 ERROR [com.jfinal.core.ActionHandler.handle] - /admin/sys/attachment/attachmentUpload?busid=5480ad0cd25b47188d69ded0c0ea2549
    java.lang.NullPointerException
    at com.pointlion.sys.interceptor.ExceptionInterceptor.intercept(ExceptionInterceptor.java:68)
    at com.jfinal.aop.Invocation.invoke(Invocation.java:67)
    at com.pointlion.sys.interceptor.WorkFlowHisInterceptor.intercept(WorkFlowHisInterceptor.java:11)
    at com.jfinal.aop.Invocation.invoke(Invocation.java:67)
    at com.pointlion.sys.interceptor.IfLoginInterceptor.intercept(IfLoginInterceptor.java:24)
    at com.jfinal.aop.Invocation.invoke(Invocation.java:67)
    at com.pointlion.sys.plugin.shiro.ShiroInterceptor.intercept(ShiroInterceptor.java:59)
    at com.jfinal.aop.Invocation.invoke(Invocation.java:67)
    at com.jfinal.core.ActionHandler.handle(ActionHandler.java:78)
    at com.pointlion.sys.handler.GlobalHandler.handle(GlobalHandler.java:37)
    at com.jfinal.ext.handler.UrlSkipHandler.handle(UrlSkipHandler.java:46)
    at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:73)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
    at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
    at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
    at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
    at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:387)
    at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
    at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:745)
total 1 participants

Comments (1)

roseberry 2019-01-20 13:39

我找了下代码,报空是在com.pointlion.sys.mvc.admin.sys.attachment.attachmentUpload()下的attachment.save()抛出的
在跟进发现是com.jfinal.plugin.activerecord.Model.save()方法Config config = _getConfig();的带的config为null
继续跟进,发现_getConfig()里面的configName是null
不知道作者大大这里的configName是啥哦?以上是我的分析

Sign in to comment

Assignees
Labels
Not set
Projects
Milestones
Branches
Planed to start
Not set
Planed to end
Not set
Top level
Priority