You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by georgemc <ge...@riffpie.com> on 2010/06/07 21:31:28 UTC

How do I force self-first classloading in Camel SU?

Hi

I've seen this problem brushed upon in a few previous posts, but never
actually resolved as far as I can tell. As the title suggests, I can't
persuade a Camel service-unit to load its own classes. Specifically,
Servicemix is providing old versions of spring-core and spring-beans and
loading dependencies from them before my SU gets a chance to, with tedious
NoSuchMethodError results. I've tried with various versions of Servicemix
3.2.x and 3.3.x to no avail, and as many versions of Camel as I can eat.
Whatever configuration of dependencies I use in Maven, nothing works. I've
unpacked every SU to see if the rogue jars are there, and they're not. I'm
sure this is a classloading problem, but I have no idea how to solve it. 

Anybody got any ideas? Moving to Servicemix 4 is not an option

thanks for looking
-- 
View this message in context: http://old.nabble.com/How-do-I-force-self-first-classloading-in-Camel-SU--tp28809688p28809688.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: How do I force self-first classloading in Camel SU?

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi George,

OK I see. I guess that your SU contains:
- your route builder (pure Java)
- your camel-context.xml file (in resources)

Have you try to use the <classLoaderDelegation/> tag in your SU's pom.xml ?

Regards
JB

On 06/08/2010 10:55 AM, georgemc wrote:
>
> Hi Jean-Batiste,
>
> Thanks for the reply. Unfortunately, I'm talking about a Camel SU, there is
> no XBean configuration.
>
> rgds
>
> George
>
>
> Jean-Baptiste Onofré wrote:
>>
>> Hi,
>>
>> Could you provide your pom.xml and xbean.xml ?
>> Could we have the complete stack trace ?
>>
>> Basicly, to define self-first delegation, you need:
>>
>> - to add<classLoaderDelegation>self-first</classLoaderDelegation>  in
>> your SU's pom.xml
>> - to add<classpath inverse="true"/>  in your xbean.xml
>>
>> FYI, you have several ways to extend a SU classloader, take a look on:
>> http://servicemix.apache.org/classloaders.html
>>
>> Regards
>> JB
>>
>> On 06/07/2010 09:31 PM, georgemc wrote:
>>>
>>> Hi
>>>
>>> I've seen this problem brushed upon in a few previous posts, but never
>>> actually resolved as far as I can tell. As the title suggests, I can't
>>> persuade a Camel service-unit to load its own classes. Specifically,
>>> Servicemix is providing old versions of spring-core and spring-beans and
>>> loading dependencies from them before my SU gets a chance to, with
>>> tedious
>>> NoSuchMethodError results. I've tried with various versions of Servicemix
>>> 3.2.x and 3.3.x to no avail, and as many versions of Camel as I can eat.
>>> Whatever configuration of dependencies I use in Maven, nothing works.
>>> I've
>>> unpacked every SU to see if the rogue jars are there, and they're not.
>>> I'm
>>> sure this is a classloading problem, but I have no idea how to solve it.
>>>
>>> Anybody got any ideas? Moving to Servicemix 4 is not an option
>>>
>>> thanks for looking
>>
>> --
>> Jean-Baptiste Onofré
>> ---------------------------------
>>    HomePage
>> http://www.nanthrax.net
>> ---------------------------------
>>    Contacts
>> jbonofre@apache.org
>> jb@nanthrax.net
>> ---------------------------------
>>    OpenSource
>> BuildProcess/AutoDeploy
>> http://buildprocess.sourceforge.net
>> Apache ServiceMix
>> http://servicemix.apache.org
>> -----------------------------------
>> PGP : 17D4F086
>>
>>
>

Re: How do I force self-first classloading in Camel SU?

Posted by georgemc <ge...@riffpie.com>.
Hi Jean-Batiste,

Thanks for the reply. Unfortunately, I'm talking about a Camel SU, there is
no XBean configuration. 

rgds

George


Jean-Baptiste Onofré wrote:
> 
> Hi,
> 
> Could you provide your pom.xml and xbean.xml ?
> Could we have the complete stack trace ?
> 
> Basicly, to define self-first delegation, you need:
> 
> - to add <classLoaderDelegation>self-first</classLoaderDelegation> in 
> your SU's pom.xml
> - to add <classpath inverse="true"/> in your xbean.xml
> 
> FYI, you have several ways to extend a SU classloader, take a look on:
> http://servicemix.apache.org/classloaders.html
> 
> Regards
> JB
> 
> On 06/07/2010 09:31 PM, georgemc wrote:
>>
>> Hi
>>
>> I've seen this problem brushed upon in a few previous posts, but never
>> actually resolved as far as I can tell. As the title suggests, I can't
>> persuade a Camel service-unit to load its own classes. Specifically,
>> Servicemix is providing old versions of spring-core and spring-beans and
>> loading dependencies from them before my SU gets a chance to, with
>> tedious
>> NoSuchMethodError results. I've tried with various versions of Servicemix
>> 3.2.x and 3.3.x to no avail, and as many versions of Camel as I can eat.
>> Whatever configuration of dependencies I use in Maven, nothing works.
>> I've
>> unpacked every SU to see if the rogue jars are there, and they're not.
>> I'm
>> sure this is a classloading problem, but I have no idea how to solve it.
>>
>> Anybody got any ideas? Moving to Servicemix 4 is not an option
>>
>> thanks for looking
> 
> -- 
> Jean-Baptiste Onofré
> ---------------------------------
>   HomePage
> http://www.nanthrax.net
> ---------------------------------
>   Contacts
> jbonofre@apache.org
> jb@nanthrax.net
> ---------------------------------
>   OpenSource
> BuildProcess/AutoDeploy
> http://buildprocess.sourceforge.net
> Apache ServiceMix
> http://servicemix.apache.org
> -----------------------------------
> PGP : 17D4F086
> 
> 

-- 
View this message in context: http://old.nabble.com/How-do-I-force-self-first-classloading-in-Camel-SU--tp28809688p28815330.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: How do I force self-first classloading in Camel SU?

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,

Could you provide your pom.xml and xbean.xml ?
Could we have the complete stack trace ?

Basicly, to define self-first delegation, you need:

- to add <classLoaderDelegation>self-first</classLoaderDelegation> in 
your SU's pom.xml
- to add <classpath inverse="true"/> in your xbean.xml

FYI, you have several ways to extend a SU classloader, take a look on:
http://servicemix.apache.org/classloaders.html

Regards
JB

On 06/07/2010 09:31 PM, georgemc wrote:
>
> Hi
>
> I've seen this problem brushed upon in a few previous posts, but never
> actually resolved as far as I can tell. As the title suggests, I can't
> persuade a Camel service-unit to load its own classes. Specifically,
> Servicemix is providing old versions of spring-core and spring-beans and
> loading dependencies from them before my SU gets a chance to, with tedious
> NoSuchMethodError results. I've tried with various versions of Servicemix
> 3.2.x and 3.3.x to no avail, and as many versions of Camel as I can eat.
> Whatever configuration of dependencies I use in Maven, nothing works. I've
> unpacked every SU to see if the rogue jars are there, and they're not. I'm
> sure this is a classloading problem, but I have no idea how to solve it.
>
> Anybody got any ideas? Moving to Servicemix 4 is not an option
>
> thanks for looking

-- 
Jean-Baptiste Onofré
---------------------------------
  HomePage
http://www.nanthrax.net
---------------------------------
  Contacts
jbonofre@apache.org
jb@nanthrax.net
---------------------------------
  OpenSource
BuildProcess/AutoDeploy
http://buildprocess.sourceforge.net
Apache ServiceMix
http://servicemix.apache.org
-----------------------------------
PGP : 17D4F086