You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Sergey Epik (Created) (JIRA)" <ji...@apache.org> on 2011/12/07 22:18:39 UTC

[jira] [Created] (FELIX-3262) Startup delay due to URLHandlersBundleStreamHandler

Startup delay due to URLHandlersBundleStreamHandler 
----------------------------------------------------

                 Key: FELIX-3262
                 URL: https://issues.apache.org/jira/browse/FELIX-3262
             Project: Felix
          Issue Type: Improvement
          Components: Framework
    Affects Versions: framework-3.0.9
         Environment: Karaf 2.2.3 with spring-dm, spring
            Reporter: Sergey Epik


Problem: slow startup of bundles that use spring and spring-dm.

When spring-dm starts spring application context, it puts a lot of objects that contain URL into set/map structures.
URL.hashCode delegates call to handler. 
URLHandlersBundleStreamHandler does not implement hashCode(URL u), but URLStreamHandler (parent) calls InetAddress.getByName(name) with bundle number. 
This call is very slow and method URLStreamHandler.getHostAddress is synchronized.

We have found that Equinox's handler org.eclipse.osgi.framework.internal.core.BundleResourceHandler overrides hashCode(URL u).

Here is thread dump that demonstrates problem:

[...]
"SpringOsgiExtenderThread-14" - Thread t@43
   java.lang.Thread.State: BLOCKED
	at java.net.URLStreamHandler.getHostAddress(URLStreamHandler.java:412)
	- waiting to lock <2a6cb4c8> (a org.apache.felix.framework.URLHandlersBundleStreamHandler) owned by "SpringOsgiExtenderThread-2" t@31
	at java.net.URLStreamHandler.hashCode(URLStreamHandler.java:337)
	at java.net.URL.hashCode(URL.java:857)
	- locked <430eaae5> (a java.net.URL)
	at org.springframework.core.io.UrlResource.hashCode(UrlResource.java:217)
	at java.util.HashMap.put(HashMap.java:372)
	at java.util.HashSet.add(HashSet.java:200)
	at org.springframework.osgi.io.OsgiBundleResourcePatternResolver.doRetrieveMatchingBundleEntries(OsgiBundleResourcePatternResolver.java:707)
	at org.springframework.osgi.io.OsgiBundleResourcePatternResolver.doFindPathMatchingFileResources(OsgiBundleResourcePatternResolver.java:634)
	at org.springframework.osgi.io.OsgiBundleResourcePatternResolver.findPathMatchingResources(OsgiBundleResourcePatternResolver.java:577)
	at org.springframework.osgi.io.OsgiBundleResourcePatternResolver.findResources(OsgiBundleResourcePatternResolver.java:167)
	at org.springframework.osgi.io.OsgiBundleResourcePatternResolver.getResources(OsgiBundleResourcePatternResolver.java:197)
	at org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext.getResources(AbstractOsgiBundleApplicationContext.java:425)
	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:177)
	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
	at org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:164)
	at org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:136)
	at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
	at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467)
	at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$800(AbstractDelegatedExecutionApplicationContext.java:69)
	at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$3.run(AbstractDelegatedExecutionApplicationContext.java:269)
	- locked <77f5c2c7> (a java.lang.Object)
	at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
	at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:247)
	at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:214)
	at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:169)
	at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:175)
	at org.springframework.osgi.extender.internal.activator.ContextLoaderListener$2.run(ContextLoaderListener.java:716)
	at java.lang.Thread.run(Thread.java:662)

   Locked ownable synchronizers:
	- None

