camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <>
Subject [jira] [Resolved] (CAMEL-9483) Deploying bundle with Camel routes packaged in KAR fails randomly
Date Sun, 31 Jan 2016 10:12:39 GMT


Claus Ibsen resolved CAMEL-9483.
       Resolution: Fixed
    Fix Version/s: 2.17.0

We now detect which components and data formats the rest-dsl is configured to use and wait
for those bundles.

> Deploying bundle with Camel routes packaged in KAR fails randomly
> -----------------------------------------------------------------
>                 Key: CAMEL-9483
>                 URL:
>             Project: Camel
>          Issue Type: Bug
>          Components: karaf
>    Affects Versions: 2.16.1
>         Environment: Karaf 4.0.3, blueprint deployment, JDK 1.8_40 on OSX El Capitan
and JDK 1.8_65 on Centos 6.5
>            Reporter: Ralf Steppacher
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.16.2, 2.17.0
>         Attachments: data_format_lookup_failed.log, kar-build-0.0.1-SNAPSHOT.kar, registry_lookup_failed.log
> I am struggling with random deployment failures of bundles containing Camel routes, packaged
in a KAR file. Deployment fails mostly because data formats cannot be found on the classpath
or Camel component beans are not found in the registry.
> The attached sample KAR file contains one bundle with the following blueprint deployment
> {code:xml}
> <blueprint xmlns="" 			xmlns:xsi=""
			xmlns:camel="" 			xsi:schemaLocation="
> 	<bean id="processor" class="ch.rsteppac.karissue.RestProcessor" />
> 	<camelContext id="rest-api" allowUseOriginalMessage="false" xmlns="">
> 		<restConfiguration component="netty4-http" scheme="http" host="" port="2016"
> 			<dataFormatProperty key="prettyPrint" value="true" />
> 		</restConfiguration>
> 		<rest path="/say/hello" id="poc-route" produces="application/json">
> 			<get uri="/{yourName}">
> 				<route>
> 					<camel:process ref="processor" />
> 				</route>
> 			</get>
> 		</rest>
> 	</camelContext>
> </blueprint>
> {code}
> The feature file of the KAR:
> {code:xml}
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <features xmlns="" name="KAR deployment
issue PoC">
>     <repository>mvn:org.apache.camel.karaf/apache-camel/2.16.1/xml/features</repository>
>     <feature name="poc-rest-service" description="Sample REST bundle to demonstrate
the deployment issue in Karaf 4" version="0.0.1.SNAPSHOT">
>         <details>Sample REST bundle to demonstrate the deployment issue in Karaf
>         <feature version="2.16.1" prerequisite="false" dependency="false">camel-jackson</feature>
>         <feature version="2.16.1" prerequisite="false" dependency="false">camel-blueprint</feature>
>         <feature version="2.16.1" prerequisite="false" dependency="false">camel-netty4-http</feature>
>         <bundle>mvn:ch.rsteppac.kar-issue/poc-rest-service/0.0.1-SNAPSHOT</bundle>
>     </feature>
> </features>
> {code}
> On my development machine (OSX) deploying the sample KAR file succeeds about 8 out of
10 times. It appears that the more features the KAR file contains the lower the probability
of success. Our actual project KAR fails deployment about 9 out of 10 times.
> Not all Camel components are equally likely to cause the deployment failure. The most
likely to trigger a failure are data formats, e.g., jackson-json or jaxb.
> Once the KAR file has deployed successfully, restarting Karaf will consistently deploy
the bundles successfully. Until one deletes Karaf's data folder, then all bets are off again.
> Adding the feature.xml generated for the KAR with {{feature:repo-add}} and then deploying
the features with {{feature:install}} virtually never fails.
> Stack traces for most frequent deployment failure of the sample KAR are attached to the
> h4. EDIT
> The issue is actually unrelated to fact that the features are deployed via a KAR file.
While I can successfully install each feature individually on the command line, if I restart
Karaf and the features are deployed from the {{$KARAF_HOME/data}} directory, the behavior
is the same as described above.
> I encountered another class of errors: A bean declared in the blueprint context was not
resolvable in the Camel context in the same file. 
> Defining a start-level for my bundles (90) seems to be a workaround for the different
issues described above.

This message was sent by Atlassian JIRA

View raw message