Bug 199922 - Cannot profile main project (Maven - netbeans Platform)
Cannot profile main project (Maven - netbeans Platform)
Status: VERIFIED FIXED
Product: apisupport
Classification: Unclassified
Component: Maven
7.0
All All
: P3 with 1 vote (vote)
: 7.0.1
Assigned To: Jesse Glick
issues@apisupport
701patch1-verified
:
: 195919 198401 (view as bug list)
Depends on: 201132
Blocks:
  Show dependency treegraph
 
Reported: 2011-07-06 14:09 UTC by borre
Modified: 2011-10-13 19:19 UTC (History)
7 users (show)

See Also:
Issue Type: DEFECT
:


Attachments
messages.log - the file was cleared before reproducing the bug (114.93 KB, text/plain)
2011-07-07 11:34 UTC, borre
Details

Note You need to log in before you can comment on or make changes to this bug.
Description borre 2011-07-06 14:09:38 UTC
Failed to execute goal org.codehaus.mojo:nbm-maven-plugin:3.4:run-ide (default-cli) on project application: The parameters 'netbeansInstallation' for goal org.codehaus.mojo:nbm-maven-plugin:3.4:run-ide are missing or invalid -> [Help 1]

Product Version = NetBeans IDE 7.0 (Build 201104080000)
Operating System = Windows XP version 5.1 running on x86
Java; VM; Vendor = 1.6.0_25
Runtime = Java HotSpot(TM) Client VM 20.0-b11
Comment 1 J Bachorik 2011-07-07 10:44:01 UTC
I am able to confirm that profiling NB platform application is not working. 

However, the symptoms are a bit different on my side - the profiled application is started fine but with incorrect JVM arguments resulting in the profiler agent not being started.

Could you attach your IDE messages.log file to provide more information about what is going on?
Comment 2 borre 2011-07-07 11:34:03 UTC
Created attachment 109286 [details]
messages.log - the file was cleared before reproducing the bug

The profiling hangs at dialog box "Connectint to VM"
This is the output:

cd C:\OPUS\TRY-BORRE-SIMCON\opus-gen2\opus-g2-simcon\application; "JAVA_HOME=C:\\Program Files\\Java\\jdk1.6.0_25" "\"C:\\Program Files\\NetBeans 7.0\\java\\maven\\bin\\mvn.bat\"" -Dprofiler.action=profile "-Dnetbeans.run.params=-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=\\\"C:\\Documents and Settings\\osc\\.netbeans\\7.0\\var\\cache\\mavencachedirs\\97301660\\org-netbeans-modules-profiler\\\"  \\\"-agentpath:C:/Program Files/NetBeans 7.0/profiler/lib/deployed/jdk16/windows/profilerinterface.dll=C:/Program Files/NetBeans 7.0/profiler/lib,5140,10\\\" -classpath %classpath ${packageClassName}" "-Dexec.executable=C:\\Program Files\\Java\\jdk1.6.0_25\\bin\\java.exe" nbm:cluster nbm:run-ide
Scanning for projects...
                                                                        
------------------------------------------------------------------------
Building OPUS :: GEN2 :: SIMCON :: App 1.14-SNAPSHOT
------------------------------------------------------------------------

[nbm:cluster]
Created NetBeans module cluster(s) at C:\OPUS\TRY-BORRE-SIMCON\opus-gen2\opus-g2-simcon\application\target\netbeans_clusters

[nbm:run-ide]
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 3.594s
Finished at: Thu Jul 07 13:25:53 CEST 2011
Final Memory: 7M/247M
------------------------------------------------------------------------
Failed to execute goal org.codehaus.mojo:nbm-maven-plugin:3.4:run-ide (default-cli) on project application: The parameters 'netbeansInstallation' for goal org.codehaus.mojo:nbm-maven-plugin:3.4:run-ide are missing or invalid -> [Help 1]

To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.

For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginParameterException
Comment 3 J Bachorik 2011-07-07 11:45:27 UTC
Ok, thanks. Now it's clear that there is a common root cause even though the profiled application doesn't even start on windows while, on linux, it does.

