[Xposed General] mcbyte_it:
ClassNotFoundException for modules

I have a testing a module that overrides a class in PAckageManager, and I am getting ClassNotFoundException, same code on KitKat works just fine. here is the code:

public void initZygote(StartupParam startupParam) throws Throwable {
try {
ClassLoader clsLoader = XPackageManager.class.getClassLoader();
Utils.xlog("cls1: " + clsLoader);

try { // tried with the default boot loader and a system one, both generates the same exception
clsLoader = XposedBridge.BOOTCLASSLOADER;
Utils.xlog("cls2: " + clsLoader);
} catch (Exception e) {
Utils.xlog("clsloader exception: " + e.getMessage());
}

final Class<?> clsPMS = findClass("com.android.server.pm.PackageManagerService", clsLoader); // <-- this statement causes the exception !!!!!!!

Utils.xlog("clsPMS: " + clsPMS);
} catch (Throwable t) {
XposedBridge.log(t);
}
}

and here is the log:

02-14 21:38:29.944 I/Xposed (18457): cls1: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/xposed.test-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]]
02-14 21:38:29.944 I/Xposed (18457): cls2: dalvik.system.PathClassLoader[DexPathList[[zip file "/system/framework/XposedBridge.jar"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]]
02-14 21:38:29.946 E/Xposed (18457): de.robv.android.xposed.XposedHelpers$ClassNotFoundError: java.lang.ClassNotFoundException: com.android.server.pm.PackageManagerService
02-14 21:38:29.946 E/Xposed (18457):	at de.robv.android.xposed.XposedHelpers.findClass(XposedHelpers.java:52)
02-14 21:38:29.946 E/Xposed (18457):	at xposed.test.XPackageManager.initZygote(XPackageManager.java:60)
02-14 21:38:29.946 E/Xposed (18457):	at de.robv.android.xposed.XposedBridge.loadModule(XposedBridge.java:469)
02-14 21:38:29.946 E/Xposed (18457):	at de.robv.android.xposed.XposedBridge.loadModules(XposedBridge.java:418)
02-14 21:38:29.946 E/Xposed (18457):	at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:105)
02-14 21:38:29.946 E/Xposed (18457): Caused by: java.lang.ClassNotFoundException: com.android.server.pm.PackageManagerService
02-14 21:38:29.946 E/Xposed (18457):	at java.lang.Class.classForName(Native Method)
02-14 21:38:29.946 E/Xposed (18457):	at java.lang.Class.forName(Class.java:308)
02-14 21:38:29.946 E/Xposed (18457):	at external.org.apache.commons.lang3.ClassUtils.getClass(ClassUtils.java:823)
02-14 21:38:29.946 E/Xposed (18457):	at de.robv.android.xposed.XposedHelpers.findClass(XposedHelpers.java:50)
02-14 21:38:29.946 E/Xposed (18457):	... 4 more
02-14 21:38:29.946 E/Xposed (18457): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.android.server.pm.PackageManagerService" on path: DexPathList[[zip file "/system/framework/XposedBridge.jar"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
02-14 21:38:29.946 E/Xposed (18457):	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
02-14 21:38:29.946 E/Xposed (18457):	at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
02-14 21:38:29.946 E/Xposed (18457):	at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
02-14 21:38:29.946 E/Xposed (18457):	... 8 more
02-14 21:38:29.946 E/Xposed (18457):	Suppressed: java.lang.ClassNotFoundException: com.android.server.pm.PackageManagerService
02-14 21:38:29.946 E/Xposed (18457):	at java.lang.Class.classForName(Native Method)
02-14 21:38:29.946 E/Xposed (18457):	at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
02-14 21:38:29.946 E/Xposed (18457):	at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
02-14 21:38:29.946 E/Xposed (18457):	at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
02-14 21:38:29.946 E/Xposed (18457):	... 9 more
02-14 21:38:29.946 E/Xposed (18457):	Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available