This content has been marked as final. Show 3 replies
public class IllegalAccessErrorThe SampleBO class that your client referenced when compiling ExtendedSampleBO
Thrown if an application attempts to access or modify a field, or to call a method that it does not have access to.
Normally, this error is caught by the compiler; this error can only occur at run time if the definition of a class has incompatibly changed.
does not match the SampleBO class you are using at runtime.
Actually problem was that the special `ClassLoader` that loads `ExtendedSampleBO` is not a child of the `ClassLoader` that loaded `SampleBO`. Hence the `ClassLoader` of 'ExtendedSampleBO' was creating its own `SampleBO` class and that was different from the application's `SampleBO` class.
Actually the application has a large number of Rule-set's (binary files), each of which is loaded from db by its own classloader. However, all of these Rule-sets have a common Master ( also loaded from db by a separate classloader ). So instead of loading the Master binary files from the db for each of the Child-set's, I just save a reference to the master class-loader and use that within the Rule-set's class-loaders to load the files ( to save memory by avoiding same classes being loaded multiple times over multiple classloaders - there will be a large number of Rule-set's).
Anyone knows of any other solution than making the Master classloader a child of the Rule-set classloader??
No, why do you need another solution?