Error: class java.util.ArrayList cannot be cast to class java.util.LinkedHashMap

1,449 views
Skip to first unread message

Marvie Rosal

unread,
Sep 25, 2022, 11:48:43 PM9/25/22
to OWASP ZAP User Group
I get an error running on our CI/CD pipeline:
Unexpected error accessing file /zap/wrk/zap.yaml : class java.util.ArrayList cannot be cast to class java.util.LinkedHashMap (java.util.ArrayList and java.util.LinkedHashMap are in module java.base of loader 'bootstrap') - see log for details

I have the following yaml file:
env:
contexts:
- name: "our test env"
urls:
- "https://something something"
includePaths:
- "https://something something/*"
excludePaths: []
sessionManagement:
method: "https"
parameters: []
parameters:
failOnError: false
failOnWarning: true
progressToStdout: true
vars: []

Simon Bennetts

unread,
Sep 26, 2022, 3:35:05 AM9/26/22
to OWASP ZAP User Group
Why have you got spaces in the 'urls' and 'includePaths' ?
Spaces are not valid in URLs - take them out :)

Cheers,

Simon

Marvie Rosal

unread,
Sep 27, 2022, 1:37:39 AM9/27/22
to OWASP ZAP User Group
Haha. I have proper URL but just didn't include it for security purposes :)
It actually worked now with the following:
env:
contexts:
- name: "our test env"
urls:
includePaths:
excludePaths: []
sessionManagement:
method: "http"
parameters: {}
users:
- name: "admin"
username: "${EMAIL_PASSED_FROM_CI_VAR}"
password: "${PASSWORD_PASSED_FROM_CI_VAR}"
parameters:
failOnError: false
failOnWarning: true
progressToStdout: true
vars: {}

Simon Bennetts

unread,
Sep 27, 2022, 3:16:59 AM9/27/22
to OWASP ZAP User Group
Good to know its now working.
Do you know what the problem was?

Marvie Rosal

unread,
Sep 27, 2022, 8:52:15 PM9/27/22
to OWASP ZAP User Group
The ones that I changed were changing from bracket to curly bracket for the following:
parameters: {}
vars: {}

Simon Bennetts

unread,
Sep 28, 2022, 3:45:06 AM9/28/22
to OWASP ZAP User Group
Thanks for letting us know.
The code does try to detect such yaml problems and report them in a useful way but clearly if failed to do that here.

Cheers,

Simon
Reply all
Reply to author
Forward
0 new messages