Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 202587 - Profile project action not context sensitive
Profile project action not context sensitive
Product: serverplugins
Classification: Unclassified
Component: Infrastructure
: P3 (vote)
: 7.4
Assigned To: Petr Hejl
Depends on:
  Show dependency treegraph
Reported: 2011-09-23 20:24 UTC by Vince Kraemer
Modified: 2013-08-23 02:40 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT

the patch (44.57 KB, patch)
2013-08-15 12:37 UTC, Petr Hejl
Details | Diff
the patch (44.56 KB, patch)
2013-08-15 12:41 UTC, Petr Hejl
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vince Kraemer 2011-09-23 20:24:18 UTC
GF clusters and stand-alone instances do not support being started in profile mode.

The 'Start in Profile Mode' action is disabled on the instance node in the servers explorer.

The Profile action is enabled in the right-click menu on a web app project.

The GF plugin implements supportsStartProfiling (Hk2StartServer.supportsStartProfiling(Target)).

It looks like this method is not called before the call to Hk2StartServer.startProfiling(Target,ProfilerServerSettings).

There is a similar problem (context insensitivity) for the Debug item on a webapp's right-click menu.
Comment 1 David Konecny 2011-09-25 22:25:33 UTC
Profile action on project nodes is provided by Profiler module.
Comment 2 J Bachorik 2011-09-26 10:38:14 UTC
There is no API to access to this kind of information from outside of the implementation modules. The "Profile Project" action has no way of knowing the server details.
The only way to implement this functionality without exposing additional data through API is to call Hk2StartServer.supportsStartProfiling(Target) method from Hk2StartServer.startProfiling(Target,ProfilerServerSettings) directly. The action would not be enabled/disabled in UI accordingly to the server type but it would fail lazily when trying to profile a project.
Comment 3 Vince Kraemer 2011-09-26 13:06:40 UTC
It seems supportsStartProfiling(Target) is an exposed SPI that projects should be able to access.

What else do you need?
Comment 4 J Bachorik 2011-09-26 13:12:21 UTC
Is there a how-to for getting reference to a StartServer instance using SPI/API only? So far I have been only able to get hold of and it does not provide access to its StartServer implementation.

Any hints are really appreciated.
Comment 5 J Bachorik 2011-09-26 13:18:48 UTC
There is org.netbeans.modules.j2ee.deployment.impl.ServerInstance class providing getStartServer() method. Unfortunately, this class is not a part of API and there seem to be no other getter for a StartServer instance.
Comment 6 Vince Kraemer 2011-09-26 13:36:45 UTC
Petr: this seems like an api problem in the project<->j2eeserver layer of j2eeserver.
Comment 7 J Bachorik 2011-09-26 13:43:44 UTC
API problem -> reassigning
Comment 8 Petr Hejl 2013-08-14 13:02:59 UTC
This would also allow us to disable profiling in JBoss7 - see issue #228881. I'm working on it.
Comment 9 Petr Hejl 2013-08-15 12:37:31 UTC
Created attachment 138733 [details]
the patch
Comment 10 Petr Hejl 2013-08-15 12:38:15 UTC
Please review.
Comment 11 Petr Hejl 2013-08-15 12:41:37 UTC
Created attachment 138734 [details]
the patch

Minor typo in a bundle fixed.
Comment 12 Petr Hejl 2013-08-21 09:26:02 UTC
Thanks for the review. I'll integrate the change tomorrow.
Comment 13 Petr Hejl 2013-08-22 08:33:59 UTC
Fixed in web-main f93d8c129b4f.
Comment 14 Quality Engineering 2013-08-23 02:40:21 UTC
Integrated into 'main-silver', will be available in build *201308222300* on (upload may still be in progress)

User: Petr Hejl <>
Log: #202587 - Profile project action not context sensitive

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo