Bug 148177 - org.netbeans.modules.j2ee.deployment classes are loaded on NetBeans startup with LimeWire project
org.netbeans.modules.j2ee.deployment classes are loaded on NetBeans startup w...
Status: RESOLVED FIXED
Product: serverplugins
Classification: Unclassified
Component: Infrastructure
6.x
PC Windows XP
: P3 (vote)
: 6.x
Assigned To: Petr Hejl
issues@serverplugins
http://wiki.netbeans.org/FitnessViaWh...
: API, API_REVIEW_FAST, PERFORMANCE, TEST
: 148174 148220 149556 149563 177841 (view as bug list)
Depends on:
Blocks: 180893
  Show dependency treegraph
 
Reported: 2008-09-24 10:13 UTC by Alexander Kouznetsov
Modified: 2010-02-23 22:06 UTC (History)
6 users (show)

See Also:
Issue Type: DEFECT
:


Attachments
Stacktraces (325.53 KB, text/plain)
2008-09-24 10:13 UTC, Alexander Kouznetsov
Details
Stacktraces (83.51 KB, text/plain)
2008-10-14 14:19 UTC, Alexander Kouznetsov
Details
Stacktrace (4.02 KB, text/plain)
2008-12-23 19:07 UTC, Alexander Kouznetsov
Details
the patch (23.45 KB, text/plain)
2010-02-15 04:02 UTC, Petr Hejl
Details
updated patch (38.06 KB, patch)
2010-02-15 14:40 UTC, Petr Hejl
Details | Diff
Autogenerating the overview page from content of arch.xml (6.11 KB, patch)
2010-02-16 01:13 UTC, Jaroslav Tulach
Details | Diff
updated patch (43.82 KB, patch)
2010-02-16 03:30 UTC, Petr Hejl
Details | Diff
updated once again (45.00 KB, patch)
2010-02-17 12:25 UTC, Petr Hejl
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Kouznetsov 2008-09-24 10:13:04 UTC
Performance test reports that the following classes are loaded on NetBeans startup with LimeWare project:

    org.netbeans.modules.j2ee.deployment.config.J2eeModuleAccessor
    org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment
    org.netbeans.modules.j2ee.deployment.devmodules.api.J2eeModule
    org.netbeans.modules.j2ee.deployment.devmodules.spi.InstanceListener
    org.netbeans.modules.j2ee.deployment.impl.Server
    org.netbeans.modules.j2ee.deployment.impl.ServerRegistry
    org.netbeans.modules.j2ee.deployment.impl.ServerRegistry$InstanceInstallListener
    org.netbeans.modules.j2ee.deployment.impl.ServerRegistry$LayerListener
    org.netbeans.modules.j2ee.deployment.impl.ServerRegistry$PluginInstallListener
    org.netbeans.modules.j2ee.deployment.impl.gen.nbd.CommonBean
    org.netbeans.modules.j2ee.deployment.impl.gen.nbd.ContainerLimitation
    org.netbeans.modules.j2ee.deployment.impl.gen.nbd.NetbeansDeployment
    org.netbeans.modules.j2ee.deployment.impl.gen.nbd.WebContextRoot
    org.netbeans.modules.j2ee.deployment.impl.query.J2eePlatformSourceForBinaryQuery
    org.netbeans.modules.j2ee.deployment.impl.sharability.SourceForBinaryQueryImpl
    org.netbeans.modules.j2ee.deployment.plugins.api.InstanceProperties
    org.netbeans.modules.j2ee.deployment.plugins.spi.AntDeploymentProvider
    org.netbeans.modules.j2ee.deployment.plugins.spi.DatasourceManager
    org.netbeans.modules.j2ee.deployment.plugins.spi.FindJSPServlet
    org.netbeans.modules.j2ee.deployment.plugins.spi.IncrementalDeployment
    org.netbeans.modules.j2ee.deployment.plugins.spi.JDBCDriverDeployer
    org.netbeans.modules.j2ee.deployment.plugins.spi.LookupProvider
    org.netbeans.modules.j2ee.deployment.plugins.spi.MessageDestinationDeployment
    org.netbeans.modules.j2ee.deployment.plugins.spi.OptionalDeploymentManagerFactory
    org.netbeans.modules.j2ee.deployment.plugins.spi.ServerInstanceDescriptor
    org.netbeans.modules.j2ee.deployment.plugins.spi.StartServer
    org.netbeans.modules.j2ee.deployment.plugins.spi.TargetModuleIDResolver

