Valkyr Posted January 11, 2015 Share Posted January 11, 2015 So I'm writing a webwalker and using Kryo to serialize the web object. The file (as far as I am aware) saves perfectly fine, but when it loads I am presented with the following error: java.lang.NoClassDefFoundError: com/esotericsoftware/reflectasm/ConstructorAccess I believe this is caused by the lack of a no-args constructor, though all my classes have one for that specific reason. Here is the code I am using to load the file: public static WeightedGraph read(String filename) { WeightedGraph retrievedObject = new WeightedGraph(); try (Input input = new Input(new FileInputStream(filename))) { Kryo kryo = new Kryo(); retrievedObject = (WeightedGraph) kryo.readClassAndObject(input); System.out.println("Retrieved from file: " + retrievedObject.getVertices().size() + " nodes"); } catch (FileNotFoundException ex) { Logger.getLogger(WeightedGraph.class.getName()).log(Level.SEVERE, null, ex); } return retrievedObject; } If anyone has used Kryo and experienced a similar problem please respond. Link to comment Share on other sites More sharing options...
Seks Posted January 11, 2015 Share Posted January 11, 2015 maybe abit offtopic but arent you advertising other bot in your signature? Link to comment Share on other sites More sharing options...
Valkyr Posted January 11, 2015 Author Share Posted January 11, 2015 maybe abit offtopic but arent you advertising other bot in your signature? I better change it... xD 1 Link to comment Share on other sites More sharing options...
Seks Posted January 11, 2015 Share Posted January 11, 2015 I better change it... xD lol. now thats better. Link to comment Share on other sites More sharing options...