"SpringOsgiExtenderThread-13" - Thread t@42
   java.lang.Thread.State: BLOCKED
	at java.net.URLStreamHandler.getHostAddress(URLStreamHandler.java:412)
	- waiting to lock <2a6cb4c8> (a org.apache.felix.framework.URLHandlersBundleStreamHandler) owned by "SpringOsgiExtenderThread-2" t@31
	at java.net.URLStreamHandler.hashCode(URLStreamHandler.java:337)
	at java.net.URL.hashCode(URL.java:857)
	- locked <6e9ef1ce> (a java.net.URL)
	at org.springframework.core.io.UrlResource.hashCode(UrlResource.java:217)
	at java.util.HashMap.put(HashMap.java:372)
	at java.util.HashSet.add(HashSet.java:200)
	at org.springframework.osgi.io.OsgiBundleResourcePatternResolver.doRetrieveMatchingBundleEntries(OsgiBundleResourcePatternResolver.java:707)
	at org.springframework.osgi.io.OsgiBundleResourcePatternResolver.doFindPathMatchingFileResources(OsgiBundleResourcePatternResolver.java:634)
	at org.springframework.osgi.io.OsgiBundleResourcePatternResolver.findPathMatchingResources(OsgiBundleResourcePatternResolver.java:577)
	at org.springframework.osgi.io.OsgiBundleResourcePatternResolver.findResources(OsgiBundleResourcePatternResolver.java:167)
	at org.springframework.osgi.io.OsgiBundleResourcePatternResolver.getResources(OsgiBundleResourcePatternResolver.java:197)
	at org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext.getResources(AbstractOsgiBundleApplicationContext.java:425)
	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:177)
	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
	at org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:164)
	at org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:136)
	at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
	at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467)
	at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$800(AbstractDelegatedExecutionApplicationContext.java:69)
	at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$3.run(AbstractDelegatedExecutionApplicationContext.java:269)
	- locked <515441f> (a java.lang.Object)
	at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
	at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:247)
	at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:214)
	at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:169)
	at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:175)
	at org.springframework.osgi.extender.internal.activator.ContextLoaderListener$2.run(ContextLoaderListener.java:716)
	at java.lang.Thread.run(Thread.java:662)

   Locked ownable synchronizers:
	- None
[...]

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (FELIX-3262) Startup delay due to URLHandlersBundleStreamHandler

Posted by "Richard S. Hall (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-3262?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Richard S. Hall updated FELIX-3262:
-----------------------------------

    Fix Version/s:     (was: framework-4.0.2)
                   framework-4.2.0
    
> Startup delay due to URLHandlersBundleStreamHandler 
> ----------------------------------------------------
>
>                 Key: FELIX-3262
>                 URL: https://issues.apache.org/jira/browse/FELIX-3262
>             Project: Felix
>          Issue Type: Improvement
>          Components: Framework
>    Affects Versions: framework-3.0.9
>         Environment: Karaf 2.2.3 with spring-dm, spring
>            Reporter: Sergey Epik
>            Assignee: Karl Pauls
>             Fix For: framework-4.2.0
>
>         Attachments: getHosts-osgiextender.txt
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> Problem: slow startup of bundles that use spring and spring-dm.
> When spring-dm starts spring application context, it puts a lot of objects that contain URL into set/map structures.
> URL.hashCode delegates call to handler. 
> URLHandlersBundleStreamHandler does not implement hashCode(URL u), but URLStreamHandler (parent) calls InetAddress.getByName(name) with bundle number. 
> This call is very slow and method URLStreamHandler.getHostAddress is synchronized.
> We have found that Equinox's handler org.eclipse.osgi.framework.internal.core.BundleResourceHandler overrides hashCode(URL u).
> Thread dump that demonstrates problem is attached.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (FELIX-3262) Startup delay due to URLHandlersBundleStreamHandler

Posted by "Sergey Epik (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-3262?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sergey Epik updated FELIX-3262:
-------------------------------

    Attachment: getHosts-osgiextender.txt

Thread dump that demonstrates problem.
                
> Startup delay due to URLHandlersBundleStreamHandler 
> ----------------------------------------------------
>
>                 Key: FELIX-3262
>                 URL: https://issues.apache.org/jira/browse/FELIX-3262
>             Project: Felix
>          Issue Type: Improvement
>          Components: Framework
>    Affects Versions: framework-3.0.9
>         Environment: Karaf 2.2.3 with spring-dm, spring
>            Reporter: Sergey Epik
>         Attachments: getHosts-osgiextender.txt
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> Problem: slow startup of bundles that use spring and spring-dm.
> When spring-dm starts spring application context, it puts a lot of objects that contain URL into set/map structures.
> URL.hashCode delegates call to handler. 
> URLHandlersBundleStreamHandler does not implement hashCode(URL u), but URLStreamHandler (parent) calls InetAddress.getByName(name) with bundle number. 
> This call is very slow and method URLStreamHandler.getHostAddress is synchronized.
> We have found that Equinox's handler org.eclipse.osgi.framework.internal.core.BundleResourceHandler overrides hashCode(URL u).
> Here is thread dump that demonstrates problem:
> [...]
> "SpringOsgiExtenderThread-14" - Thread t@43
>    java.lang.Thread.State: BLOCKED
> 	at java.net.URLStreamHandler.getHostAddress(URLStreamHandler.java:412)
> 	- waiting to lock <2a6cb4c8> (a org.apache.felix.framework.URLHandlersBundleStreamHandler) owned by "SpringOsgiExtenderThread-2" t@31
> 	at java.net.URLStreamHandler.hashCode(URLStreamHandler.java:337)
> 	at java.net.URL.hashCode(URL.java:857)
> 	- locked <430eaae5> (a java.net.URL)
> 	at org.springframework.core.io.UrlResource.hashCode(UrlResource.java:217)
> 	at java.util.HashMap.put(HashMap.java:372)
> 	at java.util.HashSet.add(HashSet.java:200)
> 	at org.springframework.osgi.io.OsgiBundleResourcePatternResolver.doRetrieveMatchingBundleEntries(OsgiBundleResourcePatternResolver.java:707)
> 	at org.springframework.osgi.io.OsgiBundleResourcePatternResolver.doFindPathMatchingFileResources(OsgiBundleResourcePatternResolver.java:634)
> 	at org.springframework.osgi.io.OsgiBundleResourcePatternResolver.findPathMatchingResources(OsgiBundleResourcePatternResolver.java:577)
> 	at org.springframework.osgi.io.OsgiBundleResourcePatternResolver.findResources(OsgiBundleResourcePatternResolver.java:167)
> 	at org.springframework.osgi.io.OsgiBundleResourcePatternResolver.getResources(OsgiBundleResourcePatternResolver.java:197)
> 	at org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext.getResources(AbstractOsgiBundleApplicationContext.java:425)
> 	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:177)
> 	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
> 	at org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:164)
> 	at org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:136)
> 	at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
> 	at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467)
> 	at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$800(AbstractDelegatedExecutionApplicationContext.java:69)
> 	at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$3.run(AbstractDelegatedExecutionApplicationContext.java:269)
> 	- locked <77f5c2c7> (a java.lang.Object)
> 	at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
> 	at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:247)
> 	at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:214)
> 	at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:169)
> 	at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:175)
> 	at org.springframework.osgi.extender.internal.activator.ContextLoaderListener$2.run(ContextLoaderListener.java:716)
> 	at java.lang.Thread.run(Thread.java:662)
>    Locked ownable synchronizers:
> 	- None
> "SpringOsgiExtenderThread-13" - Thread t@42
>    java.lang.Thread.State: BLOCKED
> 	at java.net.URLStreamHandler.getHostAddress(URLStreamHandler.java:412)
> 	- waiting to lock <2a6cb4c8> (a org.apache.felix.framework.URLHandlersBundleStreamHandler) owned by "SpringOsgiExtenderThread-2" t@31
> 	at java.net.URLStreamHandler.hashCode(URLStreamHandler.java:337)
> 	at java.net.URL.hashCode(URL.java:857)
> 	- locked <6e9ef1ce> (a java.net.URL)
> 	at org.springframework.core.io.UrlResource.hashCode(UrlResource.java:217)
> 	at java.util.HashMap.put(HashMap.java:372)
> 	at java.util.HashSet.add(HashSet.java:200)
> 	at org.springframework.osgi.io.OsgiBundleResourcePatternResolver.doRetrieveMatchingBundleEntries(OsgiBundleResourcePatternResolver.java:707)
> 	at org.springframework.osgi.io.OsgiBundleResourcePatternResolver.doFindPathMatchingFileResources(OsgiBundleResourcePatternResolver.java:634)
> 	at org.springframework.osgi.io.OsgiBundleResourcePatternResolver.findPathMatchingResources(OsgiBundleResourcePatternResolver.java:577)
> 	at org.springframework.osgi.io.OsgiBundleResourcePatternResolver.findResources(OsgiBundleResourcePatternResolver.java:167)
> 	at org.springframework.osgi.io.OsgiBundleResourcePatternResolver.getResources(OsgiBundleResourcePatternResolver.java:197)
> 	at org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext.getResources(AbstractOsgiBundleApplicationContext.java:425)
> 	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:177)
> 	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
> 	at org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:164)
> 	at org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:136)
> 	at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
> 	at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467)
> 	at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$800(AbstractDelegatedExecutionApplicationContext.java:69)
> 	at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$3.run(AbstractDelegatedExecutionApplicationContext.java:269)
> 	- locked <515441f> (a java.lang.Object)
> 	at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
> 	at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:247)
> 	at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:214)
> 	at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:169)
> 	at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:175)
> 	at org.springframework.osgi.extender.internal.activator.ContextLoaderListener$2.run(ContextLoaderListener.java:716)
> 	at java.lang.Thread.run(Thread.java:662)
>    Locked ownable synchronizers:
> 	- None
> [...]

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (FELIX-3262) Startup delay due to URLHandlersBundleStreamHandler

