You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by "Meise, Christoph" <Ch...@ImmobilienScout24.de> on 2009/05/11 13:11:22 UTC

How to reference shared libraries from within service-assembly?

Hello list,

I'm using Servicemix 3.3 and Camel 1.6 and I have two questions:
1. I expose some JMS Endpoints via the Servicemix JMS service unit and I
want to route from one endpoint to another. Up to there there is no
problem. The problem arises when I add an <onException> tag to my route
and from within this exception handling I want to send a message via a
Servicemix JMS endpoint. Now what happens is that camel registers the
exception at the Exchange as property and at the in-message as header
field (as Exception object). Now when the message is delivered to my
Servicemix JMS endpoint it is deserialized. This does not work since not
all classes of all serialized Exception object are visible within the
service unit of the JMS Endpoint. Generally it seems that the JbiBinding
within the Camel Installer should demote all property headers to
primitives. That would solve the issue, switching from one world to
another (Camel <-> JBI). Also having a small Processor removing those
entries from the in-message header did not work most probably due to the
use of ConcurrentHashMap.

2. As a solution to this class loading issue I packaged all shared
library to a JBI shared-library. Now the question is: Is there a
possibility to reference this shared library from within a service
assembly? Do I need a component referencing it? And which file within a
service assembly is the correct one to edit? Unfortunately the wiki page
about classloaders is a little fuzzy (camel for example has no xbean
file, or at least I do not know of).

	For reference the service assembly structure:
		+ service-assembly.jar
		|
		+ META-INF
			|
			+ jbi.xml
		|
		+ jms-su.jar
			|
			+ META-INF
				|
				+ jbi.xml
			|
			+ xbean.xml
		|
		+ camel-su.jar
			|
			+ META-INF
				|
				+ jbi.xml
			|
			+ camel-context.xml (containing beans which
throw exceptions unknown to the jms-su.jar)

Thanks for your answer,
Christoph