I've been refactoring/modernizing a rather large app that has had the model as part of the application. I've split out the Model, the model classes and a bunch of supporting classes that are required by the model classes into a new Wonder Framework project.
I've gotten everything to compile correctly in both the new framework project and the original application in eclipse, but when I the application it in eclipse, the app fails stating that it can't initialize the model files. (see stack trace below)
I know that this is almost certainly a classpath issue, but the Framework is added to the build path just as the Wonder and WebObjects frameworks are. The framework only exists as source code in the Eclipse workspace, and I have tried it with bundles enabled, and disabled and I get the exact same results.
Why would an app not be able to find classes at runtime, when it can find them in the source code? It's got to be something incredibly simple that I'm just overlooking.
com.webobjects.foundation.NSForwardException [java.lang.NoClassDefFoundError] Could not initialize class com.mycompany.ac.model.GlobalLU:java.lang.NoClassDefFoundError: Could not initialize class com.mycompany.ac.model.GlobalLU
at com.webobjects.foundation.NSForwardException._runtimeExceptionForThrowable(NSForwardException.java:43)
at com.webobjects.foundation.NSKeyValueCoding$_MethodBinding.valueInObject(NSKeyValueCoding.java:1140)
at com.webobjects.foundation.NSKeyValueCoding$DefaultImplementation.valueForKey(NSKeyValueCoding.java:1324)
at com.webobjects.appserver.WOApplication.valueForKey(WOApplication.java:5575)
at com.webobjects.foundation.NSKeyValueCoding$Utility.valueForKey(NSKeyValueCoding.java:447)
at com.webobjects.foundation.NSKeyValueCodingAdditions$DefaultImplementation.valueForKeyPath(NSKeyValueCodingAdditions.java:216)
at com.webobjects.appserver.WOApplication.valueForKeyPath(WOApplication.java:5645)
at com.webobjects.foundation.NSKeyValueCodingAdditions$Utility.valueForKeyPath(NSKeyValueCodingAdditions.java:149)
at com.webobjects.foundation.NSKeyValueCodingAdditions$DefaultImplementation.valueForKeyPath(NSKeyValueCodingAdditions.java:217)
at com.webobjects.appserver.WOComponent.valueForKeyPath(WOComponent.java:1804)
at com.webobjects.appserver._private.WOKeyValueAssociation.valueInComponent(WOKeyValueAssociation.java:50)
at er.extensions.components._private.ERXWOString.appendToResponse(ERXWOString.java:70)
at com.webobjects.appserver._private.WODynamicGroup.appendChildrenToResponse(WODynamicGroup.java:126)
at com.webobjects.appserver._private.WODynamicGroup.appendToResponse(WODynamicGroup.java:136)
at com.webobjects.appserver.WOComponent.appendToResponse(WOComponent.java:1122)
at com.webobjects.appserver.WOComponent._appendPageToResponse(WOComponent.java:1574)
at com.webobjects.appserver.WOComponent._generateResponseInContext(WOComponent.java:1543)
at com.webobjects.appserver.WOComponent.generateResponse(WOComponent.java:1538)
at com.webobjects.appserver._private.WOActionRequestHandler._handleRequest(WOActionRequestHandler.java:278)
at com.webobjects.appserver._private.WOActionRequestHandler.handleRequest(WOActionRequestHandler.java:158)
at er.extensions.appserver.ERXDirectActionRequestHandler.handleRequest(ERXDirectActionRequestHandler.java:124)
at com.webobjects.appserver.WOApplication.dispatchRequest(WOApplication.java:1687)
at er.extensions.appserver.ERXApplication.dispatchRequestImmediately(ERXApplication.java:1984)
at er.extensions.appserver.ERXApplication.dispatchRequest(ERXApplication.java:1949)
at com.mycompany.ac.Application.dispatchRequest(Application.java:178)
at com.webobjects.appserver._private.WOWorkerThread.runOnce(WOWorkerThread.java:144)
at com.webobjects.appserver._private.WOWorkerThread.run(WOWorkerThread.java:226)
at java.lang.Thread.run(Thread.java:680)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.mycompany.ac.model.GlobalLU
at com.mycompany.ac.Application.currentProgram(Application.java:90)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.mycompany.ac.KeyValueCodingProtectedAccessor.methodValue(KeyValueCodingProtectedAccessor.java:35)
at com.webobjects.foundation.NSKeyValueCoding$_MethodBinding.valueInObject(NSKeyValueCoding.java:1134)
... 26 more