Posted by "Sergey Epik (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-3262?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sergey Epik updated FELIX-3262:
-------------------------------

    Description: 
Problem: slow startup of bundles that use spring and spring-dm.

When spring-dm starts spring application context, it puts a lot of objects that contain URL into set/map structures.
URL.hashCode delegates call to handler. 
URLHandlersBundleStreamHandler does not implement hashCode(URL u), but URLStreamHandler (parent) calls InetAddress.getByName(name) with bundle number. 
This call is very slow and method URLStreamHandler.getHostAddress is synchronized.

We have found that Equinox's handler org.eclipse.osgi.framework.internal.core.BundleResourceHandler overrides hashCode(URL u).

Thread dump that demonstrates problem is attached.


  was:
Problem: slow startup of bundles that use spring and spring-dm.

When spring-dm starts spring application context, it puts a lot of objects that contain URL into set/map structures.
URL.hashCode delegates call to handler. 
URLHandlersBundleStreamHandler does not implement hashCode(URL u), but URLStreamHandler (parent) calls InetAddress.getByName(name) with bundle number. 
This call is very slow and method URLStreamHandler.getHostAddress is synchronized.

We have found that Equinox's handler org.eclipse.osgi.framework.internal.core.BundleResourceHandler overrides hashCode(URL u).

Here is thread dump that demonstrates problem:

