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.

Bug 243800 - NullPointerException at org.netbeans.lib.profiler.common.integration.IntegrationUtils.getPlatformByOSAndArch
Summary: NullPointerException at org.netbeans.lib.profiler.common.integration.Integrat...
Status: RESOLVED FIXED
Alias: None
Product: profiler
Classification: Unclassified
Component: Ide (show other bugs)
Version: 8.0
Hardware: All All
: P2 normal with 1 vote (vote)
Assignee: Petr Cyhelsky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-13 16:26 UTC by skobi
Modified: 2014-07-11 09:42 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 209087


Attachments
stacktrace (3.10 KB, text/plain)
2014-04-13 16:26 UTC, skobi
Details
Fix for JDK 8 (2.01 KB, patch)
2014-05-16 07:48 UTC, Tomas Zezula
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description skobi 2014-04-13 16:26:31 UTC
Build: NetBeans IDE Dev (Build 201404130001)
VM: Java HotSpot(TM) 64-Bit Server VM, 25.0-b70, Java(TM) SE Runtime Environment, 1.8.0-b132
OS: Linux

User Comments:
skobi: Unable to start profiling with remote platform on raspberry pi




Stacktrace: 
java.lang.NullPointerException
   at org.netbeans.lib.profiler.common.integration.IntegrationUtils.getPlatformByOSAndArch(IntegrationUtils.java:279)
   at org.netbeans.modules.profiler.nbimpl.actions.ProfilerLauncher.setupAgentEnv(ProfilerLauncher.java:383)
   at org.netbeans.modules.profiler.nbimpl.actions.ProfilerLauncher.access$200(ProfilerLauncher.java:77)
   at org.netbeans.modules.profiler.nbimpl.actions.ProfilerLauncher$Session.configure(ProfilerLauncher.java:208)
   at org.netbeans.modules.profiler.nbimpl.actions.ProfilerLauncher$Session.getProperties(ProfilerLauncher.java:150)
   at org.netbeans.modules.profiler.nbimpl.providers.DefaultProfilerArgsProvider.getArguments(DefaultProfilerArgsProvider.java:71)
Comment 1 skobi 2014-04-13 16:26:32 UTC
Created attachment 146724 [details]
stacktrace
Comment 2 skobi 2014-04-16 19:44:17 UTC
The exception is caused in method getPlatformByOSAndArch() because the parameter String JVMTarget is null. It should be set in class RemotePlatform but as far as I can see it is never set. Simply Checking for null does not work because this causes a wrong path where libprofilerinterface.so is expected.
When attaching the profiler to the running process on the remote machine everthing works fine.

The remote machine is a raspberry pi configured as remote platform running jdk-8-oracle-arm-vfp-hflt or jdk-7-oracle-armhf.
Comment 3 skobi 2014-05-09 07:14:14 UTC
Set Hardware back to All:All because the problem does not seem to be hardware specific. I originally found the bug using Linux Mint on a PC Laptop developing with the Raspberry Pi running Raspian.
It is mainly caused by the missing property JVMTarget in the XML file describing the remote platform.
Comment 4 Tomas Zezula 2014-05-16 06:50:18 UTC
Caused by incompatible remote platform VM, the remote platform on Pi is not a J2SE Embedded VM.
Comment 5 skobi 2014-05-16 07:25:46 UTC
Does this mean that a remote plattform always has to be a J2SE Embedded VM? Shouldn't this than be checked when adding a remote platform?
Comment 6 Petr Cyhelsky 2014-05-16 07:46:27 UTC
(In reply to skobi from comment #5)
> Does this mean that a remote plattform always has to be a J2SE Embedded VM?
> Shouldn't this than be checked when adding a remote platform?

For now use the embedded VM as a workaround, after fixes it should also work with the full VM.
Comment 7 Tomas Zezula 2014-05-16 07:48:26 UTC
Created attachment 147289 [details]
Fix for JDK 8

Attaching a fix working on JDK 8 (normal, embedded).
Good as a hot fix.
For JDK 7 it's harder, no abi property.
I am investigating if it's possible to detect it in some cheap way.
Comment 8 Tomas Zezula 2014-05-16 07:48:51 UTC
Petre please integrate the fix for JDK 8.
Comment 9 Petr Cyhelsky 2014-05-16 13:48:28 UTC
fixed in http://hg.netbeans.org/profiler-main/rev/ea07d608256d

notes:
There should no longer be any problems when not profiling.

Profiling with remote jdk8 (either full or embedded) should be OK
   - For profiling the profile has to be at least compact3

Profiling with remote jdk7 currently won't work on vfp-hflt architecture (there is no simple way how to recognise vfp-hflt architecture from sflt or vfp-sflt on jdk 7) new Bug should be filed for this problem.
Comment 10 Quality Engineering 2014-05-18 01:29:05 UTC
Integrated into 'main-silver', will be available in build *201405180001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/ea07d608256d
User: Petr Cyhelsky <cyhelsky@netbeans.org>
Log: #243800 detect arm floating point architecture only by sun.arch.abi property