JavaEar 专注于收集分享传播有价值的技术资料

An internal error occured during launching my project

Server project contains a white ball icon maybe it's a settings and it crash to run other projects in debug???I created two maven project for a server and a client side. I try to run them in debug mode, the server successfully started but the client program throw the following error (when i run them in normal mode they run well, only problem in debug): Launcing Client has encountered a problem. An internal error occured during: "Launching Client". java.lang.NullPointerException. What can be the problem, and the solution? I got the following exception in the eclipse .log file in metadata:

!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)

I created a simple new separated project only with a System.out... and the problem is the same like in the client program. I don't know why is only the server is debuggable.

1个回答

    最佳答案
  1. Try storing some data in your object first because the object is currently containing NULL value. The server and client run successfully even if your object is empty and throws the java.lang.NullPointerException only when you try transacting the object from server to client or visa-verse. While debugging there might be a problem and not in running 'cause you might be storing some data initially in the object while running which you might not be doing while debugging. I tried using the above and it worked for me! If this doesn't work I guess the object containing data is not getting sent to client rather the null object is getting sent