[...]
"SpringOsgiExtenderThread-14" - Thread t@43
   java.lang.Thread.State: BLOCKED
	at java.net.URLStreamHandler.getHostAddress(URLStreamHandler.java:412)
	- waiting to lock <2a6cb4c8> (a org.apache.felix.framework.URLHandlersBundleStreamHandler) owned by "SpringOsgiExtenderThread-2" t@31
	at java.net.URLStreamHandler.hashCode(URLStreamHandler.java:337)
	at java.net.URL.hashCode(URL.java:857)
	- locked <430eaae5> (a java.net.URL)
	at org.springframework.core.io.UrlResource.hashCode(UrlResource.java:217)
	at java.util.HashMap.put(HashMap.java:372)
	at java.util.HashSet.add(HashSet.java:200)
	at org.springframework.osgi.io.OsgiBundleResourcePatternResolver.doRetrieveMatchingBundleEntries(OsgiBundleResourcePatternResolver.java:707)
	at org.springframework.osgi.io.OsgiBundleResourcePatternResolver.doFindPathMatchingFileResources(OsgiBundleResourcePatternResolver.java:634)
	at org.springframework.osgi.io.OsgiBundleResourcePatternResolver.findPathMatchingResources(OsgiBundleResourcePatternResolver.java:577)
	at org.springframework.osgi.io.OsgiBundleResourcePatternResolver.findResources(OsgiBundleResourcePatternResolver.java:167)
	at org.springframework.osgi.io.OsgiBundleResourcePatternResolver.getResources(OsgiBundleResourcePatternResolver.java:197)
	at org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext.getResources(AbstractOsgiBundleApplicationContext.java:425)
	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:177)
	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
	at org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:164)
	at org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:136)
	at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
	at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467)
	at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$800(AbstractDelegatedExecutionApplicationContext.java:69)
	at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$3.run(AbstractDelegatedExecutionApplicationContext.java:269)
	- locked <77f5c2c7> (a java.lang.Object)
	at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
	at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:247)
	at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:214)
	at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:169)
	at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:175)
	at org.springframework.osgi.extender.internal.activator.ContextLoaderListener$2.run(ContextLoaderListener.java:716)
	at java.lang.Thread.run(Thread.java:662)

   Locked ownable synchronizers:
	- None

"SpringOsgiExtenderThread-13" - Thread t@42
   java.lang.Thread.State: BLOCKED
	at java.net.URLStreamHandler.getHostAddress(URLStreamHandler.java:412)
	- waiting to lock <2a6cb4c8> (a org.apache.felix.framework.URLHandlersBundleStreamHandler) owned by "SpringOsgiExtenderThread-2" t@31
	at java.net.URLStreamHandler.hashCode(URLStreamHandler.java:337)
	at java.net.URL.hashCode(URL.java:857)
	- locked <6e9ef1ce> (a java.net.URL)
	at org.springframework.core.io.UrlResource.hashCode(UrlResource.java:217)
	at java.util.HashMap.put(HashMap.java:372)
	at java.util.HashSet.add(HashSet.java:200)
	at org.springframework.osgi.io.OsgiBundleResourcePatternResolver.doRetrieveMatchingBundleEntries(OsgiBundleResourcePatternResolver.java:707)
	at org.springframework.osgi.io.OsgiBundleResourcePatternResolver.doFindPathMatchingFileResources(OsgiBundleResourcePatternResolver.java:634)
	at org.springframework.osgi.io.OsgiBundleResourcePatternResolver.findPathMatchingResources(OsgiBundleResourcePatternResolver.java:577)
	at org.springframework.osgi.io.OsgiBundleResourcePatternResolver.findResources(OsgiBundleResourcePatternResolver.java:167)
	at org.springframework.osgi.io.OsgiBundleResourcePatternResolver.getResources(OsgiBundleResourcePatternResolver.java:197)
	at org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext.getResources(AbstractOsgiBundleApplicationContext.java:425)
	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:177)
	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
	at org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:164)
	at org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:136)
	at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
	at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467)
	at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$800(AbstractDelegatedExecutionApplicationContext.java:69)
	at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$3.run(AbstractDelegatedExecutionApplicationContext.java:269)
	- locked <515441f> (a java.lang.Object)
	at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
	at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:247)
	at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:214)
	at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:169)
	at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:175)
	at org.springframework.osgi.extender.internal.activator.ContextLoaderListener$2.run(ContextLoaderListener.java:716)
	at java.lang.Thread.run(Thread.java:662)

   Locked ownable synchronizers:
	- None
