Welcome to the new Gigaspaces XAP forum. To recover your account, please follow these instructions.

Ask Your Question

Gigaspaces Classloader order

Hi, we are having some troubles with the classloader in Gigaspaces XAP premium 9.6.2. We have two jar files inside a PU, both jars contains different versions of a class. Which jar will be loaded first by the Gigaspaces classloader?, I assume that the jar load order is not guaranteed by a criteria as for example, alphabetically.

Thanks in advance.

asked 2014-01-09 06:43:07 -0500

Paul Manjarres gravatar image
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

You should absolutely avoid having the same class (different versions) placed more than once as part of the gigaspaces classpath or PU libraries/classes.

Java is not handling this nicely. You will have class Not Def /found expection or similar. Java will not report duplicate classes error.

You should use relevant tools to scan your libraries for duplicate classes.

The class load hierarchy search order into the PU instance classloader is parent first. Similar to other app servers. The actual load order depends on the jars order within the PU lib folder. Very unmanageable.

answered 2014-01-09 07:53:38 -0500

shay hassidim gravatar image
edit flag offensive delete link more


Thank you Shay!, We had to override some classes of a jar file, but we'll find another approach to avoid class duplication and classloader issues.


Paul Manjarres gravatar image Paul Manjarres  ( 2014-01-10 08:29:11 -0500 )edit

We do plan some better handling for such cases in future releases. I know how annoying is this issue , especially when having plenty of jars as part of the PU. In extreme cases the only way to debug this issue would be by running the GSC in -verbose:class mode and see the jar that is causing the issue.

shay hassidim gravatar image shay hassidim  ( 2014-01-10 08:42:52 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2014-01-09 06:43:07 -0500

Seen: 345 times

Last updated: Jan 09 '14