почему следующий пакет находится в льготном периоде?

У меня есть два пакета с файлом чертежа, содержащим материал camel-activemq. как

<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
	..
    <cm:property-placeholder id="jms.placeholder" persistent-id="com.mycompany.context">
        <cm:default-properties>
            <cm:property name="activemq.url" value="${activemq.url}" />
            <cm:property name="activemq.user" value="${activemq.user}" />
            <cm:property name="activemq.password" value="${activemq.password}" />
        </cm:default-properties>
    </cm:property-placeholder>
	
	..
    <camelContext xmlns="http://camel.apache.org/schema/blueprint"
                  id="quartzCamelPublisher"
                  autoStartup="true">
        
        <route id="failedMessagePublisher">
            <from uri="vm:failedEventQueue" />
            <to pattern="InOnly" uri="activemq:queue:not-success"/>
        </route>
    </camelContext>
    
    
    <reference id="txMgr" interface="javax.transaction.TransactionManager" />

    <bean id="xaConnectionFactory" class="org.apache.activemq.ActiveMQXAConnectionFactory">
        <property name="brokerURL" value="${activemq.url}" />
        <property name="userName" value="${activemq.user}" />
        <property name="password" value="${activemq.password}" />
        <property name="watchTopicAdvisories" value="false" />
    </bean>

    <bean id="jcaConnectionFactory" class="org.apache.activemq.jms.pool.JcaPooledConnectionFactory"
          init-method="start" destroy-method="stop">
        <property name="transactionManager" ref="txMgr"/>
        <property name="maxConnections" value="10" />
        <property name="name" value="amq" />
        <property name="connectionFactory" ref="xaConnectionFactory"/>
    </bean>

    <bean id="jmsTxConf" class="org.apache.activemq.camel.component.ActiveMQConfiguration">
        <property name="connectionFactory" ref="jcaConnectionFactory" />
        <property name="requestTimeout" value="10000" />
        <property name="transactionTimeout" value="30" />
        <property name="transacted" value="true" />
        <property name="cacheLevelName" value="CACHE_NONE" />
    </bean>

    <bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent" >
        <property name="configuration" ref="jmsTxConf" />
    </bean>
</blueprint>

Если я использую постоянные значения во втором файле чертежа пакета, все работает нормально. Как только я использую там конфигурацию, такую ​​​​как $ {activemq.url}, похоже, что она не может ее найти и пытается получить ее бесконечное количество раз. и второй пучок не может там разрешить.

   018-05-22 13:00:13,133 | DEBUG | rint Extender: 2 | PropertyPlaceholder              | 35 - org.apache.aries.blueprint.core - 1.8.2 | Retrieving property activemq.url
