small medium large xlarge

Back to: All Forums  Grails
Generic-user-small
01 Jan 2010, 15:49
Tommy Baggett (4 posts)

Happy new year all!

I’m working my way through “Grails: A Quick-Start Guide” and have run into a problem. After completing section 11.2, “The Twitter Plug-in”, I get a compilation error dealing with the Twitter and JSON additions. Here is the console output:

Welcome to Grails 1.1.1 - http://grails.org/
Licensed under Apache Standard License 2.0
Grails home is set to: /Users/TBaggett/springsource/grails-1.1.1/

Base Directory: /Users/TBaggett/Workspaces/Grails/TekDays
Running script /Users/TBaggett/springsource/grails-1.1.1/scripts/RunApp.groovy
Environment set to development
     [copy] Copied 6 empty directories to 3 empty directories under /Users/TBaggett/.grails/1.1.1/projects/TekDays/resources
  [groovyc] Compiling 6 source files to /Users/TBaggett/.grails/1.1.1/projects/TekDays/classes
  [groovyc] org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, Compile error during compilation with javac.
  [groovyc] /Users/TBaggett/.grails/1.1.1/projects/TekDays/plugins/twitter-0.2/src/java/winterwell/jtwitter/Twitter.java:30: cannot access org.json.JSONArray
  [groovyc] bad class file: /Users/TBaggett/.grails/1.1.1/projects/TekDays/plugins/twitter-0.2/lib/json-112808.jar(org/json/JSONArray.class)
  [groovyc] class file has wrong version 50.0, should be 49.0
  [groovyc] Please remove or make sure it appears in the correct subdirectory of the classpath.
  [groovyc] import org.json.JSONArray;

Any thoughts on what I need to do to fix this?

Thanks in advance,

Tommy

Dklein_tiny_pragsmall
03 Jan 2010, 22:30
Dave Klein (34 posts)

Well, I just ran it again with Grails 1.1.1 and with the Twitter plugin 0.2 and it worked fine. Have you tried running grails clean from within your project directory? If that doesn’t help, then you might try deleting the .grails/1.1.1/projects/TekDays directory.

Post back if you’re still having trouble and I’ll dig into it further.

Thanks, Dave

Generic-user-small
08 Jan 2010, 00:16
Tommy Baggett (4 posts)

Hey Dave,

Thanks for looking into it. It was still occurring for me even after running a grails clean and deleting the directory you mentioned. I even tried removing the twitter plugin and reinstalling, still with no luck.

Fortunately, I found the answer on the twitter plugin page at http://www.grails.org/plugin/twitter:

“The current release (0.2) of the plugin ships with a jar that was built using JDK6. If you’re using JDK5 please replace plugins/twitter-0.2/lib/json-112808.jar with the fixed version found here. This was unintentional - there’s no JDK6-specific code - and will be fixed in the next release.”

And thanks for a fantastic book on Grails, btw! It’s a great introduction and all around good read.

Blessings,

Tommy

Dklein_tiny_pragsmall
09 Jan 2010, 19:27
Dave Klein (34 posts)

Hi Tommy,

I’m glad you figured it out and thanks for posting back. I’m sure this will be helpful for others as well.

Thank you also for the kind words.

Dave

You must be logged in to comment