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 249608 - Unable to profile Maven project
Summary: Unable to profile Maven project
Status: RESOLVED DUPLICATE of bug 243540
Alias: None
Product: profiler
Classification: Unclassified
Component: Base (show other bugs)
Version: 8.0.2
Hardware: PC Windows XP
: P2 normal (vote)
Assignee: Tomas Hurka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-03 05:07 UTC by bht
Modified: 2015-01-07 13:44 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
log file (115.60 KB, text/plain)
2015-01-03 05:07 UTC, bht
Details
Test case in zip file (9.42 KB, application/octet-stream)
2015-01-03 06:57 UTC, bht
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bht 2015-01-03 05:07:37 UTC
Created attachment 151345 [details]
log file

NetBeans 8.02 fails profiling a simple standalone maven project started from a main class. NetBeans runs under JDK 1.8. I am aware of another related resolved isssue 161670. Please do not close as duplicate. I will do my best to provide answers, possibly a test case.

The error:

Error occurred during initialization of VM
Could not find agent library C:/Program Files/NetBeans 8.0/profiler/lib/deployed/jdk16/windows/profilerinterface.dll in absolute path, with error: The specified procedure could not be found

The file profilerinterface.dll does exist in the given path. I fail to understand how a test case will help resolve the issue. I can imagine I provide a test case and it will work on your end as expected. Then what? But perhaps this is what is needed.

Please do not hesitate to ask questions.
Comment 1 bht 2015-01-03 06:57:23 UTC
Created attachment 151346 [details]
Test case in zip file

I have created a test case based on speculation that the VM parameter in the run dialog might cause the problem. The original test case is run via junit. I quickly created a main class from the unit tests which seems to work fine without profiling.

To run the test case, you need to adjust the file location of the VM parameter to the location in your local maven repository.

However when profiling Main, I get a different error:

Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2:exec (default-cli) on project NullParameterEclipseLinkHsqlMaven: The parameters 'executable' for goal org.codehaus.mojo:exec-maven-plugin:1.2:exec are missing or invalid -> [Help 1]

Which is perhaps another separate issue because it should work because running the main method does work.

My steps (in the original case, not the test case, because the test case does not get that far):

On the toolbar, I click the button "Profile Project"
On dialog "Select Main Class for Execution", I select the main class that I want to use, and leave the radio button "Remember in Current IDE Session checked.

In the Profile Projec dialog, I leave radio button "Quick (sampled) selected, and Filter selection "Profile only Project classes". I click "Run"

Then I get a dialog "Progress" "Connecting to the target VM...

Waiting forever.

Performs calibration.
Comment 2 Jiri Skrivanek 2015-01-05 11:48:33 UTC
The problem is in nbactions.xml. In attached project is the following

            <properties>
                <exec.args>${profiler.args} -javaagent:"...\eclipselink-2.3.2.jar" -classpath %classpath ${packageClassName}</exec.args>
                <exec.executable>${profiler.java}</exec.executable>
                <profiler.action>profile</profiler.action>
            </properties>

while when you create project from scratch there is

            <properties>
                <exec.args>-javaagent:"...eclipselink-2.3.2.jar" -classpath %classpath ${packageClassName}</exec.args>
                <exec.executable>java</exec.executable>
            </properties>

As a hotfix I recommend to manually update nbactions.xml.
Comment 3 bht 2015-01-07 10:06:21 UTC
I hope I did the change in nbactions.xml as advised:

            <properties>
<!--                <exec.args>${profiler.args} -javaagent:"C:\Documents and Settings\name\.m2\repository\org\eclipse\persistence\eclipselink\2.3.2\eclipselink-2.3.2.jar" -classpath %classpath ${packageClassName}</exec.args>-->
                <exec.args>-javaagent:"C:\Documents and Settings\name\.m2\repository\org\eclipse\persistence\eclipselink\2.3.2\eclipselink-2.3.2.jar" -classpath %classpath ${packageClassName}</exec.args>
<!--                <exec.executable>${profiler.java}</exec.executable>-->
                <exec.executable>java</exec.executable>
<!--                <profiler.action>profile</profiler.action>-->
            </properties>

Now thanks to these changes, I am getting the original error in this simple test case:

Error occurred during initialization of VM
Could not find agent library C:/Program Files/NetBeans 8.0/profiler/lib/deployed/jdk16/windows/profilerinterface.dll in absolute path, with error: The specified procedure could not be found.

Subsequently, I change the jdk  for NetBeans from 8 to 7 in netbeans.conf:
netbeans_jdkhome="C:\Program Files\Java\jdk1.7.0_71"
#netbeans_jdkhome="C:\Program Files\Java\jdk1.8.0_05"

On startup, NetBeans then does not seem to accept the JDK specified in the configuration and I am getting an error:

Cannot locate java installation in specified jdkhome:
C:\Program Files\Java\jdk1.7.0_51
Do you want to try to use the default version?

If I confirm default version then it starts with JDK 1.8 but where does it get that default from? Where is this configured? If I run java -version on a command prompt, then I get 1.7. BTW I have installed Java 1.8 on Win XP manually because the installation script does not support Windows XP. So at least I should be able to run a supported JDK 1.7.
Comment 4 Jiri Skrivanek 2015-01-07 10:36:29 UTC
Probably you have somehow misconfigured either NetBeans or JDKs. I recommend to uninstall NetBeans and JDKs and install everything from scratch if possible.

https://netbeans.org/downloads/
Comment 5 Tomas Hurka 2015-01-07 13:44:29 UTC
Profiler 8.0+ doesn't work on Windows XP. If you really want to use Microsoft's unsupported OS, you can use NetBeans 7.4 as a workaround.

*** This bug has been marked as a duplicate of bug 243540 ***