Skip to main content

Adding classes to boot strap

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
3 replies [Last post]
jcybha
Offline
Joined: 2012-01-18

Hi,

I'm trying to port a Java SE project on OCAP RI. After adding some classes to basis.jar, several NoClassDefFoundError was resolved, but it's not working for some cases. Since CDC has no regex package, I've included it to basis.jar, but still got this:

java.lang.NoClassDefFoundError: java.util.regex.Pattern
at MyApp.Configuration.<clinit>(Configuration.java:368)
at java.lang.Class.runStaticInitializers(Class.java:1643)
at MyLauncherXlet$1.run(MyLauncherXlet.java:53)
at java.lang.Thread.run(Thread.java:715)
at java.lang.Thread.startup(Thread.java:785)

Since regex.* classes are begin with java. I cannot include them as a user-level classes. The point seems strange is adding some classes to basis.jar worked. What's the problem? Maybe there's some kind of list that contains the names of packages that will be loaded from basis.jar?

Regards,

YoungHoon Jung

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
greg80303
Offline
Joined: 2008-07-03

What you are trying to do is no allowed -- you are not allowed to extend Java. Additionally, an application written to an APIs outside of the standard Java APIs indicated by the OCAP specification is non-compliant. The whole purpose of OCAP is to provide a means to develop applications that can run on any OCAP implementation.

That aside, I understand that you might just be "tinkering" with the stack and the open source phoneME VM. I have never tried to extend the phoneME VM with new classes, but I imagine that you will have to add the source files to the VM build system and actually build a custom VM yourself.

As far as not getting debug output -- you will need to rebuild the VM with the debug flag enabled. On the PC Platform, you need to modify $OCAPROOT/target/$OCAPTC/buildrules.properties (CVM_DEBUG). Additionally, on Win32 we disable the JVM build by default. You will also need to enable the VM build by uncommenting the line -- build.jvm.exclude -- in buildrules.properties. Once the VM build is enabled, you can run "ant build.jvm" from $OCAPROOT.

G

jcybha
Offline
Joined: 2012-01-18

Thank you for the information. It is readlly helpful!

For debuging output, I've suspected CVM_DEBUG, but I assumed it has turned on since the directory name the CVM lies is Win32/Debug, not Release, lol.

For adding classes, you're right. I'm testing stuff in terms of checking feasibilities and yes, I think I'll use backporting, which certainly be a more appropriate way for doing this..

Regards,

YoungHoon Jung

jcybha
Offline
Joined: 2012-01-18

Also, I tried to print debug messages for Classing loading by giving these options, but nothing changed. Is these debug messages printed somewhere else?

VMOPT.15=-Xdebug
VMOPT.16=-Xtrace:0x000C0000