Error occurred during initialization of VM
843829May 15 2009 — edited May 15 2009Hi,
I am not relatively new in java but i am facing this problem. let me explain the problem in detail first.
Actually i am developing a component based system and in this system i am using classloaders in order to locate the classes which are missing at runtime. I have Written a custom System classloader and i am overriding the system property java.system.class.loader by my own system classloader. I have written this classloader in a separate jar file and i am including this jar file in the bootclasspath as well. But when i run it gives following error:
here is the output:
run:
Error occurred during initialization of VM
java.lang.Error: java.lang.ClassNotFoundException: com.onjava.classloader.WrapperClassLoader
at java.lang.ClassLoader.initSystemClassLoader(ClassLoader.java:1332)
at java.lang.ClassLoader.getSystemClassLoader(ClassLoader.java:1295)
Caused by: java.lang.ClassNotFoundException: com.onjava.classloader.WrapperClassLoader
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at java.lang.SystemClassLoaderAction.run(ClassLoader.java:2042)
at java.security.AccessController.doPrivileged(Native Method)
at java.lang.ClassLoader.initSystemClassLoader(ClassLoader.java:1320)
at java.lang.ClassLoader.getSystemClassLoader(ClassLoader.java:1295)
I am passing following options in the JVM options field.
**-Xbootclasspath/a:classloader.jar -Djava.system.class.loader=com.onjava.classloader.WrapperClassLoader**
But the error is the same as i have pasted above.
Can any one please help, i am really stuck up.
Thanks
regards