These are chat archives for atomix/atomix

12th
Jul 2016
Evan Lindsay
@Favorlock
Jul 12 2016 17:36
Hello, quick question. I'm using atmoix clients in a software plugin and I'm getting class not found exceptions for DistributedGroupFactory.
Any idea what could be the cause?
Madan Jampani
@madjam
Jul 12 2016 17:37
What does your pom dependency look like?
Evan Lindsay
@Favorlock
Jul 12 2016 17:38
here is my build script: http://pastebin.com/d7743JkE
the classes are in the jar
I know the software we are building the plugin has a class loader for each plugin, so I'm not sure if that is interfering somehow.
Evan Lindsay
@Favorlock
Jul 12 2016 17:44
here is the full stack if it helps: http://pastebin.com/HhYrBC06
Madan Jampani
@madjam
Jul 12 2016 17:46
Any reason why you are shading the atomix jar?
Evan Lindsay
@Favorlock
Jul 12 2016 17:47
because the software loads the plugins from the jar, any external dependencies need to be shaded so that they are loaded into the plugin class loader.
Madan Jampani
@madjam
Jul 12 2016 17:47
Usually people do it because the dependency they are pulling is not OSGi compatible. But that is not the case with Atomix
David Moravek
@dmvk
Jul 12 2016 17:48
This message was deleted
Madan Jampani
@madjam
Jul 12 2016 17:50
Looks like it is trying to find the class with its corresponding non-shaded class name.
Evan Lindsay
@Favorlock
Jul 12 2016 17:51
If I don't relocate the packages this is the stack trace I get: http://pastebin.com/MPbqw3fY
David Moravek
@dmvk
Jul 12 2016 17:51
Hey guys, can you please take a quick look at atomix/atomix#190 It'd help me a lot? Thanks ;)
Madan Jampani
@madjam
Jul 12 2016 17:58
io.atomix.group.DistributedGroupFactory is indeed part of atomix-all jar. Not sure why are running into error.
Madan Jampani
@madjam
Jul 12 2016 18:22
ClassLoader cannot see the DistributedGroupFactory class. Not sure how your dependencies are structured, but it might be possible that the module handling the messages also needs to have a dependency on atomix.
Evan Lindsay
@Favorlock
Jul 12 2016 18:31
The odd thing is that the classloader the plugin uses can resolve those classes... it's when we call AtomixConnector.getClient().getGroup("server").join() that it fails to work. We call AtomixClient.builder().withTransport(new NettyTransport()).build()
.connect(atomixAddresses).join(); prior to that.
Evan Lindsay
@Favorlock
Jul 12 2016 20:53
Hey Madan, quick question. So I'm trying to debug where exactly the SerializationException is being thrown from but remote debugging shows no results, in fact, it appears that the exception magically appears from netty. Any ideas why?
Madan Jampani
@madjam
Jul 12 2016 21:04
This could be because the bundle that contains the serializer (catalyst-serializer) cannot access classes defined in atomix-group as they belong to different bundles and serializer (rightly) does not depend on atomix-group. Code in catalyst-serializer tries to, at run time, dynamically load (by calling Class::forName) the DistributedGroupFactory class.
One thing you can do is to pre-register the class loader to use for loading DistributedGroupFactory
This you can do by calling Serializer::registerClassLoader
Evan Lindsay
@Favorlock
Jul 12 2016 21:07
How do I get the serializer instance?
Madan Jampani
@madjam
Jul 12 2016 21:07
So basically on serializer you supply to the AtomixClient try calling serializer.registerClassLoader(DistributedGroupFactory.class)
Serializer serializer = new Serializer() :)
Madan Jampani
@madjam
Jul 12 2016 21:12
        Serializer serializer = new Serializer();
        serializer.registerClassLoader(DistributedGroupFactory.class);
        Atomix client = AtomixClient.builder(...).withSerializer(serializer).withTransport(new NettyTransport()).build()
Evan Lindsay
@Favorlock
Jul 12 2016 21:13
Yeah, just tried that and it's still throwing the class not found exception :\
Madan Jampani
@madjam
Jul 12 2016 21:14
Did you do this on the server side as well?
This has no effect on the client side actually. It needs to be on the server side
Evan Lindsay
@Favorlock
Jul 12 2016 21:15
we're using the standalone server, do we need to do anything specific for that?
Madan Jampani
@madjam
Jul 12 2016 21:16
Can you post your server side initialization code?
Jordan Halterman
@kuujo
Jul 12 2016 21:17
hmm
Evan Lindsay
@Favorlock
Jul 12 2016 21:20
Madan Jampani
@madjam
Jul 12 2016 21:23
hmm
Evan Lindsay
@Favorlock
Jul 12 2016 21:25
Class that configures the client: http://pastebin.com/9sv1Y93h main class http://pastebin.com/5yv6EkWc
Madan Jampani
@madjam
Jul 12 2016 21:27
Can you write code to start the server as well? That will give you the opporunity to supply a custom serializer with the class loader registered? That is what I would try next
Evan Lindsay
@Favorlock
Jul 12 2016 21:56
So just gave your suggestion a test and that appears to have solved the problem.
how can I go about enabling debug logging similar to how it is done with the standalone app?
cwolfinger
@cwolfinger
Jul 12 2016 22:14
Hi All - is there a mechanism to take a backup / restore of the server state?
Evan Lindsay
@Favorlock
Jul 12 2016 22:20
Madan, this seems to be the error I'm getting now: http://pastebin.com/baitphsm
this is my server code: http://pastebin.com/NRZdTVEe
Evan Lindsay
@Favorlock
Jul 12 2016 22:38
How can I figure out what class the id is associated with?
Evan Lindsay
@Favorlock
Jul 12 2016 23:17
So from what I can see, the stack trace I listed last results after the NoOpCommand is written?