The RADi runtime library

Applets and Java Web Start
Error messages
Location of radirt.jar

The RADi runtime library (radirt.jar) consists of the RadiLoader class and its support classes.
There are three static overloaded methods to call from the constructor of exported layout classes (with, at least, the class and the RADi file to be loaded as arguments):
loadObjects(Object target, String fn)
loadObjects(Object target, String fn, boolean silent)
loadObjects(Object target, String fn, Locale locale)

Examples:
RadiLoader.loadObjects(this, "test.radi");
Makes RadiLoader process the layout definition file. The startup message, missing member declarations and missing resources will be reported via System.out. This is the method called by RADi-generated classes.
RadiLoader.loadObjects(this, "test.radi", true);
Makes RadiLoader process the layout definition file in silent mode. The startup message, missing member declarations and missing resources will not be reported.
RadiLoader.loadObjects(this, "test.radi", new Locale("fr", "CA"));
sets the default locale to french(Canada), then makes RadiLoader process the layout definition file.
Warning: Call this variant only for testing internationalization with different locales but not for a public release.

You find the complete javadoc documentation describing the runtime library at .../RADi/javadocs.

RadiLoader constructs all components, sets their properties and, via reflection, connects them to the member fields of the target class (the this argument). EventListener methods and Action methods are forwarded to the defined methods of the target class at runtime.


Applets and Java Web Start     Top of page

With unsigned applets, there are two restrictions:
Fields and methods of the exported class must be declared public (else you will see a java.security.AccessControlException. The required permission is java.lang.reflect.ReflectPermission "suppressAccessChecks").
You cannot call the RadiLoader method that specifies a locale, because an unsigned applet is not allowed to change the locale. (The required permission is: java.util.PropertyPermission "user.language", "write")

With signed applets there are no restrictions.

Because the RADi runtime does some reflection, you will have to sign all your JARs when deploying your application with Java Web Start.

Keep in mind, that the RADi runtime requires Java 1.4. Your applets need the appropriate browser plug-in and your JNLP file should define a j2se version of 1.4+.


Error messages     Top of page

The following errors will force RadiLoader to give up:
If RadiLoader could not find the layout definition (.radi) file, you will see this . Possible reasons are:
You deleted or renamed the .radi file or you moved it to directory which is not in the classpath.
If you try to run an applet, the .radi file has to be located at the applet's code base (for local testing, this is the project directory).
If you try to run a JAR file, all .radi files must be included in the JAR.
If RadiLoader detects a version conflict, you will see this . Update to the latest Radi version.
If RadiLoader could not find a custom Bean's JAR file, you will see this . Possible reasons are:
Class path settings do not include the missing JAR file.
If you try to run an applet, include the missing JAR file's name in the ARCHIVE tag and make sure that the JAR file is located at the applet's code base.
If you try to run a JAR file, the missing JAR file has to be referenced in the manifest file with the Class-Path option.
If you missed to extend an abstract inner class, you will see this . You should extend it and implement all abstract methods.

You will see this if you trigger an event (press a button, for example) which is forwarded to a non-existent method. The layout definition file and the class file are out of sync. You should reexport the class file.
Note: For missing member declarations or missing resources, the RADi runtime prints a to System.err. (You can suppress these warnings by calling RadiLoader.loadObjects() with a third argument of true.)


Location of radirt.jar     Top of page

Every exported layout class needs to find radirt.jar in the class path.
On a development machine you could put it in the lib/ext folders of your JSDK and JRE installations.
If you design applets with RADi, radirt.jar must be in the project directory (which is the applet's code base for local testing).
Packaged applications should reference radirt.jar in their manifest file.

See also:
Exporting layout classes
Internationalization
Packaging your application