The culprit is incorrect handling of extra JVM arguments - the maven goal "nbm:run-ide" requires them to be prefixed with "-J" in order to pass them to the platform correctly.
Comment 4 borre 2011-07-07 11:56:36 UTC
OK, thanks for very swift reply.
Is there anything I can do here to make it work? Can I for instance alter the JVM arguments (${profiler.args} - right?) in any way?
Or do I have to wait for an update?
Comment 5 J Bachorik 2011-07-07 12:09:35 UTC
There is no easy way to workaround this :(

The only thing you could do would be to manually run your application with the correct JVM arguments and then attach to it from the IDE (Profile/Attach Profiler...) as local direct attach to a java application.
Comment 6 Geertjan Wielenga 2011-07-07 13:41:31 UTC
NetBeans Platform profiling is important, many users are on Windows with Maven. What needs to be done to fix this problem?
Comment 7 Jesse Glick 2011-07-07 16:34:42 UTC
(In reply to comment #0)
> Failed to execute goal org.codehaus.mojo:nbm-maven-plugin:3.4:run-ide
> (default-cli) on project application: The parameters 'netbeansInstallation' for
> goal org.codehaus.mojo:nbm-maven-plugin:3.4:run-ide are missing or invalid ->
> [Help 1]

See bug #199809 and either define this property or use a real application project, not a "suite".

(In reply to comment #3)
> The culprit is incorrect handling of extra JVM arguments - the maven goal
> "nbm:run-ide" requires them to be prefixed with "-J" in order to pass them to
> the platform correctly.

It appears that maven.profiler/src/org/netbeans/modules/maven/profiler/ActionMappings.xml defines things which perhaps ought to be in maven.apisupport, and which are wrong.
Comment 8 J Bachorik 2011-07-07 18:50:38 UTC
Ok, I've prepared a aquick fix in profiler maven support for providing JVM args prefixed by -J. Just reassign the issue back to me when the generic maven support fix is ready and rhere is still meed for adjustment in profiler.
Comment 9 borre 2011-07-07 19:16:13 UTC
Thank you!
I'm very impressed by the response and interest in bugs that are reported.

How can I apply the quick fix? I have an out of memory exception that I really would like to have resolved before the holidays ;-)

Maybe J Bachorik could provide a detailed "how to" regarding Comment #5? How do I manually run the application and where do I correct which arguments?
Comment 10 Jesse Glick 2011-07-07 19:35:12 UTC
(In reply to comment #8)
> I've prepared a aquick fix in profiler maven support for providing JVM args
> prefixed by -J.

Already prepared that part myself, in testing now.
Comment 11 Jesse Glick 2011-07-07 20:09:05 UTC
core-main #fd2ce7834e6c
Comment 12 borre 2011-07-08 09:32:39 UTC
Hi.

I checked out the core-main branch, compiled it and installed the plugin. When profiling main project, this is the command Netbeans tried to run:

cmd.exe /X /C "C:\OPUS\TRY-BORRE-SIMCON\opus-gen2\opus-g2-simcon\application\target\opus_g2_simcon\bin\opus_g2_simcon.exe --console suppress --userdir C:\OPUS\TRY-BORRE-SIMCON\opus-gen2\opus-g2-simcon\application\target\userdir -J-Dnetbeans.logger.console=true -J-ea --branding opus_g2_simcon --jdkhome "C:\Program Files\Java\jdk1.6.0_25" -J-XX:+HeapDumpOnOutOfMemoryError "-J-XX:HeapDumpPath=C:\Documents -Jand -JSettings\osc\.netbeans\7.0\var\cache\mavencachedirs\97301660\org-netbeans-modules-profiler" "-J-agentpath:C:/Program -JFiles/NetBeans -J7.0/profiler/lib/deployed/jdk16/windows/profilerinterface.dll=C:/Program -JFiles/NetBeans -J7.0/profiler/lib,5140,10" --jdkhome C:\Program Files\Java\jdk1.6.0_25"

Some "s are missing and there are too many -Js
Comment 13 Jesse Glick 2011-07-08 14:06:25 UTC
Should work fine if you use file paths without spaces, which is a big improvement from the previous state that never worked. Someday when I have the time (patched welcome) I will fix it up to deal with quoted paths with spaces in them, which is mainly of interest to Windows users.
Comment 14 Quality Engineering 2011-07-09 13:53:59 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/fd2ce7834e6c
User: Jesse Glick <jglick@netbeans.org>
Log: #199922: Cannot profile main project (Maven - netbeans Platform)
Comment 15 Jesse Glick 2011-07-13 15:21:39 UTC
*** Bug 195919 has been marked as a duplicate of this bug. ***
Comment 16 borre 2011-08-19 13:40:40 UTC
Is the solution so far (as described in Comment #13) a part of Netbeans 7.0.1?
I am trying to profile a NB platform application on Windows. Java is installed in C:\Java and Netbeans is installed in C:\Netbeans (no spaces). My NB Platform application is also in a path without spaces - but it fails...
Comment 17 Jesse Glick 2011-08-19 15:23:39 UTC
(In reply to comment #16)
> Is the solution so far (as described in Comment #13) a part of Netbeans 7.0.1?

No, 7.1.
Comment 18 Jesse Glick 2011-08-19 15:42:45 UTC
Reclosing as the primary bug was in fact fixed for 7.1 (and could perhaps be backported if VERIFIED). Will file a separate bug for the space in path issue.
Comment 19 Tomas Danek 2011-08-24 14:23:15 UTC
Borre, could you please download latest dev build (which contains fix) from http://bits.netbeans.org/trunk/nightly/latest/ and try if it works? If it does,please let us know ASAP and we will make it part of 7.0.1 patch.

(In reply to comment #16)
> Is the solution so far (as described in Comment #13) a part of Netbeans 7.0.1?
> I am trying to profile a NB platform application on Windows. Java is installed
> in C:\Java and Netbeans is installed in C:\Netbeans (no spaces). My NB Platform
> application is also in a path without spaces - but it fails...
Comment 20 borre 2011-08-25 05:28:57 UTC
(In reply to comment #19)

I did this a couple of days ago and it works on Windows where both Netbeans and jdk are installed on paths without whitespace.
Comment 21 Tomas Danek 2011-08-25 07:19:42 UTC
Thanks, marking verified then and we can proceed in putting this fix into 7.0.1 patch 1. As mentioned, feel free to create new report for space in path issue. Thanks.
Comment 22 Jesse Glick 2011-08-25 15:42:27 UTC
(In reply to comment #21)
> feel free to create new report for space in path issue.

I already filed that: bug #201132
Comment 23 Jesse Glick 2011-08-25 16:00:58 UTC
releases #a4b16c494a0e
Comment 24 Quality Engineering 2011-08-26 04:27:28 UTC
Integrated into 'releases'
Changeset: http://hg.netbeans.org/releases/rev/a4b16c494a0e
User: Jesse Glick <jglick@netbeans.org>
Log: #199922: Cannot profile main project (Maven - netbeans Platform)
(transplanted from fd2ce7834e6ca16754f93e9fadaa75d7f63959bb)
Comment 25 Petr Cyhelsky 2011-08-31 10:12:33 UTC
verified on 7.0.1.patch1
Comment 26 Quality Engineering 2011-09-26 13:28:55 UTC
Integrated into 'releases'
Changeset: http://hg.netbeans.org/releases/rev/9dc63568d2fe
User: Jesse Glick <jglick@netbeans.org>
Log: #199922: Cannot profile main project (Maven - netbeans Platform)
(transplanted from fd2ce7834e6ca16754f93e9fadaa75d7f63959bb)
Comment 27 J Bachorik 2011-10-06 08:31:14 UTC
*** Bug 198401 has been marked as a duplicate of this bug. ***


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