You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by hwaastad <he...@waastad.org> on 2017/06/16 08:34:31 UTC

Ignite classloading and tomee ear

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.

Re: Ignite classloading and tomee ear

Posted by hwaastad <he...@waastad.org>.
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



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Ignite-classloading-and-tomee-ear-tp4681871p4681873.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: Ignite classloading and tomee ear

Posted by Romain Manni-Bucau <rm...@gmail.com>.
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 <he...@waastad.org>:

> 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.
>