Please don't load these classes unless they are really necessary.
Comment 1 Alexander Kouznetsov 2008-09-24 10:13:55 UTC
Created attachment 70419 [details]
Stacktraces
Comment 2 Petr Hejl 2008-09-25 08:53:08 UTC
Any justification for this being filed as P2?
Comment 3 Jaroslav Tulach 2008-09-30 09:43:10 UTC
We are facing significant regression between the start time of IDE without and with open project. In our current 
understanding, the major slowdown is caused by a lot of unneeded and unrelated classes being loaded uselessly.

We have a feeling that it is not appropriate to initialize all J2EE servers when one uses plain JavaSE project. I 
guess the problem is somewhere in these lines:
org.netbeans.modules.j2ee.deployment.devmodules.api.J2eeModule.<clinit>(J2eeModule.java:270)
org.netbeans.modules.j2ee.deployment.impl.ServerRegistry.<clinit>(ServerRegistry.java:565)
org.netbeans.modules.j2ee.deployment.plugins.api.InstanceProperties.getInstanceList(InstanceProperties.java:290)
org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.getServerInstanceIDs(Deployment.java:296)
org.netbeans.modules.j2ee.deployment.impl.query.J2eePlatformSourceForBinaryQuery.findSourceRoots2

Can this be delayed? Used only with Web projects? If not, then OK, let leave the fix for post 6.5, but please spend 
some time investigating this problem now. Thanks.
Comment 4 Petr Hejl 2008-10-02 12:10:38 UTC
*** Issue 148220 has been marked as a duplicate of this issue. ***
Comment 5 Petr Hejl 2008-10-02 12:38:21 UTC
Looks like org.netbeans.modules.java.source.classpath.GlobalSourcePath is querying all registered
SourceForBinaryQueries. As server plugins can provide sources to the classes they publish the j2eeserver module
registers J2eePlatformSourceForBinaryQuery that queries the registered instances.

Right now I can't find any safe solution for 6.5 as SourceForBinaryQuery does not pass any project related information
afaik.
Comment 6 Petr Hejl 2008-10-02 14:18:24 UTC
As there is no project information available in query implementation it is impossible (in the current state) to avoid
server instance initialization. The problem was not introduced in 6.5. Lowering to P3.
Comment 7 Tomas Zezula 2008-10-02 14:26:13 UTC
I doubt that this is a regression, any query to the SFBQ which is not handled by some SQBQImpl with higher priority causes initialization of servers. The j2ee 
query needs to know the location of binaries to either return null or SQBQ.Result. In the future the j2ee SFBQ can do some caching of binaries but it may cause 
problems when the server changes outside the IDE.
Comment 8 Alexander Kouznetsov 2008-10-02 14:42:55 UTC
Classes from issue 148220:

    org.netbeans.modules.j2ee.sun.ide.dm.Bundle
    org.netbeans.modules.j2ee.sun.ide.dm.Bundle_ru
    org.netbeans.modules.j2ee.sun.ide.dm.Bundle_ru_RU
    org.netbeans.modules.j2ee.sun.ide.dm.Constants
    org.netbeans.modules.j2ee.sun.ide.dm.SunDeploymentFactory
    org.netbeans.modules.j2ee.sun.ide.j2ee.Constants
    org.netbeans.modules.j2ee.sun.ide.j2ee.OptionalFactory
    org.netbeans.modules.j2ee.sun.ide.j2ee.PluginProperties
    org.netbeans.modules.j2ee.sun.share.CharsetMapping
    org.netbeans.modules.j2ee.sun.share.SecurityMasterListModel
    org.netbeans.modules.j2ee.weblogic9.WLDeploymentFactory
    org.netbeans.modules.j2ee.weblogic9.WLDeploymentManager
    org.netbeans.modules.j2ee.weblogic9.optional.WLOptionalDeploymentManagerFactory
    org.netbeans.modules.j2ee.websphere6.WSDeploymentFactory
    org.netbeans.modules.j2ee.websphere6.WSVersion
    org.netbeans.modules.j2ee.websphere6.optional.WSOptionalDeploymentManagerFactory

