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 224084 - Cannot run application when GlassFish is running in Profile Mode
Summary: Cannot run application when GlassFish is running in Profile Mode
Status: VERIFIED FIXED
Alias: None
Product: serverplugins
Classification: Unclassified
Component: GlassFish (show other bugs)
Version: 7.2
Hardware: PC All
: P3 normal (vote)
Assignee: TomasKraus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-20 12:24 UTC by Vladimir Riha
Modified: 2013-01-09 02:27 UTC (History)
6 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log (96.71 KB, text/x-log)
2012-12-20 12:24 UTC, Vladimir Riha
Details
IDE log with FINEST logging (387.28 KB, text/x-log)
2013-01-04 13:14 UTC, Vladimir Riha
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Riha 2012-12-20 12:24:08 UTC
Created attachment 129579 [details]
IDE log

To reproduce:
- start NetBeans
- create Java Web application, all default
- start GlassFish 3.1.2.2 in Profile Mode
- wait until "Profiler Agent: Waiting for connection on port 5140 (Protocol version: 13)" is in GlassFish output
- select JavaWeb application node in Projects window, right click and select Run

=> according to specification, server should be restarted but it fails with

Server profiling in progress.
C:\Users\hudson\Documents\NetBeansProjects\WebApplication12\nbproject\build-impl.xml:1033: Deployment error: Server profiling in progress.
See the server log for details.
BUILD FAILED (total time: 0 seconds)


Server log does not contain anything. Snippet of build.xml:

1032| <target if="netbeans.home" name="-run-deploy-nb">
1033|        <nbdeploy clientUrlPart="${client.urlPart}" debugmode="false" forceRedeploy="${forceRedeploy}"/>
1034|    </target>


IDE log attached



Product Version: NetBeans IDE Dev (Build web-main-9571-on-20121219)
Java: 1.7.0_10; Java HotSpot(TM) 64-Bit Server VM 23.6-b04
Runtime: Java(TM) SE Runtime Environment 1.7.0_10-b18
System: Windows 8 version 6.2 running on amd64; Cp1252; en_US (nb)
Comment 1 Petr Jiricka 2013-01-02 15:04:29 UTC
Cc'ing Tomas. Is this really a P3? Sounds like a P2 to me.
Comment 2 TomasKraus 2013-01-03 09:57:16 UTC
OK, let's make it P2.
Comment 3 TomasKraus 2013-01-03 13:46:41 UTC
I was testing profile mode in NB 7.3 many times. Run command is working fine for me.
I know that 'Profile' selection from application context menu may sometimes end up in inconsistent state. But it also works fine in most of the cases.

Please try to test this with last http://bits.netbeans.org/dev/nightly/ which should contain current 7.3 binaries.
Comment 4 Vladimir Riha 2013-01-04 11:50:57 UTC
Still reproducible. Is there some more logging I could give you? 

I also noticed that if I stop Glassfish when it is running in Profile Mode and the invoke Run on the JavaWeb application, the run action again fails with the same problem. What helps is to stop GlassFish when it's in Profile Mode, start in "normally" from context menu in Services window and then run the application. 



Product Version: NetBeans IDE Dev (Build 201301040001)
Java: 1.7.0_10; Java HotSpot(TM) 64-Bit Server VM 23.6-b04
Runtime: Java(TM) SE Runtime Environment 1.7.0_10-b18
System: Windows 8 version 6.2 running on amd64; Cp1252; en_US (nb)
Comment 5 Vladimir Riha 2013-01-04 11:53:43 UTC
...reverting changes I accidentally made by latest comment
Comment 6 TomasKraus 2013-01-04 12:37:11 UTC
Adding -J-Dglassfish.level=0 -J-Dorg.glassfish.tools.ide.level=0 into etc/netbeans.conf:netbeans_default_options will produce finest logs from the module. Maybe it will provide us some hints.
Comment 7 Vladimir Riha 2013-01-04 13:14:20 UTC
Created attachment 129892 [details]
IDE log with FINEST logging
Comment 8 TomasKraus 2013-01-07 14:17:27 UTC
Did some local testing:
-----------------------
1) Start Gf in profile mode
   Profiler Agent: Waiting for connection on port 5140 (Protocol version: 13)
2) Profile an application
   Got some 'Hello world' on http://localhost:8080/WebApplication1/
3) Run application
   Got another 'Hello world'
4) Stop GF
   Got 'The profiled application has finished execution' popup
5) Run application
   Got another 'Hello world'

1) Start Gf in profile mode
   Profiler Agent: Waiting for connection on port 5140 (Protocol version: 13)
2) Run application
   /users/tomas/WS/158753/WebApplication1/nbproject/build-impl.xml:1033:
   Deployment error: Server profiling in progress.
   See the server log for details.

1) Start Gf in profile mode
   Profiler Agent: Waiting for connection on port 5140 (Protocol version: 13)
2) Stop GF
   GlassFish 3.1.2.2 Profiling stopped.
3) Run application
   Got another 'Hello world'

So looks like only 2nd scenario will fail.
There is a workaround. Stopping server (and eventually starting it normally) will get NetBeans into consistent state again.

I do agree that it should work better and IDE should be able to handle all scenarios correctly. But it's not P2, user can access all functionality after server is restarted.
Comment 9 TomasKraus 2013-01-07 17:03:51 UTC
I'm checking Hk2StartServer code and it was written this way - fail build with "Server profiling in progress." message.

Message is in glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/Bundle.properties on line 67:MSG_SERVER_PROFILING_IN_PROGRESS.

Maybe we can extend this message to let user know that he has to restart server before running an application.
Comment 10 TomasKraus 2013-01-08 10:23:26 UTC
Checked into web-main:
----------------------
changeset:   243391:d6a1142c028b
tag:         tip
summary:     #224084 - Better error message

I won't do more changes in 7.3.
Comment 11 Vladimir Riha 2013-01-08 16:06:34 UTC
Thanks, Restart action is disabled but I think it is straightforward to do Stop|Start instead 

Product Version: NetBeans IDE Dev (Build web-main-9658-on-20130108)
Updates: Updates available
Java: 1.7.0_10; Java HotSpot(TM) 64-Bit Server VM 23.6-b04
Runtime: Java(TM) SE Runtime Environment 1.7.0_10-b18
System: Windows 8 version 6.2 running on amd64; Cp1252; en_US (nb)
Comment 12 Quality Engineering 2013-01-09 02:27:22 UTC
Integrated into 'main-golden', will be available in build *201301090001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/d6a1142c028b
User: Tomas Kraus <TomasKraus@netbeans.org>
Log: #224084 - Better error message