java.lang.UnsupportedOperationException: Refusing to marshal org.codehaus.groovy.runtime.GStringImpl for security reasons

213 views
Skip to first unread message

Peter Berghold

unread,
Dec 5, 2017, 4:24:14 PM12/5/17
to Jenkins Users
what on earth does that message mean? 

Here is the code this seems to be happening to:

class Notifications implements Serializable {
    def context
    def dataBlocks
    def mailLists
    def workspace
    
    // emailext body: 'my email body', subject: 'email subject', to: 'te...@test.dev', replyTo: 'te...@test.dev', mimeType: 'text/html';  
    Notifications(ctx,workspace){
        context=ctx;
        dataBlocks = new Data(context,workspace)
        mailLists = this.loadJSON('data/email-lists.json')
        
    }
    def loadJSON(fname){
        def retval
        context.dir(workspace){
            retval = jsonParse(context.readFile(fname)) 
        }
        return retval
    }
------------8< snip 8<-----------------------------------------

in particular in the loading of the JSON file.  

It is laid out as 
{
    "list1" :: [
            "member1" ...etc.
     ]


thoughts?

Ramanathan Muthaiah

unread,
Dec 6, 2017, 6:53:19 AM12/6/17
to Jenkins Users
I guess this kind of operation is not whitelisted to run in the Groovy sandbox.

Did you try using this step to read JSON accessible in your workspace ?


/Ram
Reply all
Reply to author
Forward
0 new messages