activemq-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Anderson (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (AMQ-6120) Error using Spring Expression Language for recoverDuration attribute on amq:timedSubscriptionRecoveryPolicy
Date Mon, 11 Jan 2016 12:25:39 GMT

     [ https://issues.apache.org/jira/browse/AMQ-6120?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Mark Anderson updated AMQ-6120:
-------------------------------
    Description: 
I'm attmepting to use SPEL to configure the recoverDuration attribute of timerSubscriptionRecovery
policy as follows (based on SPEL suggestion at http://stackoverflow.com/questions/18265518/using-spring-expression-language-to-define-xml-attribute):
{code:xml}
<amq:policyEntry topic="mytopic">
  <amq:subscriptionRecoveryPolicy>
     <amq:timedSubscriptionRecoveryPolicy recoverDuration="#{ T(java.lang.Integer).valueOf('${my.property}')
* 1000 }" />
   </amq:subscriptionRecoveryPolicy>
 </amq:policyEntry>
{code}
However, this results in the following error on startup:
{noformat}
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 1125 in XML document
from class path resource [appserver/spring.xml] is invalid; nested exception is org.xml.sax.SAXParseException;
lineNumber: 1125; columnNumber: 119; cvc-datatype-valid.1.2.1: '#{ T(java.lang.Integer).valueOf('1')
* 1000 }' is not a valid value for 'integer'.
     [java] 	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:399)
     [java] 	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)
     [java] 	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304)
     [java] 	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:181)
     [java] 	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:217)
     [java] 	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:188)
     [java] 	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:252)
     [java] 	at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:127)
     [java] 	at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:93)
     [java] 	at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129)
     [java] 	at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:538)
     [java] 	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:452)
{noformat}
I'm using Spring 4.1.8.

Is SPEL supported for this attribute?

  was:
I'm attmepting to use SPEL to configure the recoverDuration attribute of timerSubscriptionRecovery
policy as follows (based on SPEL suggestion at http://stackoverflow.com/questions/18265518/using-spring-expression-language-to-define-xml-attribute):
{code:xml}
<amq:policyEntry topic="mytopic">
  <amq:subscriptionRecoveryPolicy>
     <amq:timedSubscriptionRecoveryPolicy recoverDuration="#{ T(java.lang.Integer).valueOf('${my.property}')
* 1000 }" />
      </amq:subscriptionRecoveryPolicy>
 </amq:policyEntry>
{code}
However, this results in the following error on startup:
{noformat}
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 1125 in XML document
from class path resource [appserver/spring.xml] is invalid; nested exception is org.xml.sax.SAXParseException;
lineNumber: 1125; columnNumber: 119; cvc-datatype-valid.1.2.1: '#{ T(java.lang.Integer).valueOf('1')
* 1000 }' is not a valid value for 'integer'.
     [java] 	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:399)
     [java] 	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)
     [java] 	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304)
     [java] 	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:181)
     [java] 	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:217)
     [java] 	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:188)
     [java] 	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:252)
     [java] 	at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:127)
     [java] 	at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:93)
     [java] 	at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129)
     [java] 	at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:538)
     [java] 	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:452)
{noformat}
I'm using Spring 4.1.8.

Is SPEL supported for this attribute?


> Error using Spring Expression Language for recoverDuration attribute on amq:timedSubscriptionRecoveryPolicy
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: AMQ-6120
>                 URL: https://issues.apache.org/jira/browse/AMQ-6120
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 5.13.0
>            Reporter: Mark Anderson
>
> I'm attmepting to use SPEL to configure the recoverDuration attribute of timerSubscriptionRecovery
policy as follows (based on SPEL suggestion at http://stackoverflow.com/questions/18265518/using-spring-expression-language-to-define-xml-attribute):
> {code:xml}
> <amq:policyEntry topic="mytopic">
>   <amq:subscriptionRecoveryPolicy>
>      <amq:timedSubscriptionRecoveryPolicy recoverDuration="#{ T(java.lang.Integer).valueOf('${my.property}')
* 1000 }" />
>    </amq:subscriptionRecoveryPolicy>
>  </amq:policyEntry>
> {code}
> However, this results in the following error on startup:
> {noformat}
> org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 1125 in XML
document from class path resource [appserver/spring.xml] is invalid; nested exception is org.xml.sax.SAXParseException;
lineNumber: 1125; columnNumber: 119; cvc-datatype-valid.1.2.1: '#{ T(java.lang.Integer).valueOf('1')
* 1000 }' is not a valid value for 'integer'.
>      [java] 	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:399)
>      [java] 	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)
>      [java] 	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304)
>      [java] 	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:181)
>      [java] 	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:217)
>      [java] 	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:188)
>      [java] 	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:252)
>      [java] 	at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:127)
>      [java] 	at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:93)
>      [java] 	at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129)
>      [java] 	at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:538)
>      [java] 	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:452)
> {noformat}
> I'm using Spring 4.1.8.
> Is SPEL supported for this attribute?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message