WebObjects 4.x: _BridgeClassgenInitialization Errors

This article discusses runtime exceptions that may happen when Objective-C/WebScript applications are integrated with Java frameworks for the first time.

Symptom

When you integrate a Java framework into an Objective-C/WebScript WebObjects Application you might see errors such as these when you run the application:



Solution

This error is caused by the Java bridge not being initialized. The Objective-C/WebScript application does not know there is a Java framework added to it and does not load the Java bridge Initialization code. When the application comes to the Java code it raises an exception as seen above.

Follow these steps to resolve this issue:

1. Make sure that your Java framework is of type "WebObjects Framework" instead of "Frameworks". The WebObjects framework type has support for Java.

2. In the Makefile.preamble file of your Objective-C/WebScript application uncomment the line:


3. Do a Clean Build of the application and the Java Bridge should be correctly initialized.

Published Date: Feb 20, 2012