I have problem with ObjectInputStream.ReadObject() method.
Code below
Expand|Select|Wrap|Line Numbers
- FileClassLoader externalLoader = new FileClassLoader(currentTaskDir);
- Class c = externalLoader.loadClass(className);
- Method mlist[] = c.getDeclaredMethods();
- Object[] objectsPassed = null;
- objectsPassed = (Object[])ois.readObject();
- Object examinedObj = objectsPassed[0];
- String methodName = (String)objectsPassed[1];
Class c is loaded with custom loader from currentTaskDir directory.
Nevertheless, reading ObjectInputStream takes into account only classes from classpath. I do not want to add currentTaskDir to classpath, because of further reloading class.
objectPassed is group of String and ClassName (c). How can I cast ois.ReadObject() to String and c?
Thank You for answers. I will be grateful for them.
Paul