This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Create new Java application project. Rename Main class or move it to other package. Run Profiler Profiler fails with "java.lang.NoClassDefFoundError" message in output. In case of simple project running the IDE asks for main class name before run.
java.lang.NullPointerException at java.io.ObjectOutputStream$BlockDataOutputStream.getUTFLength(ObjectOutputStream.java:2097) at java.io.ObjectOutputStream$BlockDataOutputStream.writeUTF(ObjectOutputStream.java:1968) at java.io.ObjectOutputStream.writeUTF(ObjectOutputStream.java:841) at com.sun.tools.profiler.wireprotocol.InitiateInstrumentationCommand.writeObject (InitiateInstrumentationCommand.java:83) at com.sun.tools.profiler.wireprotocol.WireIO.sendComplexCommand(WireIO.java:60) at com.sun.tools.profiler.ProfilerClient.sendComplexCmdToServer(ProfilerClient.java:1523) at com.sun.tools.profiler.ProfilerClient.sendCommandAndGetResponse(ProfilerClient.java:1300) at com.sun.tools.profiler.ProfilerClient.startTargetApp(ProfilerClient.java:266) at com.sun.tools.profiler.TargetAppRunner.connectToStartedVMAndStartTA(TargetAppRunner.java:577) at com.sun.tools.profiler.TargetAppRunner.connectToStartedVMAndStartTA(TargetAppRunner.java:176) at com.sun.tools.profiler.TargetAppRunner.connectToStartedVMAndStartTA(TargetAppRunner.java:171) at org.netbeans.modules.profiler.NetBeansProfiler$4.doInBackground(NetBeansProfiler.java:596) at com.sun.tools.profiler.ui.SwingWorker$3.run(SwingWorker.java:91) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:539) [catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:964)
Actually the above exception occurs only when a Profiling Point was defined in moved/renamed class. Otherwise just the NoClassDefFoundError appears in Output and the profiled application is terminated.
Dialog is now opened before profiling to select the main class. However, the selected main class is used only for profiling and isn't set for the Project. Filed a RFE to implement this on j2seproject side: Issue 113321. Fixed for Beta1.
Verified in build 2007100312