Comment 9 Petr Hejl 2008-10-08 13:19:30 UTC
*** Issue 148174 has been marked as a duplicate of this issue. ***
Comment 10 Petr Hejl 2008-10-08 13:20:33 UTC
Classes from issue 148174:

    org.netbeans.modules.glassfish.common.GlassfishInstanceProvider
    org.netbeans.modules.glassfish.javaee.Hk2DeploymentFactory
    org.netbeans.modules.glassfish.javaee.Hk2OptionalFactory
    org.netbeans.modules.glassfish.spi.ServerUtilities
Comment 11 Petr Hejl 2008-10-08 20:34:59 UTC
*** Issue 149556 has been marked as a duplicate of this issue. ***
Comment 12 Petr Hejl 2008-10-08 20:35:44 UTC
Classes from issue 149556:

org.netbeans.modules.tomcat5.TomcatFactory
org.netbeans.modules.tomcat5.TomcatManager$TomcatVersion
org.netbeans.modules.tomcat5.ide.OptionalFactory
Comment 13 Petr Hejl 2008-10-08 20:37:38 UTC
*** Issue 149563 has been marked as a duplicate of this issue. ***
Comment 14 Petr Hejl 2008-10-08 20:38:32 UTC
Classes from issue 149563:

org.netbeans.spi.server.ServerInstanceProvider
Comment 15 Alexander Kouznetsov 2008-10-14 14:17:03 UTC
The following three classes shouldn't also be loaded:

javax.enterprise.deploy.shared.factories.DeploymentFactoryManager
javax.enterprise.deploy.spi.DeploymentManager
javax.enterprise.deploy.spi.exceptions.DeploymentManagerCreationException

Comment from jtulach:
Loaded by 
org.netbeans.modules.j2ee.deployment.impl.ServerRegistry.addPlugin(ServerRegistry.java:181)
imho a bug in j2eeserver.
Comment 16 Alexander Kouznetsov 2008-10-14 14:19:51 UTC
Created attachment 71766 [details]
Stacktraces
Comment 17 Alexander Kouznetsov 2008-12-23 19:06:17 UTC
One more class to avoid:

org.netbeans.modules.websvc.wsstack.jaxrs.glassfish.v3.GlassFishV3LookupProvider
Comment 18 Alexander Kouznetsov 2008-12-23 19:07:32 UTC
Created attachment 75279 [details]
Stacktrace
Comment 19 Petr Jiricka 2009-06-08 15:07:20 UTC
Moving to j2eeserver, where most of these classes reside.
Comment 20 Petr Jiricka 2009-06-11 09:16:39 UTC
Updated list of classes from serverplugins in build 20090608, per issue 148178:

    org.netbeans.modules.j2ee.genericserver.GSDeploymentFactory
    org.netbeans.modules.j2ee.genericserver.ide.GSOptionalDeploymentManagerFactory
    org.netbeans.modules.j2ee.jboss4.JBDeploymentFactory
    org.netbeans.modules.j2ee.jboss4.ide.JBOptionalDeploymentManagerFactory
    org.netbeans.modules.j2ee.jboss4.ide.ui.JBPluginUtils
    org.netbeans.modules.j2ee.jboss4.ide.ui.JBPluginUtils$Version
    org.netbeans.modules.j2ee.sun.api.ServerLocationManager
    org.netbeans.modules.j2ee.sun.ide.dm.Bundle
    org.netbeans.modules.j2ee.sun.ide.dm.Bundle_en
    org.netbeans.modules.j2ee.sun.ide.dm.Bundle_en_US
    org.netbeans.modules.j2ee.sun.ide.dm.Constants
    org.netbeans.modules.j2ee.sun.ide.dm.SunDeploymentFactory
    org.netbeans.modules.j2ee.sun.ide.j2ee.Constants
    org.netbeans.modules.j2ee.sun.ide.j2ee.OptionalFactory
    org.netbeans.modules.j2ee.sun.ide.j2ee.PluginProperties
    org.netbeans.modules.j2ee.sun.ide.j2ee.RunTimeDDCatalog
    org.netbeans.modules.j2ee.sun.share.CharsetMapping
    org.netbeans.modules.j2ee.sun.share.SecurityMasterListModel
    org.netbeans.modules.j2ee.weblogic9.WLDeploymentFactory
    org.netbeans.modules.j2ee.weblogic9.WLDeploymentManager
    org.netbeans.modules.j2ee.weblogic9.optional.WLOptionalDeploymentManagerFactory
