1

When executing the following piece of code:

def xml = new XmlSlurper().parse(url)
title = rss.chanel.title
rss.channel.item.each {
   sql.firstRow("SELECT COUNT(*) FROM news WHERE title = ? ", [it.title])
}

I get the following error:

Invalid argument value: java.io.NotSerializableException

What may cause it?

Opal
  • 81,889
  • 28
  • 189
  • 210

1 Answers1

3

The problem was that it.title was a NodeChild object.

In order to get the serializable text of this object I had to use it.title.text(). It was quite tricky since I could use print it.title successfully

  • Because for `NodeChild` `toString()` method returns its value. This is how it work in groovy and is very, very good. – Opal Sep 28 '14 at 09:22