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

Ask Your Question
0

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

Paul Manjarres gravatar image
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

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

shay hassidim gravatar image
edit flag offensive delete link more

Comments

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.

Thanks.

Paul Manjarres gravatar imagePaul Manjarres ( 2014-01-10 08:29:11 -0600 )edit
1

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 imageshay hassidim ( 2014-01-10 08:42:52 -0600 )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

Stats

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

Seen: 158 times

Last updated: Jan 09 '14