Comment 21 Oleg Khokhlov 2009-06-11 10:37:51 UTC
ok, for full update from the same build (20090608) 

j2ee.deployment classes:
    org.netbeans.modules.j2ee.deployment.config.J2eeModuleAccessor
    org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment
    org.netbeans.modules.j2ee.deployment.devmodules.api.J2eeModule
    org.netbeans.modules.j2ee.deployment.devmodules.spi.InstanceListener
    org.netbeans.modules.j2ee.deployment.impl.Server
    org.netbeans.modules.j2ee.deployment.impl.ServerRegistry
    org.netbeans.modules.j2ee.deployment.impl.ServerRegistry$InstanceInstallListener
    org.netbeans.modules.j2ee.deployment.impl.ServerRegistry$PluginInstallListener
    org.netbeans.modules.j2ee.deployment.impl.gen.nbd.CommonBean
    org.netbeans.modules.j2ee.deployment.impl.gen.nbd.ContainerLimitation
    org.netbeans.modules.j2ee.deployment.impl.gen.nbd.NetbeansDeployment
    org.netbeans.modules.j2ee.deployment.impl.gen.nbd.WebContextRoot
    org.netbeans.modules.j2ee.deployment.impl.query.J2eePlatformSourceForBinaryQuery
    org.netbeans.modules.j2ee.deployment.impl.sharability.SourceForBinaryQueryImpl
    org.netbeans.modules.j2ee.deployment.plugins.api.InstanceProperties
    org.netbeans.modules.j2ee.deployment.plugins.spi.AntDeploymentProvider
    org.netbeans.modules.j2ee.deployment.plugins.spi.DatasourceManager
    org.netbeans.modules.j2ee.deployment.plugins.spi.FindJSPServlet
    org.netbeans.modules.j2ee.deployment.plugins.spi.IncrementalDeployment
    org.netbeans.modules.j2ee.deployment.plugins.spi.JDBCDriverDeployer
    org.netbeans.modules.j2ee.deployment.plugins.spi.LookupProvider
    org.netbeans.modules.j2ee.deployment.plugins.spi.MessageDestinationDeployment
    org.netbeans.modules.j2ee.deployment.plugins.spi.OptionalDeploymentManagerFactory
    org.netbeans.modules.j2ee.deployment.plugins.spi.ServerInitializationException
    org.netbeans.modules.j2ee.deployment.plugins.spi.ServerInstanceDescriptor
    org.netbeans.modules.j2ee.deployment.plugins.spi.StartServer
    org.netbeans.modules.j2ee.deployment.plugins.spi.TargetModuleIDResolver

and glassfish

    org.netbeans.modules.glassfish.common.GlassfishInstanceProvider
    org.netbeans.modules.glassfish.javaee.Hk2DeploymentFactory
    org.netbeans.modules.glassfish.javaee.Hk2OptionalFactory
    org.netbeans.modules.glassfish.javaee.RunTimeDDCatalog
    org.netbeans.modules.glassfish.javaee.ide.RegisteredDDCatalogImpl
    org.netbeans.modules.glassfish.spi.RegisteredDDCatalog
    org.netbeans.modules.glassfish.spi.ServerUtilities

