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 205328 - Attach wizard for GlassFish generates wrong JVM options when the profiler agent is located in a directory with space in name
Summary: Attach wizard for GlassFish generates wrong JVM options when the profiler age...
Status: RESOLVED FIXED
Alias: None
Product: profiler
Classification: Unclassified
Component: Ide (show other bugs)
Version: 7.1
Hardware: PC Linux
: P3 normal (vote)
Assignee: issues@profiler
URL:
Keywords:
: 205349 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-11-20 17:47 UTC by gholmer
Modified: 2012-04-11 11:07 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
screenshot (70.26 KB, image/png)
2011-11-22 16:37 UTC, gholmer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description gholmer 2011-11-20 17:47:26 UTC
0) Install NetBeans 7.1rc1 with GlassFish. Specify NetBeans installation directory as "/mnt/common/NetBeans 7.1" (note space).
1) Select "Start in Profile Mode" from GlassFish node's context menu in Services tab (as in profiler test suite TS71, item 7.3); GlassFish starts successfully.
2) Stop GlassFish.
3) Repeat 1); GlassFish fails to start with this message:
"Error occurred during initialization of VM
Could not find agent library /mnt/common/NetBeans in absolute path, with error: /mnt/common/NetBeans: cannot open shared object file: No such file or directory"

GlassFish's domain.xml contains these lines:

<jvm-options>-agentpath:/mnt/common/NetBeans</jvm-options>
<jvm-options>7.1/profiler/lib/deployed/jdk16/linux/libprofilerinterface.so=/mnt/common/NetBeans</jvm-options>

which seem to show that the directory name was truncated at the space.
Comment 1 Vince Kraemer 2011-11-21 20:21:32 UTC
which gf are you using? v2 or 3.1.1...
Comment 2 gholmer 2011-11-21 21:08:26 UTC
3.1.1
Comment 3 Vince Kraemer 2011-11-21 21:11:12 UTC
where is the server installed?
Comment 4 gholmer 2011-11-21 21:12:50 UTC
/mnt/common/GlassFish 3.1.1
(with space in directory name)
Comment 5 Vince Kraemer 2011-11-21 23:33:16 UTC
user id that 'owns' NB?

user id the owns GF?

User id of the person executing NB when this happens?

Is /mnt a remote device, mounted using NFS or the like?

I am asking all these questions because I have tried to replicate the issue on my dev machine (a Mac) and have had no luck so far.

I am trying to figure out how the profiler data got inserted into the domain.xml... since the plugin should not be doing that at all.  The v3 plugin starts the server with a 'raw' java command and never needs to write the profiler info into the domain.xml file
Comment 6 gholmer 2011-11-22 16:36:47 UTC
Sorry, the description is not clear because of all the other steps I was following for the TS71 test suite.

/mnt/common is just a filesystem on a different partition (not network mounted).

The "GlassFish 3.1.1" and "NetBeans 7.1" directories are owned by me, and I'm starting NetBeans as myself.

1) Select "Profile / Attach Profiler..." from the main menu.
2) In the dialog, click "define..." for attach mode.
3) Select J2EE Web/App Server, GlassFish v3, Local, Direct.
4) Click Next twice and select Automatic integration (this will modify domain.xml).
5) On the next panel, enter the location of the GlassFish installation ("GlassFish 3.1.1"). NetBeans will find the domain and select it.
6) Click Next. You should see a dialog like in the attached screenshot. You can see that additional jvm-options entries were created by splitting at the space.
Comment 7 gholmer 2011-11-22 16:37:34 UTC
Created attachment 113422 [details]
screenshot

Screenshot showing incorrect changes to domain.xml.
Comment 8 Vince Kraemer 2011-11-22 17:05:21 UTC
thanks for the clarification.

It looks like the code that is writing the offensive option is in here...

profiler.j2ee.sunas/src/org/netbeans/modules/profiler/j2ee/sunas/SunASAutoIntegrationProvider.java
Comment 9 ender01 2012-02-19 13:55:09 UTC
Just wanted to report that on OS X, the default installation path also breaks profiling because of this. Trying to configure GF 3.1.1 going through the wizard leaves you with this option in domain.xml:


Step 2:
AS_JAVA="/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home"

Step 3: The following <profiler> section will be added to domain.xml config file:
<profiler enabled="true" name="NetBeansProfiler">
  <jvm-options>-agentpath:/Applications/NetBeans/NetBeans</jvm-options>
  <jvm-options>7.1.app/Contents/Resources/NetBeans/profiler/lib/deployed/jdk16/mac/libprofilerinterface.jnilib=/Applications/NetBeans/NetBeans</jvm-options>
  <jvm-options>7.1.app/Contents/Resources/NetBeans/profiler/lib,5140</jvm-options>
</profiler>



NOTE! Step2 never seems to be completed either, but not sure if it needs to be. asenv.conf does not have that information in it...
Comment 10 J Bachorik 2012-02-28 10:02:37 UTC
Fixed - http://hg.netbeans.org/profiler-main/rev/9dd54322bf5e
Comment 11 Quality Engineering 2012-03-03 11:33:18 UTC
Integrated into 'main-golden', will be available in build *201203030400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/9dd54322bf5e
User: Jaroslav Bachorik <yardus@netbeans.org>
Log: #205328: Profiler agent path JVM arg should not be split by a space when inserting <jvm-option> elements in the attach wizard =
Comment 12 J Bachorik 2012-04-11 11:07:37 UTC
*** Bug 205349 has been marked as a duplicate of this bug. ***