Five Stars

KAR - features cause other services to restart

Hello,

 

We have migrated from Talend v5 to Talend v6.3.1. Rebuilding old services into new version were ok, but deployment causes us troubles. Most of these services are Routes (.kar files). And after deploying some of them, some of these Kars causes another jobs (KAR, JAR, even blueprint JAR) to restart.

 

Reason for this is simple - KAR files contain feature XML file with list of features that are installed during deployment. Whenever two or more jobs share same feature, these jobs are restarted. In more than half cases, this restart causes ALL services in runtime to be restarted (JAR, KAR) and they won't load up again.

 

Solution is to go to feature file and delete all features that could cause troubles. As you can imagine, it is tedious and dull work and potentionally leads to human error.

 

My question is - is it possible to force Talend to not to add these features into feature file?

 

Example:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.0.0" name="TestService-feature">
<feature name="TestService-feature" version="0.1">
<feature>activemq</feature>
<feature>activemq-camel</feature>
<feature>camel-spring</feature>
<feature>camel-core</feature>
<feature>camel-jms</feature>
<feature>camel-talendjob</feature>
<bundle>mvn:testservice.TestService/TestService-bundle/0.1</bundle>
<bundle>mvnSmiley Surprisedrg.talend.testservice.sendmessagetosubjob/sendMessageToSubjob-bundle/0.1</bundle>
<config name="TestService.talendcontext.Default">
</config>
</feature>
</features>

 

 

  • ESB
Tags (3)
2 REPLIES
Ten Stars

Re: KAR - features cause other services to restart

Have you not upgraded your Karaf (Runtime) as well? If you are using Talend Runtime for v5 and are upgrading to v6, it would be advisable to upgrade your runtime as well. I'm assuming you are using the Open Source edition and not the Enterprise edition. 

I suspect the restarts are due to version changes (different Jar versions) between v5 and v6 of Talend. I may be wrong, but I have never seen this behavior except when Talend TAC orphans a route and you delete it without undeploying it. What happens here is that the feature is left on the runtime and when you add a new version of that feature, Talend starts all versions of it. But this is not the same issue (one to be aware of though).

Rilhia Solutions
Five Stars

Re: KAR - features cause other services to restart

Yes, we are using Talend Open Studio v6.3.1 + Runtime v6.3.1. (downloaded in one package)

 

In logs below, you will see that with all features present in XML, bundles are being uninstalled. This caused all jobs in runtime uninstall. When features are deleted, no bundles are uninstalled during deployment.

 

Let's have route with such feature file:

 

<?xml version="1.0" encoding="UTF-8" standalone="no"?>

<features xmlns="http://karaf.apache.org/xmlns/features/v1.0.0" name="TestNotificationPostprocessService-feature">

<feature name="TestNotificationPostprocessService-feature" version="0.4">

<feature>activemq</feature>

<feature>activemq-camel</feature>

<feature>camel-spring</feature>

<feature>camel-core</feature>

<feature>camel-jms</feature>

<feature>camel-talendjob</feature>

<feature>camel-quartz2</feature>

<bundle>mvnSmiley Surprisedrg.talend.payments.main_testnotificationprocessor/Main_TestNotificationProcessor-bundle/0.2</bundle>

<bundle>mvnSmiley Surprisedrg.talend.payments.testrejecttransaction/TestRejectTransaction-bundle/0.3</bundle>

<bundle>mvnSmiley Tongueayments.TestNotificationPostprocessService/TestNotificationPostprocessService-bundle/0.4</bundle>

<config name="TestNotificationPostprocessService.talendcontext.studio">

…..

</feature>

</features>

 

Deploying the service with all mentioned features:

 

