Eclipse调试空指针异常

时间:2016-10-18 07:33:53

标签: 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)

1 个答案:

答案 0 :(得分:1)

  

您能否为我提供想法\技术以便能够调试此代码?

既然你说过从反射中调用该方法,你可以在stacktrace中看到它。

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)开始的,但是不能轻易确定代码为了到达其最终目的地而采取的路径,或者在没有检查{{1}的来源的情况下究竟是什么导致了异常}