tomcat
    org.netbeans.modules.tomcat5.TomcatFactory
    org.netbeans.modules.tomcat5.TomcatManager$TomcatVersion
    org.netbeans.modules.tomcat5.ide.OptionalFactory

enterprise
    javax.enterprise.deploy.shared.factories.DeploymentFactoryManager
    javax.enterprise.deploy.spi.DeploymentManager
    javax.enterprise.deploy.spi.exceptions.DeploymentManagerCreationException

websvc
    org.netbeans.modules.websvc.wsstack.jaxrs.glassfish.v2.GlassFishV2LookupProvider
    org.netbeans.modules.websvc.wsstack.jaxrs.glassfish.v3.GlassFishV3LookupProvider
    org.netbeans.modules.websvc.wsstack.jaxws.glassfish.v2.GlassFishV2LookupProvider
    org.netbeans.modules.websvc.wsstack.jaxws.glassfish.v3.GlassFishV3LookupProvider
    org.netbeans.modules.websvc.wsstack.jaxws.glassfish.v3.GlassFishV3ee6LookupProvider
    org.netbeans.modules.websvc.wsstack.jaxws.jboss.JBossLookupProvider
    org.netbeans.modules.websvc.wsstack.jaxws.tomcat.TomcatLookupProvider
    org.netbeans.modules.websvc.wsstack.jaxws.weblogic.WebLogicLookupProvider

Comment 22 Petr Hejl 2010-02-10 07:44:34 UTC
*** Bug 177841 has been marked as a duplicate of this bug. ***
Comment 23 Petr Hejl 2010-02-15 04:02:04 UTC
Optional FO attribute added to prevent loading when not rally necessary.

Please review.

Vince, can you review changes I made to your code? Thanks.
Comment 24 Petr Hejl 2010-02-15 04:02:57 UTC
Created attachment 94152 [details]
the patch
Comment 25 Jaroslav Tulach 2010-02-15 05:41:42 UTC
Very good. Simple & effective.

Y01 Mention the urlPattern as a property in arch.xml as <api .../>
Comment 26 Petr Hejl 2010-02-15 14:40:39 UTC
Created attachment 94175 [details]
updated patch

Updated patch:
- updated plugin layer description
- test
Comment 27 Jaroslav Tulach 2010-02-16 01:04:51 UTC
Re. Y01: Rather than changing apichanges.xml and defining new apidef I suggest to use <api/> tag in arch.xml. More info at http://wiki.netbeans.org/APIDevelopment If you do this, the overview page of 
http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-j2eeserver/overview-summary.html shall get nice table with list of exported APIs[1][2].


[1] There is broken link on that page
[2] I suggest to make it more standard, I can help with that.
Comment 28 Jaroslav Tulach 2010-02-16 01:13:33 UTC
Created attachment 94181 [details]
Autogenerating the overview page from content of arch.xml
Comment 29 Petr Hejl 2010-02-16 03:30:28 UTC
Created attachment 94185 [details]
updated patch

Updated. Thanks Jarda.
Comment 30 Petr Hejl 2010-02-17 12:25:04 UTC
Created attachment 94250 [details]
updated once again

I realized that usage of ProxyDeploymentFactory is
- safer (no changes in ServerRegistry/Server)
- does not depend on FO name
Comment 31 Petr Hejl 2010-02-22 07:38:06 UTC
I'll integrate changes tomorrow.
Comment 32 Petr Hejl 2010-02-23 03:05:11 UTC
Fixed in web-main 08f0a4641834.
Comment 33 Petr Hejl 2010-02-23 03:43:05 UTC
Forgot to add new files :(

web-main fc2cfbd72415.
Comment 34 Quality Engineering 2010-02-23 22:06:40 UTC
Integrated into 'main-golden', will be available in build *201002240200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/08f0a4641834
User: Petr Hejl <phejl@netbeans.org>
Log: #148177 org.netbeans.modules.j2ee.deployment classes are loaded on NetBeans startup with LimeWire project (edit)


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