XLRelease AccessControlException


So, I’m sure something got changed, but I haven’t been able to track it down due to not knowing quite where to look.

I ran into the following error during a patching event on all of my Jython tasks:

Exception during execution: org.springframework.cglib.core.CodeGenerationException: org.springframework.cglib.core.CodeGenerationException: java.security.AccessControlException-->access denied ("java.lang.RuntimePermission" "defineClass") in <script> at line number 2

This came from the following script:

SN_INSTANCES = {'oclc': 'ServiceNow Prod', 'oclcdev': 'ServiceNow Dev', 'oclctest': 'ServiceNow Test'}
servicenow_servers = configurationApi.searchByTypeAndTitle("servicenow.Server", SN_INSTANCES[releaseVariables['sn_instance']])
for p in release.phases:
    for t in p.tasks:
        if str(t.getTaskType()).split('.')[0] == 'servicenow':
            temp_task = taskApi.getTask(t.id)
            temp_task.pythonScript.setProperty("servicenowServer", servicenow_servers[0])
            taskApi.updateTask(temp_task.id, temp_task)

Also, this is shown as an error when I try to look at the individual task, and I get a 500 server error with the message:


Can anyone let me know what it may be referencing?


Hi smacz,

It looks like you need to specify a permission for “defineClass” in script.policy. Check this out - https://docs.xebialabs.com/v.9.0/xl-release/how-to/create-a-jython-script-task/#security-and-jython-script-tasks


1 Like

That was indeed the issue. Thanks for chiming in.