java - Eclipse调试空指针异常

标签 java eclipse nullpointerexception

我收到一个NullPointerException,如下所示。

但是,在此方法中启用时,调试器无法启动它,代码是通过反射调用的。您能给我提供调试此代码的想法\技术吗?

<小时/>
[10/18/16 18:20:47:933 EST] 00000051 DWLExceptionU E   java.lang.NullPointerException
    at com.dwl.base.notification.NotificationManager$NotificationChannel.notify(NotificationManager.java:662)
    at com.dwl.base.notification.NotificationManager$NotificationType.notify(NotificationManager.java:402)
    at com.dwl.base.notification.NotificationManager.notify(NotificationManager.java:1454)
    at com.dwl.base.notification.bean.impl.NotificationBean.notify(NotificationBean.java:142)
    at com.dwl.base.notification.EJSLocalCSLNotification_e2801c59.notify(EJSLocalCSLNotification_e2801c59.java)
    at com.dwl.base.notification.EJSProxy$$NotificationLocal.notify(Unknown Source)
    at au.com.xxxxx.mdm.notification.NotificationHelper.sendNotification(NotificationHelper.java:75)
    at au.com.xxxxxx.mdm.behaviour.SingleCustomerViewId.triggerNotification(SingleCustomerViewId.java:159)
    at au.com.xxxxxxx.mdm.behaviour.SingleCustomerViewId.execute(SingleCustomerViewId.java:129)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:88)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
    at java.lang.reflect.Method.invoke(Method.java:613)
    at com.dwl.base.extensionFramework.JavaExtensionSet.invoke(JavaExtensionSet.java:159)
    at com.dwl.base.extensionFramework.ExtensionHandler.executeExtension(ExtensionHandler.java:251)
    at com.dwl.base.DWLCommonComponent.handleExtensions(DWLCommonComponent.java:1380)
    at com.dwl.base.DWLCommonComponent.postExecute(DWLCommonComponent.java:509)
    at com.dwl.tcrm.common.TCRMCommonComponent.postExecute(TCRMCommonComponent.java:263)
    at com.dwl.tcrm.coreParty.component.TCRMPersonComponent.addPerson(TCRMPersonComponent.java:1641)
    at com.dwl.tcrm.coreParty.component.TCRMPartyComponent.addPerson(TCRMPartyComponent.java:3079)
    at com.dwl.tcrm.coreParty.component.TCRMPartyComponent.addPartySimple(TCRMPartyComponent.java:2813)
    at com.dwl.tcrm.coreParty.component.TCRMPartyComponent.addParty(TCRMPartyComponent.java:2471)
    at com.dwl.tcrm.coreParty.controller.TCRMCorePartyTxnBean.addPerson(TCRMCorePartyTxnBean.java:1764)
    at Proxy5aa32899_c04f_46c5_9706_69af241cd3c4.addPerson(Unknown Source)
    at Proxy5aa32899_c04f_46c5_9706_69af241cd3c4.addPerson(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:88)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
    at java.lang.reflect.Method.invoke(Method.java:613)
    at com.dwl.base.requestHandler.DWLTxnBP.processPersistentObject(DWLTxnBP.java:262)
    at com.dwl.base.requestHandler.DWLTxnBP.execute(DWLTxnBP.java:115)
    at com.dwl.base.requestHandler.DWLTxnProcessor.processTx(DWLTxnProcessor.java:98)
    at com.dwl.unifi.tx.manager.CTxRxFacade.processTxNormal(CTxRxFacade.java:681)
    at com.dwl.unifi.tx.manager.CTxRxFacade.processTx(CTxRxFacade.java:544)
    at com.dwl.base.requestHandler.DWLRequestHandler.processTransaction(DWLRequestHandler.java:1187)
    at com.dwl.base.requestHandler.DWLRequestHandler.processTx(DWLRequestHandler.java:591)
    at com.dwl.base.requestHandler.DWLServiceControllerBase.processRequest(DWLServiceControllerBase.java:253)
    at com.dwl.base.requestHandler.beans.EJSRemoteCSLDWLServiceController_2c54996d.processRequest(EJSRemoteCSLDWLServiceController_2c54996d.java)
    at com.dwl.base.requestHandler.beans._EJSRemoteCSLDWLServiceController_2c54996d_Tie.processRequest(_EJSRemoteCSLDWLServiceController_2c54996d_Tie.java:1)
    at com.dwl.base.requestHandler.beans._EJSRemoteCSLDWLServiceController_2c54996d_Tie._invoke(_EJSRemoteCSLDWLServiceController_2c54996d_Tie.java)
    at com.ibm.CORBA.iiop.ServerDelegate.dispatchInvokeHandler(ServerDelegate.java:669)
    at com.ibm.CORBA.iiop.ServerDelegate.dispatch(ServerDelegate.java:523)
    at com.ibm.rmi.iiop.ORB.process(ORB.java:523)
    at com.ibm.CORBA.iiop.ORB.process(ORB.java:1575)
    at com.ibm.rmi.iiop.Connection.doRequestWork(Connection.java:3039)
    at com.ibm.rmi.iiop.Connection.doWork(Connection.java:2922)
    at com.ibm.rmi.iiop.WorkUnitImpl.doWork(WorkUnitImpl.java:64)
    at com.ibm.ejs.oa.pool.PooledThread.run(ThreadPool.java:118)
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1892)

最佳答案

Can you please provide me ideas\techniques to be able to debug this code?

既然您说该方法是从反射调用的,您可以在堆栈跟踪中看到这一点。

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:88)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
at java.lang.reflect.Method.invoke(Method.java:613)

所以,请继续阅读。

我猜您故意编辑了 xxxx 值,因此这些是动态调用的库。

at au.com.xxxxx.mdm.notification.NotificationHelper.sendNotification(NotificationHelper.java:75)
at au.com.xxxxxx.mdm.behaviour.SingleCustomerViewId.triggerNotification(SingleCustomerViewId.java:159)
at au.com.xxxxxxx.mdm.behaviour.SingleCustomerViewId.execute(SingleCustomerViewId.java:129)

然后,调用堆栈的其余部分仅遍历同一包中的其他代码库。

at com.dwl.base.notification.NotificationManager$NotificationChannel.notify(NotificationManager.java:662)
at com.dwl.base.notification.NotificationManager$NotificationType.notify(NotificationManager.java:402)
at com.dwl.base.notification.NotificationManager.notify(NotificationManager.java:1454)
at com.dwl.base.notification.bean.impl.NotificationBean.notify(NotificationBean.java:142)
at com.dwl.base.notification.EJSLocalCSLNotification_e2801c59.notify(EJSLocalCSLNotification_e2801c59.java)
at com.dwl.base.notification.EJSProxy$$NotificationLocal.notify(Unknown Source)

因此,问题肯定是从 NotificationHelper.sendNotification(NotificationHelper.java:75) 开始的,但无法轻易确定代码到达最终目的地所采取的路径或到底是什么在未检查 (NotificationManager.java:662)

来源的情况下引发异常

关于java - Eclipse调试空指针异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40102185/

相关文章:

java - 我正在尝试将值插入 MySQL 数据库,但出现 NullPointerException

java - 在 Java 中返回数组

java - java中如何使用unsigned int/char值

java - 使用 Gson 从 Json 反序列化 Map

java - 提取第一个特殊字符后的字符串

eclipse - 创建可折叠代码块eclipse

java - 使用 grayVal 到 Ascii 字符的转换将图像转换为 Ascii 码

android - 如何在android中绘制视频 View ?

带有数组中对象的 Java NullPointerException

java - 如何更新这个只允许用户猜测 5 次的方法?