Hi,
that can be related to the Pax Web feature and httpclient dependencies.
Instead of using the kar, it would be great to have the resolver output
(with feature:install -v). It will explain the cause of the refresh.
Regards
JB
On 01/20/2017 03:35 PM, rsteppac2 wrote:
Hello,
I am on Karaf 4.0.7, Camel 2.16.3.
I am struggling with a classpath problem when deploying a KAR via the deploy
folder. Out of 4 features/bundles that depend on the camel-http4 feature, 3
fail at run-time when their routes get triggered:
2017-01-20 15:02:29,968 | ERROR | tp1107713346-554 | event_log
| 66 - org.apache.camel.camel-core - 2.16.3 |
ID-Ralfs-MacBook-Pro-local-62189-1484920844831-20-11 | Remote event
processing exception cause: java.lang.NoClassDefFoundError:
org/apache/camel/component/http4/helper/HttpMethodHelper
All 4 features declare their dependency to camel-http4 in the exact same way
in their feature descriptor:
<feature name="...">
<feature version="2.16.3" prerequisite="false"
dependency="false">camel-http4</feature>
<!-- ... -->
<bundle>mvn:the.bundle.group/the-bundle/4.0.20-SNAPSHOT</bundle>
</feature>
During deployment of the KAR most features/bundles get stopped and then
re-started multiple times. The only bundle that can successfully resolve the
http4 endpoint is the one that is installed and started last. The 4 bundles
correspond to the following Camel context:
pas-hp-ws -> bundle 1, NoClassDefFoundError at runtime
pas-patient-ws -> bundle 2, NoClassDefFoundError at runtime
pas-patient-registration -> bundle 3, NoClassDefFoundError at runtime
pep-pas, pep-xds -> bundle 4, works
This is the start/restart sequence when deploying the KAR:
$ grep -e 'CamelContext:.*shutdown' -e 'CamelContext:.*started' karaf.log
2017-01-20 15:12:02,159 | INFO | Apache Camel 2.16.3 (CamelContext:
pas-hp-ws) started in 4.628 seconds
2017-01-20 15:12:03,356 | INFO | Apache Camel 2.16.3 (CamelContext:
pas-hp-ws) is shutdown in 0.052 seconds
2017-01-20 15:12:04,480 | INFO | Apache Camel 2.16.3 (CamelContext:
rest-api) started in 0.311 seconds
2017-01-20 15:12:06,440 | INFO | Apache Camel 2.16.3 (CamelContext:
pas-hp-ws) started in 1.638 seconds
2017-01-20 15:12:08,641 | INFO | Apache Camel 2.16.3 (CamelContext:
pas-patient-ws) started in 0.701 seconds
2017-01-20 15:12:09,988 | INFO | Apache Camel 2.16.3 (CamelContext:
pas-patient-ws) is shutdown in 0.031 seconds
2017-01-20 15:12:10,046 | INFO | Apache Camel 2.16.3 (CamelContext:
pas-hp-ws) is shutdown in 0.040 seconds
2017-01-20 15:12:12,185 | INFO | Apache Camel 2.16.3 (CamelContext:
pas-hp-ws) started in 1.418 seconds
2017-01-20 15:12:14,019 | INFO | Apache Camel 2.16.3 (CamelContext:
pas-patient-registration-ws) started in 1.232 seconds
2017-01-20 15:12:15,564 | INFO | Apache Camel 2.16.3 (CamelContext:
pas-patient-ws) started in 1.313 seconds
2017-01-20 15:12:17,590 | INFO | Apache Camel 2.16.3 (CamelContext:
pas-patient-registration-ws) is shutdown in 0.025 seconds
2017-01-20 15:12:17,634 | INFO | Apache Camel 2.16.3 (CamelContext:
pas-patient-ws) is shutdown in 0.030 seconds
2017-01-20 15:12:17,673 | INFO | Apache Camel 2.16.3 (CamelContext:
rest-api) is shutdown in 0.018 seconds
2017-01-20 15:12:17,709 | INFO | Apache Camel 2.16.3 (CamelContext:
pas-hp-ws) is shutdown in 0.026 seconds
2017-01-20 15:12:19,203 | INFO | Apache Camel 2.16.3 (CamelContext:
rest-api) started in 0.158 seconds
2017-01-20 15:12:20,754 | INFO | Apache Camel 2.16.3 (CamelContext:
pep-pas) started in 0.983 seconds
2017-01-20 15:12:21,016 | INFO | Apache Camel 2.16.3 (CamelContext:
pep-xds) started in 0.256 seconds
2017-01-20 15:12:22,781 | INFO | Apache Camel 2.16.3 (CamelContext:
pas-hp-ws) started in 1.535 seconds
2017-01-20 15:12:23,881 | INFO | Apache Camel 2.16.3 (CamelContext:
pas-patient-registration-ws) started in 0.725 seconds
2017-01-20 15:12:25,104 | INFO | Apache Camel 2.16.3 (CamelContext:
pas-patient-ws) started in 1.037 seconds
2017-01-20 15:12:27,205 | INFO | Apache Camel 2.16.3 (CamelContext:
pep-xds) is shutdown in 0.039 seconds
2017-01-20 15:12:27,224 | INFO | Apache Camel 2.16.3 (CamelContext:
pep-pas) is shutdown in 0.016 seconds
2017-01-20 15:12:27,265 | INFO | Apache Camel 2.16.3 (CamelContext:
pas-patient-registration-ws) is shutdown in 0.019 seconds
2017-01-20 15:12:27,306 | INFO | Apache Camel 2.16.3 (CamelContext:
pas-patient-ws) is shutdown in 0.023 seconds
2017-01-20 15:12:27,389 | INFO | Apache Camel 2.16.3 (CamelContext:
pas-hp-ws) is shutdown in 0.042 seconds
2017-01-20 15:12:29,977 | INFO | Apache Camel 2.16.3 (CamelContext:
pep-pas) started in 0.495 seconds
2017-01-20 15:12:30,225 | INFO | Apache Camel 2.16.3 (CamelContext:
pep-xds) started in 0.246 seconds
2017-01-20 15:12:33,639 | INFO | Apache Camel 2.16.3 (CamelContext:
graph-migration) started in 0.174 seconds
2017-01-20 15:12:37,158 | INFO | Apache Camel 2.16.3 (CamelContext:
pas-hp-ws) started in 2.968 seconds
2017-01-20 15:12:38,878 | INFO | Apache Camel 2.16.3 (CamelContext:
pas-patient-registration-ws) started in 1.218 seconds
2017-01-20 15:12:40,150 | INFO | Apache Camel 2.16.3 (CamelContext:
pas-patient-ws) started in 1.054 seconds
2017-01-20 15:12:42,417 | INFO | Apache Camel 2.16.3 (CamelContext:
pep-xds) is shutdown in 0.019 seconds
2017-01-20 15:12:42,440 | INFO | Apache Camel 2.16.3 (CamelContext:
pep-pas) is shutdown in 0.018 seconds
2017-01-20 15:12:43,577 | INFO | Apache Camel 2.16.3 (CamelContext:
xacml-pdp) started in 0.917 seconds
2017-01-20 15:12:44,667 | INFO | Apache Camel 2.16.3 (CamelContext:
pep-pas) started in 0.915 seconds
2017-01-20 15:12:45,028 | INFO | Apache Camel 2.16.3 (CamelContext:
pep-xds) started in 0.355 seconds
2017-01-20 15:12:46,642 | INFO | Apache Camel 2.16.3 (CamelContext:
pas-persistence) started in 0.322 seconds
2017-01-20 15:12:48,278 | INFO | Apache Camel 2.16.3 (CamelContext:
ldap-graph-synchronization) started in 0.303 seconds
$
(Side question: why all those re-deploy cycles?)
If after initial deployment the bundles are restarted, then they start
working as well.
(Side question: When deploying the KAR it is not possible to
uninstall/install the features in the KAR by name from the console. The
feature:uninstall/install commands do not return an error, but in the log I
can see they take no effect?)
I cannot reproduce the problem when installing the features one by one from
the Karaf console in my development environment from my local maven
repository.
Explicitly adding the import of org.apache.camel.component.http4.helper to
the maven-bundle-plugin configuration also works around the problem.
What could be the reason why most bundles cannot resolve classes required by
the http4 endpoint but at least one can when deploying a KAR via the deploy
folder?
Thanks!
Ralf
--
View this message in context:
http://karaf.922171.n3.nabble.com/NoClassDefFoundError-org-apache-camel-component-http4-helper-HttpMethodHelper-tp4049297.html
Sent from the Karaf - User mailing list archive at Nabble.com.
--
Jean-Baptiste Onofré
[email protected]
http://blog.nanthrax.net
Talend - http://www.talend.com