osama-raddad/encog-java

Problem when using persist without CL (JOCL-0.1.3a-beta.jar) in classpath

Closed this issue · 1 comments

What steps will reproduce the problem?
1. Save a BasicNeuralNetwork with a PersistWriter
2. Load the eg file to recreate the BasicNeuralNetwork
3. In the method org.encog.util.ReflectionUtil loadClassmap() there is an Error 
thrown when we try to load the line org.encog.util.cl.EncogCLPlatform from 
classes.txt if you don't have JOCL-0.1.3a-beta.jar in your classPath 

 exact error message is : java.lang.NoClassDefFoundError: org/jocl/NativePointerObject

 All the classes after this in classes.txt are not loaded.

What is the expected output? What do you see instead?
If you try to load the file a second time it doesn't throw an error and the 
network is correctly created. I think the second call doesn't generate a call 
to loadClassmap() method because the map is not empty anymore.
All subsequent calls works ok.

What version of the product are you using? On what operating system?
encog version 2.4.3

Please provide any additional information below.
I think maybe if we don't have the JOCL jar in the classpath (because we don't 
want to use CL) the loadClassmap() method should just ignore those classes.
I did a workaround in my calling class i call loadClassmap() method inside a 
try catch (Error er) one time to avoid getting the error in the PersistReader.

Thank you for your great work on Encog

Regards 

Julien Blaize


Original issue reported on code.google.com by julien.b...@gmail.com on 30 Sep 2010 at 7:15

Problem has been corrected in Encog 2.5.

Original comment by heatonre...@gmail.com on 10 Oct 2010 at 4:04

  • Changed state: Verified