Skip to main content

A problem happened while loadBootstrapClass() loaded java/lang/ClassLoader!

1 reply [Last post]
choichanwoo
Offline
Joined: 2007-08-07
Points: 0

I want to port CVM to UbiFOS(Real-Time Operating System).

※ UbiFOS is Real-Time Operating System and is developed at System-Software Lab in the Chungnam National University, Replublic of Korea.

I did port FP(Foundtaion Profile) to UbiFOS.

I executed a "HelloWorld" example of FP successfully.

Presently, I try to port PBP(Personal Basis Profile) to UbiFOS.

A problem happened while I try to port PBP to UbiFOS.

CVM could load following classes.

"Java_java_lang_ClassLoader_loadBootstrapClass0" function could load following classes, but it could not load "java/lang/ClassLoader".
=> basis/DemoFrame
java/awt/Frame
java/lang/Throwable
java/lang/String
java/lang/Object
java/awt/Container
java/awt/event/WindowListener
java/lang/NumberFormatException
java/lang/Exception
java/util/ArrayList
java/lang/Integer
java/lang/System
java/lang/StringBuffer
java/io/PrintStreamjava/awt/Dimension
java/awt/Toolkit
basis/Builder
java/awt/Component
java/awt/LayoutManager
basis/Builder$Status
basis/DemoButton
basis/DemoButtonListener
basis/demos/Demo
basis/Builder$1
java/lang/Class
java/awt/CardLayout
java/awt/Color
java/awt/BorderLayout
java/awt/GridLayout
java/awt/Font
java/awt/Graphics
java/awt/FontMetrics
java/util/EventObject
basis/demos/GraphicsDemo
basis/demos/ColorDemo
java/awt/event/MouseListener
java/awt/event/MouseMotionListener
basis/demos/DrawDemo
basis/demos/ImageDemo
java/awt/event/MouseEvent
java/awt/SystemColor
java/awt/image/ImageObserver
java/awt/Image
java/awt/image/BufferedImage
java/awt/Composite
java/lang/InterruptedException
java/awt/GraphicsEnvironment
java/awt/GraphicsDevice
java/awt/GraphicsConfiguration
java/lang/Thread
java/awt/Graphics2D
java/awt/AlphaComposite
java/awt/MediaTracker
--------------------------------------------------

I compiled CVM with romzied classes.

I don't execute basis.DemoFrame with following exception

[Error Message]
java.lang.NullPointerException
at java.lang.String.startsWith(Ljava/lang/String;I)Z(Unknown Source)
at java.lang.String.startsWith(Ljava/lang/String;)Z(Unknown Source)
at java.io.UnixFileSystem.canonicalize(Ljava/lang/String;)Ljava/lang/String;(Unknown Source)
at java.io.File.getCanonicalPath()Ljava/lang/String;(Unknown Source)
at java.io.File.getCanonicalFile()Ljava/io/File;(Unknown Source)
at sun.misc.Launcher.getFileURL(Ljava/io/File;)Ljava/net/URL;(Unknown Source)
at sun.misc.Launcher.pathToURLs([Ljava/io/File;)[Ljava/net/URL;(Unknown Source)
at sun.misc.Launcher.access$300([Ljava/io/File;)[Ljava/net/URL;(Unknown Source)
at sun.misc.Launcher$5.run()Ljava/lang/Object;(Unknown Source)
at java.security.AccessController.doPrivileged(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;)Ljava/lang/Object;(Unknown Source)
at java.security.AccessController.doPrivileged(Ljava/security/PrivilegedAction;)Ljava/lang/Object;(Unknown Source)
at sun.misc.Launcher.getBootstrapClassPath0()Lsun/misc/URLClassPath;(Unknown Source)
at sun.misc.Launcher.getBootstrapClassPath()Lsun/misc/URLClassPath;(Unknown Source)
at java.lang.ClassLoader.getBootstrapClassPath()Lsun/misc/URLClassPath;(Unknown Source)
at java.lang.ClassLoader.getBootstrapResource(Ljava/lang/String;)Ljava/net/URL;(Unknown Source)
at java.lang.ClassLoader.getResource(Ljava/lang/String;)Ljava/net/URL;(Unknown Source)
at java.lang.ClassLoader.getResource(Ljava/lang/String;)Ljava/net/URL;(Unknown Source)
at basis.demos.ImageDemo.loadImage(Ljava/awt/Component;Ljava/lang/String;)Ljava/awt/Image;(Unknown Source)
at basis.demos.ImageDemo.()V(Unknown Source)
at basis.demos.GraphicsDemo.()V(Unknown Source)
at java.lang.reflect.Constructor.newInstance([Ljava/lang/Object;)Ljava/lang/Object;(Unknown Source)
at java.lang.Class.newInstance()Ljava/lang/Object;(Unknown Source)
at basis.Builder.build(Ljava/awt/Container;)V(Unknown Source)
at basis.DemoFrame.(Ljava/util/ArrayList;Ljava/awt/Dimension;)V(Unknown Source)
at basis.DemoFrame.main([Ljava/lang/String;)V(Unknown Source)
at java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;(Unknown Source)
at sun.misc.CVM.runMain()V(Unknown Source)

I try to resolve a problem, but I don't find a cause of problem. ã… ã… 

Pleas help me!
Thanks!

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
cjplummer
Offline
Joined: 2006-10-16
Points: 0

java.lang.ClassLoader is always romized/preloaded, even if you build with CVM_PRELOAD_LIB=false. This is also true of quite a large number of other CDC classes that must be romized in order to build and run CDC. I don't understand why you say it can't be loaded when it is already preloaded. Can you explain the error you are seeing that indicates it was not loaded.

As for the java.lang.NullPointerException, I suggest you take a closer look at the methods in the backtrace and start debugging them. java.io.UnixFileSystem is a class you have to port, so maybe you made a mistake here. It would be easier to debug if you build with CVM_DEBUG=true.

good luck,

Chris