[...]

    
> Startup delay due to URLHandlersBundleStreamHandler 
> ----------------------------------------------------
>
>                 Key: FELIX-3262
>                 URL: https://issues.apache.org/jira/browse/FELIX-3262
>             Project: Felix
>          Issue Type: Improvement
>          Components: Framework
>    Affects Versions: framework-3.0.9
>         Environment: Karaf 2.2.3 with spring-dm, spring
>            Reporter: Sergey Epik
>         Attachments: getHosts-osgiextender.txt
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> Problem: slow startup of bundles that use spring and spring-dm.
> When spring-dm starts spring application context, it puts a lot of objects that contain URL into set/map structures.
> URL.hashCode delegates call to handler. 
> URLHandlersBundleStreamHandler does not implement hashCode(URL u), but URLStreamHandler (parent) calls InetAddress.getByName(name) with bundle number. 
> This call is very slow and method URLStreamHandler.getHostAddress is synchronized.
> We have found that Equinox's handler org.eclipse.osgi.framework.internal.core.BundleResourceHandler overrides hashCode(URL u).
> Thread dump that demonstrates problem is attached.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (FELIX-3262) Startup delay due to URLHandlersBundleStreamHandler

Posted by "Richard S. Hall (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-3262?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Richard S. Hall updated FELIX-3262:
-----------------------------------

    Fix Version/s: framework-4.0.2
    
> Startup delay due to URLHandlersBundleStreamHandler 
> ----------------------------------------------------
>
>                 Key: FELIX-3262
>                 URL: https://issues.apache.org/jira/browse/FELIX-3262
>             Project: Felix
>          Issue Type: Improvement
>          Components: Framework
>    Affects Versions: framework-3.0.9
>         Environment: Karaf 2.2.3 with spring-dm, spring
>            Reporter: Sergey Epik
>            Assignee: Karl Pauls
>             Fix For: framework-4.0.2
>
>         Attachments: getHosts-osgiextender.txt
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> Problem: slow startup of bundles that use spring and spring-dm.
> When spring-dm starts spring application context, it puts a lot of objects that contain URL into set/map structures.
> URL.hashCode delegates call to handler. 
> URLHandlersBundleStreamHandler does not implement hashCode(URL u), but URLStreamHandler (parent) calls InetAddress.getByName(name) with bundle number. 
> This call is very slow and method URLStreamHandler.getHostAddress is synchronized.
> We have found that Equinox's handler org.eclipse.osgi.framework.internal.core.BundleResourceHandler overrides hashCode(URL u).
> Thread dump that demonstrates problem is attached.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (FELIX-3262) Startup delay due to URLHandlersBundleStreamHandler

Posted by "Richard S. Hall (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-3262?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Richard S. Hall updated FELIX-3262:
-----------------------------------

    Fix Version/s:     (was: framework-4.2.0)
                   framework-4.0.3
    
> Startup delay due to URLHandlersBundleStreamHandler 
> ----------------------------------------------------
>
>                 Key: FELIX-3262
>                 URL: https://issues.apache.org/jira/browse/FELIX-3262
>             Project: Felix
>          Issue Type: Improvement
>          Components: Framework
>    Affects Versions: framework-3.0.9
>         Environment: Karaf 2.2.3 with spring-dm, spring
>            Reporter: Sergey Epik
>            Assignee: Karl Pauls
>             Fix For: framework-4.0.3
>
>         Attachments: getHosts-osgiextender.txt
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> Problem: slow startup of bundles that use spring and spring-dm.
> When spring-dm starts spring application context, it puts a lot of objects that contain URL into set/map structures.
> URL.hashCode delegates call to handler. 
> URLHandlersBundleStreamHandler does not implement hashCode(URL u), but URLStreamHandler (parent) calls InetAddress.getByName(name) with bundle number. 
> This call is very slow and method URLStreamHandler.getHostAddress is synchronized.
> We have found that Equinox's handler org.eclipse.osgi.framework.internal.core.BundleResourceHandler overrides hashCode(URL u).
> Thread dump that demonstrates problem is attached.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (FELIX-3262) Startup delay due to URLHandlersBundleStreamHandler

