Re: Upgrading to Latest Wonder + DirectAction NoClassDefFoundError
Re: Upgrading to Latest Wonder + DirectAction NoClassDefFoundError
- Subject: Re: Upgrading to Latest Wonder + DirectAction NoClassDefFoundError
- From: Q <email@hidden>
- Date: Thu, 30 Jun 2011 23:52:48 +1000
This is a filesystem induced issue. It happens when you use a case insensitive filesystem and try to dynamically load a class with the correct name, but the wrong case. It shouldn't be an issue in production as the classes will be bundled in jar files. This isn't specific to WO or Wonder, it can happen to any java application that loads classes dynamically from a case insensitive filesystem.
On 30/06/2011, at 3:16 PM, George Domurot wrote:
> I upgraded to the latest Wonder Git repo this past weekend. And, an interesting situation occurs when hitting a URL that has a typo in the action class or method names.
>
> For example:
>
> .../wa/person ... attempts to load a model Person object, results in NoClassDefFoundError
>
> triggered at this point:
>
> at com.webobjects.appserver.WOApplication.dispatchRequest(WOApplication.java:1687)
> at er.extensions.appserver.ERXApplication.dispatchRequestImmediately(ERXApplication.java:1984)
>
> However,
>
> .../wa/Person ... is ignored as expected, since I suppose it finds the Person class and opts to ignore it since it's of no use/wrong type.
>
> The same error occurs if you attempt to load:
>
> ../wa/directAction/doSomething ... since DirectAction exists
>
> Jun 29 22:01:54 App[57419] WARN NSLog - <WOWorkerThread id=3 socket=null> Throwable occurred: java.lang.NoClassDefFoundError: com/domain/app/directAction (wrong name: com/domain/app/DirectAction)
> [2011-6-29 22:1:54 PDT] <WorkerThread3> java.lang.NoClassDefFoundError: com/domain/app/directAction (wrong name: com/domain/app/DirectAction)
> at java.lang.ClassLoader.defineClass1(Native Method)
> at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
> at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
> at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
> at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
> at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
> at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Class.java:169)
> at com.webobjects.foundation._NSUtilities._searchForClassInPackages(_NSUtilities.java:415)
> at com.webobjects.foundation._NSUtilities._classWithPartialName(_NSUtilities.java:373)
> at com.webobjects.foundation._NSUtilities.classWithName(_NSUtilities.java:335)
> at com.webobjects.appserver._private.WOBundle.lookForClassInAllBundles(WOBundle.java:92)
> at com.webobjects.appserver._private.WOActionRequestHandler._actionClassForName(WOActionRequestHandler.java:70)
> at com.webobjects.appserver._private.WOActionRequestHandler.getRequestActionClassAndNameForPath(WOActionRequestHandler.java:389)
> at com.webobjects.appserver._private.WOActionRequestHandler._handleRequest(WOActionRequestHandler.java:226)
> 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.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)
>
> Interesting too, none of the standard Application level exception handling methods get called for a graceful response.
>
> I noticed a related post by Pascal last year without a noted solution:
> http://wiki.objectstyle.org/confluence/display/WOL/mail/6717622
>
> Any known fixes?
>
> Thanks,
> George _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden