Ignite classloading and tomee ear

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Ignite classloading and tomee ear

hwaastad
Hi,
having some issues using ignite with tomee and ear.

It's absoutely a cornercase, but I'll ask you guys anyways.

Using ignite with peer classloading.

cache<string,Object>

If putting third-party-jar in ear/lib all is well.

Having third-party in WEB-INF/lib classloading fails using the following:
List<third.party.object> list = new AL<third.party.object>();
list.add(new <third.party.object>)
cache.put(key,list)

If, however, I do:
cache.put(key, Arrays.asList(list.toArray()))

It's ok.

Does this seem strange?

/hw
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Ignite classloading and tomee ear

Romain Manni-Bucau
depends how ignite is configure the serialize the data, if using plain
byte[] then it works since it doesnt need the classloader until it loads
back the data which is likely done
in the right classloader.

Also depends if you set a classloader to the cache and if you set the right
one or not at that moment.


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2017-06-16 10:34 GMT+02:00 hwaastad <[hidden email]>:

> Hi,
> having some issues using ignite with tomee and ear.
>
> It's absoutely a cornercase, but I'll ask you guys anyways.
>
> Using ignite with peer classloading.
>
> cache<string,Object>
>
> If putting third-party-jar in ear/lib all is well.
>
> Having third-party in WEB-INF/lib classloading fails using the following:
> List<third.party.object> list = new AL<third.party.object>();
> list.add(new <third.party.object>)
> cache.put(key,list)
>
> If, however, I do:
> cache.put(key, Arrays.asList(list.toArray()))
>
> It's ok.
>
> Does this seem strange?
>
> /hw
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/Ignite-classloading-and-tomee-ear-tp4681871.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Ignite classloading and tomee ear

hwaastad
Hi,
you're right.

I'm producing cache like:
 CacheConfiguration<String, List> cc = new CacheConfiguration<>("xxxcache");
 NB: -> Ignition.ignite().configuration().setClassLoader(Thread.currentThread().getContextClassLoader());
 return Ignition.ignite().getOrCreateCache(cc);

So I needed to set CL in cach producer shown in NB to get ear loading working.


thx.

/hw
Loading...