Posted by "Sergey Epik (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-3262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13164708#comment-13164708 ] 

Sergey Epik edited comment on FELIX-3262 at 12/7/11 9:22 PM:
-------------------------------------------------------------

Thread dump that demonstrates problem - a lot of threads are blocked on URLStreamHandler.getHostAddress.
                
      was (Author: sepik):
    Thread dump that demonstrates problem.
                  
> Startup delay due to URLHandlersBundleStreamHandler 
> ----------------------------------------------------
>
>                 Key: FELIX-3262
>                 URL: https://issues.apache.org/jira/browse/FELIX-3262
>             Project: Felix
>          Issue Type: Improvement
>          Components: Framework
>    Affects Versions: framework-3.0.9
>         Environment: Karaf 2.2.3 with spring-dm, spring
>            Reporter: Sergey Epik
>            Assignee: Karl Pauls
>         Attachments: getHosts-osgiextender.txt
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> Problem: slow startup of bundles that use spring and spring-dm.
> When spring-dm starts spring application context, it puts a lot of objects that contain URL into set/map structures.
> URL.hashCode delegates call to handler. 
> URLHandlersBundleStreamHandler does not implement hashCode(URL u), but URLStreamHandler (parent) calls InetAddress.getByName(name) with bundle number. 
> This call is very slow and method URLStreamHandler.getHostAddress is synchronized.
> We have found that Equinox's handler org.eclipse.osgi.framework.internal.core.BundleResourceHandler overrides hashCode(URL u).
> Thread dump that demonstrates problem is attached.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (FELIX-3262) Startup delay due to URLHandlersBundleStreamHandler

Posted by "Karl Pauls (Assigned) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-3262?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Karl Pauls reassigned FELIX-3262:
---------------------------------

    Assignee: Karl Pauls
    
> Startup delay due to URLHandlersBundleStreamHandler 
> ----------------------------------------------------
>
>                 Key: FELIX-3262
>                 URL: https://issues.apache.org/jira/browse/FELIX-3262
>             Project: Felix
>          Issue Type: Improvement
>          Components: Framework
>    Affects Versions: framework-3.0.9
>         Environment: Karaf 2.2.3 with spring-dm, spring
>            Reporter: Sergey Epik
>            Assignee: Karl Pauls
>         Attachments: getHosts-osgiextender.txt
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> Problem: slow startup of bundles that use spring and spring-dm.
> When spring-dm starts spring application context, it puts a lot of objects that contain URL into set/map structures.
> URL.hashCode delegates call to handler. 
> URLHandlersBundleStreamHandler does not implement hashCode(URL u), but URLStreamHandler (parent) calls InetAddress.getByName(name) with bundle number. 
> This call is very slow and method URLStreamHandler.getHostAddress is synchronized.
> We have found that Equinox's handler org.eclipse.osgi.framework.internal.core.BundleResourceHandler overrides hashCode(URL u).
> Thread dump that demonstrates problem is attached.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (FELIX-3262) Startup delay due to URLHandlersBundleStreamHandler

Posted by "Karl Pauls (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-3262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13267782#comment-13267782 ] 

Karl Pauls commented on FELIX-3262:
-----------------------------------

I think what we need to do is to override getHostAddress and return null there. The bundle url doesn't really have one. 

I'll commited a fix for this, can your verify and close this issue if it works for you?
                