2018-05-22 13:00:13,133 | DEBUG | rint Extender: 2 | PropertyPlaceholder              | 35 - org.apache.aries.blueprint.core - 1.8.2 | Retrieved property activemq.url value from defaults ${activemq.url}
2018-05-22 13:00:13,133 | DEBUG | rint Extender: 2 | PropertyPlaceholder              | 35 - org.apache.aries.blueprint.core - 1.8.2 | Retrieving Value from expression: activemq.url
2018-05-22 13:00:13,133 | DEBUG | rint Extender: 2 | CmPropertyPlaceholder            | 34 - org.apache.aries.blueprint.cm - 1.1.0 | Retrieving property value activemq.url from configuration with pid com.mycompany.context
2018-05-22 13:00:13,138 | DEBUG | rint Extender: 2 | PropertyPlaceholder              | 35 - org.apache.aries.blueprint.core - 1.8.2 | Retrieving property activemq.url
2018-05-22 13:00:13,139 | DEBUG | rint Extender: 2 | PropertyPlaceholder              | 35 - org.apache.aries.blueprint.core - 1.8.2 | Retrieved property activemq.url value from defaults ${activemq.url}
2018-05-22 13:00:13,139 | DEBUG | rint Extender: 2 | PropertyPlaceholder              | 35 - org.apache.aries.blueprint.core - 1.8.2 | Retrieving Value from expression: activemq.url
2018-05-22 13:00:13,140 | DEBUG | rint Extender: 2 | CmPropertyPlaceholder            | 34 - org.apache.aries.blueprint.cm - 1.1.0 | Retrieving property value activemq.url from configuration with pid com.mycompany.context
2018-05-22 13:00:13,140 | DEBUG | rint Extender: 2 | PropertyPlaceholder              | 35 - org.apache.aries.blueprint.core - 1.8.2 | Retrieving property activemq.url
2018-05-22 13:00:13,141 | DEBUG | rint Extender: 2 | PropertyPlaceholder              | 35 - org.apache.aries.blueprint.core - 1.8.2 | Retrieved property activemq.url value from defaults ${activemq.url}
2018-05-22 13:00:13,141 | DEBUG | rint Extender: 2 | PropertyPlaceholder              | 35 - org.apache.aries.blueprint.core - 1.8.2 | Retrieving Value from expression: activemq.url
2018-05-22 13:00:13,141 | DEBUG | rint Extender: 2 | CmPropertyPlaceholder            | 34 - org.apache.aries.blueprint.cm - 1.1.0 | Retrieving property value activemq.url from configuration with pid com.mycompany.context
2018-05-22 13:00:13,143 | DEBUG | rint Extender: 2 | PropertyPlaceholder              | 35 - org.apache.aries.blueprint.core - 1.8.2 | Retrieving property activemq.url
2018-05-22 13:00:13,143 | DEBUG | rint Extender: 2 | PropertyPlaceholder              | 35 - org.apache.aries.blueprint.core - 1.8.2 | Retrieved property activemq.url value from defaults ${activemq.url}
2018-05-22 13:00:13,144 | DEBUG | rint Extender: 2 | PropertyPlaceholder              | 35 - org.apache.aries.blueprint.core - 1.8.2 | Retrieving Value from expression: activemq.url
2018-05-22 13:00:13,144 | DEBUG | rint Extender: 2 | CmPropertyPlaceholder            | 34 - org.apache.aries.blueprint.cm - 1.1.0 | Retrieving property value activemq.url from
 


..

..
..

Если я использую второй файл конфигурации, который является просто дубликатом файла конфигурации, например com.mycompany.context_1, то первый пакет не может быть разрешен со следующим сообщением о транзакции. По какой причине следующий пакет находится в благодатном периоде?

karaf@root()> bundle:diag 128
ReturnContext :: My Bundle (128)
----------------------------------------------
Status: GracePeriod
Blueprint
22/5/18 12:53 PM
Missing dependencies:
(&(objectClass=org.apache.aries.blueprint.NamespaceHandler)(osgi.service.blueprint.namespace=http://aries.apache.org/xmlns/transactions/v2.0.0))
Declarative Services


karaf@root()> feature:list | grep transaction
transaction-api                         | 1.2.0            |          | Started     | enterprise-4.1.2                      |
transaction-manager-geronimo            | 1.3.3            |          | Started     | enterprise-4.1.2                      | Geronimo Transaction Manager
transaction-manager-narayana            | 5.5.2.Final      |          | Uninstalled | enterprise-4.1.2                      | Narayana Transaction Manager
transaction                             | 2.0.0            |          | Started     | enterprise-4.1.2                      | OSGi Transaction Manager
karaf@root()>


person anna    schedule 22.05.2018    source источник
comment
<cm:default-properties><cm:property name="activemq.url" value="${activemq.url}" /> предполагается, что это константа, а не сам заполнитель   -  person Alessandro Da Rugna    schedule 22.05.2018
comment
Как сказал @AlessandroDaRugna, свойства по умолчанию должны содержать статическое значение. Теперь вы говорите ему прочитать ваш файл конфигурации, чтобы установить значения по умолчанию, что не имеет никакого смысла. Если вам действительно не нужно значение по умолчанию, вы должны просто полностью удалить этот блок.   -  person Erik Karlstrand    schedule 24.05.2018


Ответы (1)


Удаление всех записей по умолчанию из файла чертежа устранило проблему. И использование свойства из файла cofig также работает.

<?xml version="1.0" encoding="UTF-8"?>
<blueprint ...
    <cm:property-placeholder id="jms.placeholder" persistent-id="com.mycompany.context">
        <cm:default-properties>
        </cm:default-properties>
    </cm:property-placeholder>

	....
    <bean id="xaConnectionFactory" class="org.apache.activemq.ActiveMQXAConnectionFactory">
        <property name="brokerURL" value="${activemq.url}" />
        <property name="userName" value="${activemq.user}" />
        <property name="password" value="${activemq.password}" />
        <property name="watchTopicAdvisories" value="false" />
    </bean>

	...
</blueprint>

person anna    schedule 25.05.2018