Server project contains a white ball icon maybe it's a settings and it crash to run other projects in debug???我为服务器和客户端创建了两个maven项目。我尝试在调试模式下运行它们,服务器成功启动但客户端程序抛出以下错误(当我在正常模式下运行它们运行良好时,只在调试中出现问题):Launcing Client遇到了问题。在以下期间发生内部错误:"启动客户端"。显示java.lang.NullPointerException。可能是什么问题,解决方案? 我在元数据中的eclipse .log文件中遇到以下异常:
!ENTRY org.eclipse.core.jobs 4 2 2017-08-30 21:55:36.325
!MESSAGE An internal error occurred during: "Launching MainGui".
!STACK 0
java.lang.NullPointerException
at org.eclipse.jdt.internal.core.search.JavaSearchScope.packageFragmentRoot(JavaSearchScope.java:612)
at org.eclipse.jdt.internal.core.search.NameMatchRequestorWrapper.createTypeFromPath(NameMatchRequestorWrapper.java:149)
at org.eclipse.jdt.internal.core.search.NameMatchRequestorWrapper.getType(NameMatchRequestorWrapper.java:89)
at org.eclipse.jdt.internal.core.search.TypeNameMatchRequestorWrapper.acceptType(TypeNameMatchRequestorWrapper.java:59)
at org.eclipse.jdt.internal.core.search.BasicSearchEngine$5.acceptIndexMatch(BasicSearchEngine.java:1808)
at org.eclipse.jdt.core.search.SearchPattern.acceptMatch(SearchPattern.java:319)
at org.eclipse.jdt.core.search.SearchPattern.findIndexMatches(SearchPattern.java:2348)
at org.eclipse.jdt.internal.core.search.matching.MatchLocator.findIndexMatches(MatchLocator.java:280)
at org.eclipse.jdt.internal.core.search.PatternSearchJob.search(PatternSearchJob.java:104)
at org.eclipse.jdt.internal.core.search.PatternSearchJob.execute(PatternSearchJob.java:65)
at org.eclipse.jdt.internal.core.search.processing.JobManager.performConcurrentJob(JobManager.java:265)
at org.eclipse.jdt.internal.core.search.BasicSearchEngine.searchAllTypeNames(BasicSearchEngine.java:1816)
at org.eclipse.jdt.core.search.SearchEngine.searchAllTypeNames(SearchEngine.java:1132)
at org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget.hasMultipleMatchesInWorkspace(JDIDebugTarget.java:1585)
at org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget.supportsBreakpoint(JDIDebugTarget.java:1428)
at org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget.breakpointAdded(JDIDebugTarget.java:1616)
at org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget.initializeBreakpoints(JDIDebugTarget.java:612)
at org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget.initialize(JDIDebugTarget.java:537)
at org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget.<init>(JDIDebugTarget.java:359)
at org.eclipse.jdt.debug.core.JDIDebugModel$1.run(JDIDebugModel.java:193)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2240)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2267)
at org.eclipse.jdt.debug.core.JDIDebugModel.newDebugTarget(JDIDebugModel.java:197)
at org.eclipse.jdt.internal.launching.StandardVMDebugger.createDebugTarget(StandardVMDebugger.java:480)
at org.eclipse.jdt.internal.launching.StandardVMDebugger.run(StandardVMDebugger.java:350)
at org.eclipse.jdt.launching.JavaLaunchDelegate.launch(JavaLaunchDelegate.java:102)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:885)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:739)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1039)
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1256)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
我只使用System.out创建了一个简单的新分离项目......问题与客户端程序中的问题相同。我不知道为什么只有服务器是可调试的。
答案 0 :(得分:0)
首先尝试在对象中存储一些数据,因为该对象当前包含NULL值。 即使您的对象为空,服务器和客户端也会成功运行,并且仅当您尝试将对象从服务器交换到客户端或签证时才会抛出java.lang.NullPointerException。 在调试时可能存在问题,而不是在运行中,因为您可能在运行时最初将某些数据存储在对象中,而在调试时可能没有这样做。 我尝试使用上面的内容,它对我有用! 如果这不起作用,我猜想包含数据的对象没有被发送到客户端而是发送了空对象