Re: Fwd: COFOJA - Google Design By Contracts error with WOLips
Chuck Hill <[email protected]>
| Newsgroups | gmane.comp.web.webobjects.wonder-disc |
|---|---|
| Message-ID | <[email protected]> |
It is converting . to / like what would be done converting a package name to a path to a .class file:
> /Volumes/Data/Development/GVC/Vocabulary/Code/WebObjects/VocabularyJars/Libraries/cofoja-1.0-r139.jar
> /Volumes/Data/Development/GVC/Vocabulary/Code/WebObjects/VocabularyJars/Libraries/cofoja-1/0-r139/jar
And then converting those / to . to make the class name
> .Volumes.Data.Development.GVC.Vocabulary.Code.WebObjects.VocabularyJars.Libraries.cofoja-1.0-r139.jar
Is there more to the stack trace?
Can you find the main class for cofoja? You might try as a work around.
> -javaagent:${resource_loc:/VocabularyJars/Libraries/cofoja-1.0-r139.jar}=mail.class.Name
As to where in WOLips, the Launcher code, IIRC.
Chuck
On 2012-09-27, at 8:20 AM, David Aspinall wrote:
>
> HI
>
> I've been experimenting with a small project in Eclipse using Google's new version of Design By Contract
>
> http://code.google.com/p/cofoja/
>
> It looks really nice, placing all the contract details into Java annotations. However I have 2 issues getting it to work with WebObjects. The first is (I think) a WOLips issue and the second is an Eclipse issue.
>
> The Project is a simple one,
>
> VocabularyJars - contains the cofoja-1.0-r139.jar and asm-4.0.jar
> VocabularyCore - contains the EO's and one DBCTest class
> Vocabulary - a basic D2W admin app
>
>
> WOLips problem: when I run the application, the idea is that the Java Agent will process the annotations and inject the contract rules into the class at runtime. This still works with the debugger and everything. It's nice. The PROBLEM is that the WOLips WOApplication Run Configuration does something weird to my VM Arguments to make the class path unworkable. On the other hand if I craft a regular Java Application as a Run Configuration (for the same project) and use the same VM argument it works exactly as advertised. The VM argument is
>
> -javaagent:${resource_loc:/VocabularyJars/Libraries/cofoja-1.0-r139.jar}
>
>
> The error from launching the WOlips application is
>
> Exception in thread "main" java.lang.NoClassDefFoundError: –javaagent:/Volumes/Data/Development/GVC/Vocabulary/Code/WebObjects/VocabularyJars/Libraries/cofoja-1/0-r139/jar
> Caused by: java.lang.ClassNotFoundException: –javaagent:.Volumes.Data.Development.GVC.Vocabulary.Code.WebObjects.VocabularyJars.Libraries.cofoja-1.0-r139.jar
> at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
>
>
> However if I alter the Java Application argument to make the path wrong (just adding a char to the end of the string) like
>
> -javaagent:${resource_loc:/VocabularyJars/Libraries/cofoja-1.0-r139.jar}x
>
> I get an error
>
> Error opening zip file or JAR manifest missing : /Volumes/Data/Development/GVC/Vocabulary/Code/WebObjects/VocabularyJars/Libraries/cofoja-1.0-r139.jarx
> Error occurred during initialization of VM
> agent library failed to init: instrument
>
> Which make a lot more sense than the WOLips error and although nothing in the backtrace points specifically to WOLips .. I really think it must be in there somewhere. Does anyone have a suggestion where I could look for this. WOLips is a little hairy ..
>
> Help would be welcome
> David
>
> --
> David Aspinall
> Senior IT Consultant
> Global Village Consulting Inc.
> E: [email protected]
> P: 1-647-927-7442
>
> Global Village Consulting ranks 13th in 2012 in BIV's Top 100 Fastest Growing Companies in B.C!
>
> Global Village Consulting ranks 76th in 24th annual PROFIT 200 ranking of Canada’s Fastest-Growing Companies by PROFIT Magazine!
>
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://ad.doubleclick.net/clk;258768047;13503038;j?
> http://info.appdynamics.com/FreeJavaPerformanceDownload.html_______________________________________________
> Wonder-disc mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wonder-disc
--
Chuck Hill Senior Consultant / VP Development
Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/gvc/practical_webobjects
Global Village Consulting ranks 13th in 2012 in BIV's Top 100 Fastest Growing Companies in B.C!
Global Village Consulting ranks 76th in 24th annual PROFIT 200 ranking of Canada’s Fastest-Growing Companies by PROFIT Magazine!
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://ad.doubleclick.net/clk;258768047;13503038;j?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html