[ 
https://issues.apache.org/jira/browse/AMQ-5268?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14058567#comment-14058567
 ] 

Michal Kubricht commented on AMQ-5268:
--------------------------------------

That was fast. I was preparing to create you a patch when I found that you've 
already fixed it. Thanks for it.

Anyway I have some notes that might be considered:
- exactly same problem is for class 
{{org.apache.activemq.pool.XaPooledConnectionFactory}} (it uses 
IntrospectionSupport as well in method populateProperties)
- my example might confuse you about property names - originally Gary Tully use 
"pool" prefix for the properties 
({{org.apache.activemq.pool.PooledConnectionFactory.POOL_PROPS_PREFIX}}), the 
prefix probably should remain,
- more on prefix: I would like "pool." (with dot at the end) more as it is used 
elsewhere (for example when parsing destination policies -> 
{{org.apache.activemq.ActiveMQConnectionFactory.populateProperties(Properties)}})

> PooledConnectionFactory gets in endless loop when storing into JNDI
> -------------------------------------------------------------------
>
>                 Key: AMQ-5268
>                 URL: https://issues.apache.org/jira/browse/AMQ-5268
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: activemq-pool
>    Affects Versions: 5.9.0, 5.9.1, 5.10.0
>         Environment: JDK-1.6.0_38, tomcat-naming (JNDI)
>            Reporter: Michal Kubricht
>            Assignee: Timothy Bish
>              Labels: jndi, pool
>             Fix For: 5.11.0
>
>         Attachments: AmqJndiReference.java
>
>
> We got into troubles when upgrading from 5.7.0 to new version 5.10.0. One of 
> our tests which uses binding of *PooledConnectionFactory* into JNDI 
> (tomcat-naming) got *stuck* and computes *in endless loop*.
> Problem is implementation of interface 
> {{org.apache.activemq.jndi.JNDIStorableInterface}} in class 
> {{org.apache.activemq.pool.PooledConnectionFactory}}:
> - method {{populateProperties(Properties props)}} implementation uses 
> {{IntrospectionSupport.getProperties(...)}} in order to set properties for 
> all getters,
> - setting properties works for basic types, but causes stack overflow for 
> getters - {{getReference()}} and {{getProperties()}} which creates recursion 
> loops
> - loop #1: PooledConnectionFactory.getProperties -> 
> PooledConnectionFactory.populateProperties -> 
> IntrospectionSupport.getProperties -> PooledConnectionFactory.getProperties
> - loop #2: PooledConnectionFactory.getProperties -> 
> PooledConnectionFactory.populateProperties -> 
> IntrospectionSupport.getProperties -> PooledConnectionFactory.getReference -> 
> JNDIReferenceFactory.createReference -> PooledConnectionFactory.getProperties
> - additional info: recursion loop doesn't end with StackOverflowError, but 
> InvocationTargetException is propagated to IntrospectionSupport.getProperties 
> method where it is being ignored and causes "almost endless" computation 
> (exponential complexity)
> Example test without using JNDI, but using key methods showing the problem 
> and its possible solution/workaround for AMQ 5.10.0 is attached.
> We found that error exists for AMQ 5.9.0 and newer after resolving following 
> issue AMQ-4757.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to