橘子899 2022-03-15 23:50 采纳率: 78.6%
浏览 24
已结题

请问下这个问题怎么解决java.lang.IllegalArgumentException: param topNode is null.

java.lang.IllegalArgumentException: param topNode is null.
    at cn.com.lundong.feishu.core.contact.vo.DeptTreeVo.appendTopNode(DeptTreeVo.java:70)
    at cn.com.lundong.feishu.core.contact.service.helper.FeishuDeptHelper.buildDeptTree(FeishuDeptHelper.java:168)
    at cn.com.lundong.feishu.core.contact.service.helper.FeishuDeptHelper.buildDeptHierarchy(FeishuDeptHelper.java:84)
    at cn.com.lundong.feishu.core.contact.service.impl.DeptHierarchyServiceImpl.buildDeptAndSubHierarchyById(DeptHierarchyServiceImpl.java:144)
    at cn.com.lundong.feishu.core.contact.service.impl.DeptHierarchyServiceImpl$$FastClassBySpringCGLIB$$c285120.invoke(<generated>)
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:749)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:295)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)
    at cn.com.lundong.feishu.core.contact.service.impl.DeptHierarchyServiceImpl$$EnhancerBySpringCGLIB$$207d5be4.buildDeptAndSubHierarchyById(<generated>)
    at cn.com.lundong.feishu.core.facade.impl.FeishuDeptSyncFacadeImpl.syncPlatformDept(FeishuDeptSyncFacadeImpl.java:411)
    at sun.reflect.GeneratedMethodAccessor1017.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:205)
    at com.sun.proxy.$Proxy163.syncPlatformDept(Unknown Source)
    at cn.com.lundong.feishu.core.app.open.callback.handler.event.ContactChangeEventHandler.handle(ContactChangeEventHandler.java:91)
    at cn.com.lundong.feishu.core.app.open.callback.handler.event.ContactChangeEventHandler.handle(ContactChangeEventHandler.java:30)
    at cn.com.lundong.feishu.core.app.open.callback.MessageEventDispatcher.handle(MessageEventDispatcher.java:40)
    at cn.com.lundong.feishu.core.app.open.callback.MessageEventDispatcher.handle(MessageEventDispatcher.java:18)
    at cn.com.lundong.feishu.core.app.open.callback.CallbackMessageQueueHandler.handleQueue(CallbackMessageQueueHandler.java:30)
    at cn.com.lundong.feishu.core.app.open.callback.CallbackMessageQueueHandler.handleQueue(CallbackMessageQueueHandler.java:13)
    at cn.com.lundong.base.mq.RedisSimpleQueueConsumer$QueueRun.lambda$run$1(RedisSimpleQueueConsumer.java:214)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)

```java
public Collection<DeptTreeNodeVo> collectSubDept(Long parentId, boolean includeParentDept, boolean includeAllSubDept) {
        if (parentId == null) {
            throw new IllegalArgumentException("param parentId is null.");
        }

        if (parentId == 0) {
            // 根部门,直接返回整个部门树节点列表
            return treeNodes;
        }

        List<DeptTreeNodeVo> depts = new LinkedList<>();

  • 写回答

1条回答 默认 最新

  • 大鹏cool Java领域优质创作者 2022-03-16 07:34
    关注

    检查 DeptTreeVo 类文件 70 行代码,看错误怎么抛出的,是不是调用方法传入了一个值为 null 的参数,导致校验失败。

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 系统已结题 5月17日
  • 已采纳回答 5月9日
  • 创建了问题 3月15日

悬赏问题

  • ¥15 visionmaster启动失败,提示为“机器不满足授权而被禁用”
  • ¥50 用logisim设计16位单时钟周期cpu
  • ¥15 IDEA中圈复杂度如何具体设置
  • ¥50 labview采集不了数据
  • ¥15 请上面代码做什么处理或什么混淆
  • ¥15 英雄联盟自定义房间置顶
  • ¥15 W5500网线插上无反应
  • ¥15 如何用字典的Key,显示在WPF的xaml中
  • ¥15 weautomate读取Excel表格信息然后填写到网页一直报错,如何解决?
  • ¥15 C#如何在Webview2中获取网页验证码