The ClassCastException happens when there are 2 SU which use camel-cxf
component and camel-cxf component are in their SU's lib at the same
time, or when the SU is reload without restarting SMX.
I know different SU has different class loader which will help to
isolate the SU jars. If a same class loaded by different child class
loader twice, the ClassCastException will happen :(.
Willem
Guillaume Nodet wrote:
Btw, why / when do these ClassCastException happen ? I do understand
that each SU would have its own copy of the components, so they can't
really share any code, but the JBI exchange is just the xml content
along with the properties. This means some components use POJOs and
put them in the JBI exchange properties map ? Do you have more infos
about that ?
On Mon, Jul 28, 2008 at 10:02 AM, Willem Jiang <[EMAIL PROTECTED]> wrote:
Hi,
The camel component just contains the core camel jars, but some use cases
require the use of addon components (for example camel-cxf) which are not
present in the core camel jars. If you have multiple SU's with a dependency
on an addon component then you will hit classloading conflicts
(ClassCastException typically ). You currently need to:
1) Add the camel extension components to a jbi shared library
2) Edit the servicemix-camel service engine jbi.xml and add your shared
library.
Having to edit the servicemix-camel jbi.xml is not ideal so this enhancement
is to add a placeholder shared library to the camel-core component. The
shared library can be empty but will need to exist in the hot deploy
directory.
This would eliminate the need to hack the camel component's jbi.xml, you
would just need to edite the camel shared library pom.xml and override the
old camel shared library in the deploy directory.
Any thoughts ?
Willem