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.
When profiling a JavaEE project the server startup takes cca. 1-2 minutes even for the simplest projects. First, I thought it wasn't working at all - I only realized it did when I left the IDE be and went on to do something else. It is easy to reproduce: 1. Create a sample project - eg. "Serlvet Stateless" from Java Web samples 2. Make sure the target server is GlassFish 3 3. Profile the project 4. The server startup gets blocked for cca. 1.5 minutes I came to realize that this problem was introduced while attempting to fix #195441. The fix tries to resolve the problem of prematurely deploying applications to the profiled server when it is not ready by employing additional checks for the server state - unfortunately in a way that prevents the server to reach the desired state. In an ant based project ahe checks are invoked before the profiler client connects to the profiler agent (piggybacked on the server) and allows the target JVM to continue - as such the server stays blocked, the checks stay blocked and the whole system basically waits for the checks to time out. In a maven based project the server startup and the profiler attach are performed concurrently and as such not causing any lock ups.
Created attachment 109081 [details] Proposed patch I am attaching a proposed patch. It is not in the server plugin area, per se, but it does solve both of the problems. The patch makes sure that when deploying to a server in profiling mode the server will be in a desired state before trying to run the deploy operation. The changes are localized only to the profiling specific part so they don't affect the rest of the deployment process.
Cc Petr Hejl for the j2eeserver part.
I get a 1 minute pause, too. Since the start-up does complete and the profiler attaches, I am not eager to change this for 7.0.1... since we do not have a lot of time to see what other fall-out there may be. Targeting to 7.1
*** Bug 197213 has been marked as a duplicate of this bug. ***
PetrH: this looks like a rollback of some changes I made in the GF plugin and a more significant change in j2eeserver... Please evaluate.
From j2eeserver perspective I would rather see CountDownLatch as the code in the patch is hard to read and does not prevent spurious wakeups. I would also put remove listener code to finally block.
I am fine with whatever fix that works. The patch was just a proposal which scratched my itch.
Created attachment 110747 [details] the patch I'm happy with The patch with fixed java EE part.
I attached the patch I like (the Java EE part). I'm not sure about the GF part. Once this is cleared feel free to apply the patch.
Integrated into 'main-golden' Changeset: http://hg.netbeans.org/main-golden/rev/31982c6873c2 User: vince kraemer <vkraemer@netbeans.org> Log: #199655 : prevent long start-up delay for ant-based Java EE projets
in the build
verified, it no longer takes that much time, but it still doesn't feel very snappy either