F43nd1r / Acrarium

A Backend for ACRA written in Kotlin using Spring Boot, Vaadin and MySQL
Apache License 2.0
196 stars 51 forks source link

Error 500 when opening bug details: Property or field 'appId' cannot be found #447

Closed johan12345 closed 1 year ago

johan12345 commented 1 year ago

Next issue after #446 is fixed: When I want to look at one of the reported bugs, I get an error 500 with the following stack trace:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bugView' defined in file [/application/BOOT-INF/classes/com/faendir/acra/ui/view/bug/BugView.class]: Failed to instantiate [com.faendir.acra.ui.view.bug.BugView]: Constructor threw exception
        [...]
        at com.faendir.acra.ui.component.grid.LayoutPersistingFilterableGrid$addOnClickNavigation$1$1.invoke(LayoutPersistingFilterableGrid.kt:76) ~[classes/:2.0.0-beta04]
        [...]
Caused by: java.lang.IllegalArgumentException: Failed to evaluate expression 'returnObject == null || hasViewPermission(returnObject.appId)'
        [...]
        at com.faendir.acra.persistence.bug.BugRepository$$SpringCGLIB$$0.find-VSoB3VY(<generated>) ~[classes/:2.0.0-beta04]
        at com.faendir.acra.ui.view.bug.BugView.<init>(BugView.kt:46) ~[classes/:2.0.0-beta04]
        [...]
Caused by: org.springframework.expression.spel.SpelEvaluationException: EL1008E: Property or field 'appId' cannot be found on object of type 'com.faendir.acra.persistence.bug.Bug' - maybe not public or not valid?
        [...]
johan12345 commented 1 year ago

similar issues (`Property or field 'appId' cannot be found) also occur on other actions, e.g. when trying to delete a version.

F43nd1r commented 1 year ago

Okay so in a past release method security wasn't working at all. It seems now it is active but not updated for current usage patterns so I guess I gotta make a bigger check

potatoru commented 1 year ago

I can report the same issue on v2.0.0-beta04.

F43nd1r commented 1 year ago

I found a great testing library (https://github.com/mvysny/karibu-testing) to replace vaadin testbench (which I had to remove in the past because I did not have access to a license anymore).

Implementing tests for all pages will take a while, but the specific issues mentioned here are tested and fixed now.