> Startup delay due to URLHandlersBundleStreamHandler 
> ----------------------------------------------------
>
>                 Key: FELIX-3262
>                 URL: https://issues.apache.org/jira/browse/FELIX-3262
>             Project: Felix
>          Issue Type: Improvement
>          Components: Framework
>    Affects Versions: framework-3.0.9
>         Environment: Karaf 2.2.3 with spring-dm, spring
>            Reporter: Sergey Epik
>            Assignee: Karl Pauls
>             Fix For: framework-4.2.0
>
>         Attachments: getHosts-osgiextender.txt
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> Problem: slow startup of bundles that use spring and spring-dm.
> When spring-dm starts spring application context, it puts a lot of objects that contain URL into set/map structures.
> URL.hashCode delegates call to handler. 
> URLHandlersBundleStreamHandler does not implement hashCode(URL u), but URLStreamHandler (parent) calls InetAddress.getByName(name) with bundle number. 
> This call is very slow and method URLStreamHandler.getHostAddress is synchronized.
> We have found that Equinox's handler org.eclipse.osgi.framework.internal.core.BundleResourceHandler overrides hashCode(URL u).
> Thread dump that demonstrates problem is attached.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (FELIX-3262) Startup delay due to URLHandlersBundleStreamHandler

Posted by "Karl Pauls (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-3262?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Karl Pauls resolved FELIX-3262.
-------------------------------

    Resolution: Fixed
    
> Startup delay due to URLHandlersBundleStreamHandler 
> ----------------------------------------------------
>
>                 Key: FELIX-3262
>                 URL: https://issues.apache.org/jira/browse/FELIX-3262
>             Project: Felix
>          Issue Type: Improvement
>          Components: Framework
>    Affects Versions: framework-3.0.9
>         Environment: Karaf 2.2.3 with spring-dm, spring
>            Reporter: Sergey Epik
>            Assignee: Karl Pauls
>             Fix For: framework-4.2.0
>
>         Attachments: getHosts-osgiextender.txt
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> Problem: slow startup of bundles that use spring and spring-dm.
> When spring-dm starts spring application context, it puts a lot of objects that contain URL into set/map structures.
> URL.hashCode delegates call to handler. 
> URLHandlersBundleStreamHandler does not implement hashCode(URL u), but URLStreamHandler (parent) calls InetAddress.getByName(name) with bundle number. 
> This call is very slow and method URLStreamHandler.getHostAddress is synchronized.
> We have found that Equinox's handler org.eclipse.osgi.framework.internal.core.BundleResourceHandler overrides hashCode(URL u).
> Thread dump that demonstrates problem is attached.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (FELIX-3262) Startup delay due to URLHandlersBundleStreamHandler

Posted by "Karl Pauls (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-3262?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13164711#comment-13164711 ] 

Karl Pauls commented on FELIX-3262:
-----------------------------------

Good catch. I'll try to get it asap. Thanks.
                
> Startup delay due to URLHandlersBundleStreamHandler 
> ----------------------------------------------------
>
>                 Key: FELIX-3262
>                 URL: https://issues.apache.org/jira/browse/FELIX-3262
>             Project: Felix
>          Issue Type: Improvement
>          Components: Framework
>    Affects Versions: framework-3.0.9
>         Environment: Karaf 2.2.3 with spring-dm, spring
>            Reporter: Sergey Epik
>            Assignee: Karl Pauls
>         Attachments: getHosts-osgiextender.txt
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> Problem: slow startup of bundles that use spring and spring-dm.
> When spring-dm starts spring application context, it puts a lot of objects that contain URL into set/map structures.
> URL.hashCode delegates call to handler. 
> URLHandlersBundleStreamHandler does not implement hashCode(URL u), but URLStreamHandler (parent) calls InetAddress.getByName(name) with bundle number. 
> This call is very slow and method URLStreamHandler.getHostAddress is synchronized.
> We have found that Equinox's handler org.eclipse.osgi.framework.internal.core.BundleResourceHandler overrides hashCode(URL u).
> Thread dump that demonstrates problem is attached.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira