Uthaman Uthaman - 1 year ago 257
Groovy Question

Groovy @Grab generating java.lang.NoClassDefFoundError

I am attempting to get Jsoup to work on my Google App Engine experiment project with Gaelyk. I work with Grails at my day job, so figured it would be a piece of cake to start playing with Gaelyk... Not so fast...

The error happens when I include:


Project builds. But, accessing the page where I am doing the HTML scraping I get this error:


Problem accessing

Reason: org/apache/ivy/core/report/ResolveReport
Caused by: java.lang.NoClassDefFoundError: org/apache/ivy/core/report/ResolveReport
Caused by: java.lang.ClassNotFoundException: org.apache.ivy.core.report.ResolveReport
Caused by: java.lang.ClassNotFoundExeption: org.apache.ivy.core.report.ResolveReport

Not having much luck updating the
file I use with Glide to build the project.... Any ideas would be MOST appreciated!

Answer Source

As you mentioned you are using glide, put this in your build.gradle file:

plugins {
  id "com.appspot.glide-gae" version "0.9.3"

dependencies {
    compile "org.jsoup:jsoup:1.9.2" 

In your Groovlet, all you need is:

import org.jsoup.*

def doc = Jsoup.connect("http://<your-url-here>").get()

And you are back in business

Update: I have added a sample Scraper in glide-examples

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download