On Dec 5, 2007, at 2:50 PM, Pierce T. Wetter III wrote:
I'd guess that it is a problem with NSBundle finding the classes
in it. Try logging out the various things that NSBundle will tell
you. And do that before the above code and see if just calling
those methods makes a difference. Calling NSBundle.mainBundle()
might be enough. I recall having to call NSBundle.allBundles() in
some long ago version before that method was deprecated.
Yeah, I'm already calling and logging those results based on code
you posted:
And the values look reasonable. I did play with the classpath such
that the framework(s) I'm trying to debug/test loaded first, but
that didn't help.
Its very weird that my local code can find the classes but
_NSUtilties._classWithFullySpecifiedName(uent.className()) can't
because they both end up calling java.lang.Class.forName(Class.java):
So the only thing I can think is that its running into some
security issue via java.security.AccessController where it can't
make the class from inside WebObjects.
In desperation, you could try WOApplication.primeApplication()
NSLog.out.appendln("Verified class " + Class.forName(uent.className
()));
NSLog.out.appendln("Verified2 class " +
uent._concreteClassForDeferredFault());
NSLog.out.appendln("My class loader " + this.getClass
().getClassLoader());
NSLog.out.appendln("NSUtilities loader " +
_NSUtilities._CLASS.getClassLoader());
outputs this:
Verified class class com.paceap.businesslogic.server.User
[2007-12-05 15:48:22 MST] <main> Class
'com.paceap.businesslogic.server.User' not found for Entity 'User',
using EOGenericRecord instead
Verified2 class class com.webobjects.eocontrol.EOGenericRecord
My class loader sun.misc.Launcher$AppClassLoader@e39a3e
NSUtilities loader sun.misc.Launcher$ExtClassLoader@98dfaf
So NSUtilities is using sun.misc.Launcher$ExtClassLoader instead of
sun.misc.Launcher$AppClassLoader.
Now how to I fix that I wonder...
That would be the Java Extensions class loader, I think. Do you have
TestNG or something else that might be affecting this in /Library/
Java/Extensions?