14:50:08,322 | INFO  | pool-4-thread-1  | rnal.service.FeaturesServiceImpl 1213 | 8 - org.apache.karaf.features.core - 4.0.7 | Changes to perform:
14:50:08,322 | INFO  | pool-4-thread-1  | rnal.service.FeaturesServiceImpl 1213 | 8 - org.apache.karaf.features.core - 4.0.7 |   Region: root
14:50:08,322 | INFO  | pool-4-thread-1  | rnal.service.FeaturesServiceImpl 1213 | 8 - org.apache.karaf.features.core - 4.0.7 |     Bundles to uninstall:
14:50:08,322 | INFO  | pool-4-thread-1  | rnal.service.FeaturesServiceImpl 1213 | 8 - org.apache.karaf.features.core - 4.0.7 |       joda-time/2.7.0
14:50:08,322 | INFO  | pool-4-thread-1  | rnal.service.FeaturesServiceImpl 1213 | 8 - org.apache.karaf.features.core - 4.0.7 |       org.apache.geronimo.specs.geronimo-jta_1.1_spec/1.1.1
14:50:08,322 | INFO  | pool-4-thread-1  | rnal.service.FeaturesServiceImpl 1213 | 8 - org.apache.karaf.features.core - 4.0.7 |     Bundles to install:
14:50:08,322 | INFO  | pool-4-thread-1  | rnal.service.FeaturesServiceImpl 1213 | 8 - org.apache.karaf.features.core - 4.0.7 |       mvnSmiley Surprisedrg.apache.activemq/activemq-karaf/5.14.1
14:50:08,322 | INFO  | pool-4-thread-1  | rnal.service.FeaturesServiceImpl 1213 | 8 - org.apache.karaf.features.core - 4.0.7 |       mvn:joda-time/joda-time/2.9
14:50:08,323 | INFO  | pool-4-thread-1  | rnal.service.FeaturesServiceImpl 1213 | 8 - org.apache.karaf.features.core - 4.0.7 |       mvnSmiley Surprisedrg.apache.activemq/activeio-core/3.1.4
14:50:08,323 | INFO  | pool-4-thread-1  | rnal.service.FeaturesServiceImpl 1213 | 8 - org.apache.karaf.features.core - 4.0.7 |       mvnSmiley Surprisedrg.apache.aries.transaction/org.apache.aries.transa
ction.manager/1.1.1
14:50:08,323 | INFO  | pool-4-thread-1  | rnal.service.FeaturesServiceImpl 1213 | 8 - org.apache.karaf.features.core - 4.0.7 |       mvnSmiley Surprisedrg.apache.geronimo.specs/geronimo-j2ee-connector_1.
5_spec/2.0.0
14:50:08,323 | INFO  | pool-4-thread-1  | rnal.service.FeaturesServiceImpl 1213 | 8 - org.apache.karaf.features.core - 4.0.7 |       mvnSmiley Surprisedrg.apache.servicemix.bundles/org.apache.servicemix.
bundles.velocity/1.7_6
14:50:08,323 | INFO  | pool-4-thread-1  | rnal.service.FeaturesServiceImpl 1213 | 8 - org.apache.karaf.features.core - 4.0.7 |       mvnSmiley Surprisedrg.apache.servicemix.bundles/org.apache.servicemix.
bundles.xpp3/1.1.4c_5
14:50:08,323 | INFO  | pool-4-thread-1  | rnal.service.FeaturesServiceImpl 1213 | 8 - org.apache.karaf.features.core - 4.0.7 |       mvnSmiley Surprisedrg.apache.servicemix.bundles/org.apache.servicemix.
bundles.xstream/1.4.8_1
14:50:08,323 | INFO  | pool-4-thread-1  | rnal.service.FeaturesServiceImpl 1213 | 8 - org.apache.karaf.features.core - 4.0.7 |       mvnSmiley Surprisedrg.scala-lang/scala-library/2.11.0
14:50:08,323 | INFO  | pool-4-thread-1  | rnal.service.FeaturesServiceImpl 1213 | 8 - org.apache.karaf.features.core - 4.0.7 |       mvnSmiley Surprisedrg.talend.payments.main_testnotificationprocessor/M
ain_testNotificationProcessor-bundle/0.2
14:50:08,323 | INFO  | pool-4-thread-1  | rnal.service.FeaturesServiceImpl 1213 | 8 - org.apache.karaf.features.core - 4.0.7 |       mvnSmiley Tongueayments.testNotificationPostprocessService/testNoti
ficationPostprocessService-bundle/0.4
14:50:08,323 | INFO  | pool-4-thread-1  | rnal.service.FeaturesServiceImpl 1213 | 8 - org.apache.karaf.features.core - 4.0.7 |       mvnSmiley Surprisedrg.talend.payments.testrejecttransaction/testReject
Transaction-bundle/0.3
14:50:08,323 | INFO  | pool-4-thread-1  | rnal.service.FeaturesServiceImpl 1213 | 8 - org.apache.karaf.features.core - 4.0.7 | Stopping bundles:
14:50:08,323 | INFO  | pool-4-thread-1  | rnal.service.FeaturesServiceImpl 1213 | 8 - org.apache.karaf.features.core - 4.0.7 |   joda-time/2.7.0
14:50:08,324 | INFO  | pool-4-thread-1  | rnal.service.FeaturesServiceImpl 1213 | 8 - org.apache.karaf.features.core - 4.0.7 |   org.apache.geronimo.specs.geronimo-jta_1.1_spec/1.1.1
14:50:08,324 | INFO  | pool-4-thread-1  | rnal.service.FeaturesServiceImpl 1213 | 8 - org.apache.karaf.features.core - 4.0.7 | Uninstalling bundles:
14:50:08,324 | INFO  | pool-4-thread-1  | rnal.service.FeaturesServiceImpl 1213 | 8 - org.apache.karaf.features.core - 4.0.7 |   joda-time/2.7.0
14:50:08,325 | INFO  | pool-4-thread-1  | rnal.service.FeaturesServiceImpl 1213 | 8 - org.apache.karaf.features.core - 4.0.7 |   org.apache.geronimo.specs.geronimo-jta_1.1_spec/1.1.1
14:50:08,327 | INFO  | pool-4-thread-1  | rnal.service.FeaturesServiceImpl 1213 | 8 - org.apache.karaf.features.core - 4.0.7 | Installing bundles:
14:50:08,327 | INFO  | pool-4-thread-1  | rnal.service.FeaturesServiceImpl 1213 | 8 - org.apache.karaf.features.core - 4.0.7 |   mvnSmiley Surprisedrg.apache.activemq/activemq-karaf/5.14.1
14:50:08,328 | INFO  | pool-4-thread-1  | rnal.service.FeaturesServiceImpl 1213 | 8 - org.apache.karaf.features.core - 4.0.7 |   mvn:joda-time/joda-time/2.9
14:50:08,333 | INFO  | pool-4-thread-1  | rnal.service.FeaturesServiceImpl 1213 | 8 - org.apache.karaf.features.core - 4.0.7 |   mvnSmiley Surprisedrg.apache.activemq/activeio-core/3.1.4
14:50:08,334 | INFO  | pool-4-thread-1  | rnal.service.FeaturesServiceImpl 1213 | 8 - org.apache.karaf.features.core - 4.0.7 |   mvnSmiley Surprisedrg.apache.aries.transaction/org.apache.aries.transaction.manager/1.1.1
14:50:08,336 | INFO  | pool-4-thread-1  | rnal.service.FeaturesServiceImpl 1213 | 8 - org.apache.karaf.features.core - 4.0.7 |   mvnSmiley Surprisedrg.apache.geronimo.specs/geronimo-j2ee-connector_1.5_spec/2.0.0
14:50:08,337 | INFO  | pool-4-thread-1  | rnal.service.FeaturesServiceImpl 1213 | 8 - org.apache.karaf.features.core - 4.0.7 |   mvnSmiley Surprisedrg.apache.servicemix.bundles/org.apache.servicemix.bundles.velocity/1.7_6
14:50:08,340 | INFO  | pool-4-thread-1  | rnal.service.FeaturesServiceImpl 1213 | 8 - org.apache.karaf.features.core - 4.0.7 |   mvnSmiley Surprisedrg.apache.servicemix.bundles/org.apache.servicemix.bundles.xpp3/1.1.4c_5
14:50:08,341 | INFO  | pool-4-thread-1  | rnal.service.FeaturesServiceImpl 1213 | 8 - org.apache.karaf.features.core - 4.0.7 |   mvnSmiley Surprisedrg.apache.servicemix.bundles/org.apache.servicemix.bundles.xstream/1.4.8_1
14:50:08,344 | INFO  | pool-4-thread-1  | rnal.service.FeaturesServiceImpl 1213 | 8 - org.apache.karaf.features.core - 4.0.7 |   mvnSmiley Surprisedrg.scala-lang/scala-library/2.11.0
14:50:08,361 | INFO  | pool-4-thread-1  | rnal.service.FeaturesServiceImpl 1213 | 8 - org.apache.karaf.features.core - 4.0.7 |   mvnSmiley Surprisedrg.talend.payments.main_testnotificationprocessor/Main_testNotificationProcessor-bundle/0.2
14:50:08,366 | INFO  | pool-4-thread-1  | rnal.service.FeaturesServiceImpl 1213 | 8 - org.apache.karaf.features.core - 4.0.7 |   mvnSmiley Tongueayments.testNotificationPostprocessService/testNotificationPostprocessService-bundle/0.4
14:50:08,367 | INFO  | pool-4-thread-1  | rnal.service.FeaturesServiceImpl 1213 | 8 - org.apache.karaf.features.core - 4.0.7 |   mvnSmiley Surprisedrg.talend.payments.testrejecttransaction/testRejectTransaction-bundle/0.3
14:50:08,374 | INFO  | pool-4-thread-1  | rnal.service.FeaturesServiceImpl 1213 | 8 - org.apache.karaf.features.core - 4.0.7 | Stopping bundles:
14:50:08,374 | INFO  | pool-4-thread-1  | rnal.service.FeaturesServiceImpl 1213 | 8 - org.apache.karaf.features.core - 4.0.7 |   writeService.writeService/0.1.0
14:50:08,375 | INFO  | Timer-1          | ractOsgiBundleApplicationContext  359 | 166 - org.apache.servicemix.bundles.spring-context - 3.2.17.RELEASE_1 | Unpublishing application context OSGi service for bundle writeService (writeService.writeService)
14:50:08,375 | INFO  | Timer-1          | pport.AbstractApplicationContext 1048 | 166 - org.apache.servicemix.bundles.spring-context - 3.2.17.RELEASE_1 | Closing OsgiBundleXmlApplicationContext(bundle=writeService.writeService, config=osgibundle:/META-INF/spring/*.xml): startup date [Fri Apr 28 14:40:12 CEST 2017]; root of context hierarchy
14:50:08,375 | INFO  | Timer-1          | e.camel.impl.DefaultCamelContext 3066 | 76 - org.apache.camel.camel-core - 2.17.3 | Apache Camel 2.17.3 (CamelContext: writeService.writeService_0_1.writeService) is shutting down
14:50:08,376 | INFO  | Timer-1          | mel.impl.DefaultShutdownStrategy  196 | 76 - org.apache.camel.camel-core - 2.17.3 | Starting to graceful shutdown 4 routes (timeout 300 seconds)
14:50:08,376 | INFO  | 1 - ShutdownTask | ultShutdownStrategy$ShutdownTask  576 | 76 - org.apache.camel.camel-core - 2.17.3 | Route: writeService_cTimer_1 shutdown complete, was consuming from: Endpoint[timer://cTimer_1?delay=1000&period=60000]
14:50:08,850 | INFO  | 1 - ShutdownTask | ultShutdownStrategy$ShutdownTask  669 | 76 - org.apache.camel.camel-core - 2.17.3 | Route: writeService_cJMS_4 shutdown complete, was consuming from: Endpoint[cMQConnectionFactory1://queue:sazka.retry.ODSPlayerDataUpdateOnlineFeed?selector=NextRetryTime+is+null]
14:50:08,852 | INFO  | 1 - ShutdownTask | ultShutdownStrategy$ShutdownTask  669 | 76 - org.apache.camel.camel-core - 2.17.3 | Route: writeService_cJMS_2 shutdown complete, was consuming from: Endpoint[cMQConnectionFactory1://queue:sazka.retry.ODSPlayerDataUpdateOnlineFeed?selector=RetryCount+%3E%3D+5]
14:50:08,876 | WARN  | tp2145643411-223 | rg.eclipse.jetty.http.HttpParser 1317 | 201 - org.eclipse.jetty.util - 9.2.19.v20160908 | badMessage: 400 Bad Host header for HttpChannelOverHttp@3ce3c9d0{r=0,c=false,a=IDLE,uri=/HelloWorldService?wsdl}
14:50:09,218 | INFO  | 1 - ShutdownTask | ultShutdownStrategy$ShutdownTask  669 | 76 - org.apache.camel.camel-core - 2.17.3 | Route: writeService_cJMS_1 shutdown complete, was consuming from: Endpoint[cMQConnectionFactory1://queue:Consumer.ODS.VirtualTopic.playerdataupdated]
14:50:09,219 | INFO  | Timer-1          | mel.impl.DefaultShutdownStrategy  260 | 76 - org.apache.camel.camel-core - 2.17.3 | Graceful shutdown of 4 routes completed in 0 seconds
14:50:09,225 | INFO  | Timer-1          | e.camel.impl.DefaultCamelContext 3151 | 76 - org.apache.camel.camel-core - 2.17.3 | Apache Camel 2.17.3 (CamelContext: writeService.writeService_0_1.writeService) uptime 9 minutes
14:50:09,225 | INFO  | Timer-1          | e.camel.impl.DefaultCamelContext 3152 | 76 - org.apache.camel.camel-core - 2.17.3 | Apache Camel 2.17.3 (CamelContext: writeService.writeService_0_1.writeService) is shutdown in 0.850 seconds

 

In case when red-colored features are deleted

 

14:48:55,777 | INFO  | pool-4-thread-1  | rnal.service.FeaturesServiceImpl 1213 | 8 - org.apache.karaf.features.core - 4.0.7 | Changes to perform:

14:48:55,777 | INFO  | pool-4-thread-1  | rnal.service.FeaturesServiceImpl 1213 | 8 - org.apache.karaf.features.core - 4.0.7 |   Region: root

14:48:55,777 | INFO  | pool-4-thread-1  | rnal.service.FeaturesServiceImpl 1213 | 8 - org.apache.karaf.features.core - 4.0.7 |     Bundles to install:

14:48:55,777 | INFO  | pool-4-thread-1  | rnal.service.FeaturesServiceImpl 1213 | 8 - org.apache.karaf.features.core - 4.0.7 |       mvnSmiley Surprisedrg.talend.payments.main_payunotificationprocessor/Main_TestNotificationProcessor-bundle/0.2

14:48:55,778 | INFO  | pool-4-thread-1  | rnal.service.FeaturesServiceImpl 1213 | 8 - org.apache.karaf.features.core - 4.0.7 |       mvnSmiley Tongueayments.TestNotificationPostprocessService/TestNotificationPostprocessService-bundle/0.4

14:48:55,778 | INFO  | pool-4-thread-1  | rnal.service.FeaturesServiceImpl 1213 | 8 - org.apache.karaf.features.core - 4.0.7 |       mvnSmiley Surprisedrg.talend.payments.testrejecttransaction/TestRejectTransaction-bundle/0.3

14:48:55,778 | INFO  | pool-4-thread-1  | rnal.service.FeaturesServiceImpl 1213 | 8 - org.apache.karaf.features.core - 4.0.7 | Installing bundles:

14:48:55,779 | INFO  | pool-4-thread-1  | rnal.service.FeaturesServiceImpl 1213 | 8 - org.apache.karaf.features.core - 4.0.7 |   mvnSmiley Surprisedrg.talend.payments.main_testnotificationprocessor/Main_TestNotificationProcessor-bundle/0.2

14:48:55,784 | INFO  | pool-4-thread-1  | rnal.service.FeaturesServiceImpl 1213 | 8 - org.apache.karaf.features.core - 4.0.7 |   mvnSmiley Tongueayments.TestNotificationPostprocessService/TestNotificationPostprocessService-bundle/0.4

14:48:55,786 | INFO  | pool-4-thread-1  | rnal.service.FeaturesServiceImpl 1213 | 8 - org.apache.karaf.features.core - 4.0.7 |   mvnSmiley Surprisedrg.talend.payments.testrejecttransaction/TestRejectTransaction-bundle/0.3

14:48:55,843 | INFO  | pool-4-thread-1  | rnal.service.FeaturesServiceImpl 1213 | 8 - org.apache.karaf.features.core - 4.0.7 | Starting bundles:

14:48:55,843 | INFO  | pool-4-thread-1  | rnal.service.FeaturesServiceImpl 1213 | 8 - org.apache.karaf.features.core - 4.0.7 |   payments.TestNotificationPostprocessService/0.4.0

14:48:55,843 | INFO  | pool-4-thread-1  | ?                                   ? | 72 - org.apache.aries.spifly.dynamic.bundle - 1.0.1 | Bundle Considered for SPI providers: payments.TestNotificationPostprocessService