почему следующий пакет находится в graceperiod? - PullRequest
0 голосов
/ 22 мая 2018

У меня есть две связки с файлом чертежа, имеющим материал 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, то первый пакет не может быть обработан с помощью следующего сообщения о транзакции.По какой причине следующий пакет находится в graceperiond?

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()>

1 Ответ

0 голосов
/ 25 мая 2018

Удаление всех записей по умолчанию из файла чертежа устранило проблему.И использование свойства из файла 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>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...