java.lang.IllegalAccessException: Class esel.loader.EselLoader can not access a member of class MultiplexerCommon with modifiers ""
at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65)
at java.lang.Class.newInstance0(Class.java:344)
at java.lang.Class.newInstance(Class.java:303)
at esel.loader.EselLoader.importClass(EselLoader.java:160)
at esel.loader.EselLoader.importClasses(EselLoader.java:108)
at esel.loader.EselLoader.importJar(EselLoader.java:194)
at esel.EselApplication.jMenu4_ImportActionPerformed(EselApplication.java:653)
at esel.EselApplication.access$3100(EselApplication.java:33)
at esel.EselApplication$31.actionPerformed(EselApplication.java:522)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.AbstractButton.doClick(AbstractButton.java:302)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1000)
at javax.swing.plaf.basic.BasicPopupMenuUI$Actions.doReturn(BasicPopupMenuUI.java:441)
at javax.swing.plaf.basic.BasicPopupMenuUI$Actions.actionPerformed(BasicPopupMenuUI.java:415)
at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1571)
at javax.swing.JComponent.processKeyBinding(JComponent.java:2763)
at javax.swing.KeyboardManager.fireBinding(KeyboardManager.java:255)
at javax.swing.KeyboardManager.fireKeyboardAction(KeyboardManager.java:204)
at javax.swing.JComponent.processKeyBindingsForAllComponents(JComponent.java:2840)
at javax.swing.JComponent.processKeyBindings(JComponent.java:2832)
at javax.swing.JComponent.processKeyEvent(JComponent.java:2726)
at java.awt.Component.processEvent(Component.java:5265)
at java.awt.Container.processEvent(Container.java:1966)
at java.awt.Component.dispatchEventImpl(Component.java:3955)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1810)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:672)
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:920)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:798)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:636)
at java.awt.Component.dispatchEventImpl(Component.java:3841)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Window.dispatchEventImpl(Window.java:1774)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(Ev
the loadercode is thisone :
try {
File f = new File("/home/sleon/multi/MultiplexerCommon.class");
byte[] data = new byte[(int) f.length()];
FileInputStream fs = new FileInputStream(f);
while( fs.read(data) != -1){
Class model = defineClass("MultiplexerCommon", data, 0, data.length);
System.out.println(model.getMethods());
((CommonElement) model.newInstance()).initialize(this.factory);
//Constructor<GateView> con = model.getConstructor(new Class[]{GateView.class});
//System.out.println(con);
}
} catch (IOException ex) {
ex.printStackTrace();
}
the class which is tryed to be loaded is this one :
import esel.factory.*;
import esel.loader.*;
class MultiplexerCommon implements CommonElement{
public void initialize(GateFactory Factory) {
// MultiplexerModel.initialize(Factory);
// MultiplexerView.initialize(Factory);
}
}
CommonElement is an interface:
package esel.loader;
import esel.factory.GateFactory;
/**
*
* @author sleon
*/
public interface CommonElement {
public void initialize(GateFactory Factory);
}
please help me