Deleted view IDs cause error during build

Hello,

Yesterday I created a view in a package, then I decided to delete it. After a while I recreated it in a different package but I was not satisfied with the naming so I deleted the new one as well and created a view with the proper name in the same package. Since then my build always fails because of this error:

Caused by: java.lang.RuntimeException: Project contains views with the same id: ‘TDAT_TravelSummaryPreview’. See ‘com.agency.travel.view.diary.TravelSummaryPreview’ and '‘com.agency.travel.view.summary.TravelSummaryPreview’

I have delete cache, run a clean build, check all the IDs, even deleted and rebuild the complete db and still get this error message. Please advise what to do to solve this id issue.

Thanks,
Peter

Hi Peter!
Thank you for contacting Jmix support.
Looks like you have two TravelSummaryPreview views with the same id. The first located in “view.diary.” and the second in “view.summary.”. The easiest way to check is to search for “TDAT_TravelSummaryPreview” in project ctrl+shift+f for IntelliJ IDEA.
Or you could attach a sample project and we will check this error.

Regards,
Sergey.

Hi Sergey,

Thanks for your quick reply. Unfortunately there is nothing left in the project regarding these Ids. I mean I cannot find any reference in any files but still when I run gradle build, it fails.

The error message starts with this:
"org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration’: Unsatisfied dependency expressed through method ‘setFilterChains’ parameter 0: Error creating bean with name ‘sec_UiSecurityFilterChain’ defined in class path resource [io/jmix/autoconfigure/securityflowui/SecurityFlowuiAutoConfiguration$DefaultFlowuiSecurityConfiguration.class]: Failed to instantiate [org.springframework.security.web.SecurityFilterChain]: Factory method ‘securityFilterChain’ threw exception with message: Project contains views with the same id:… "

I cannot send you a sample project now but in my case it happened as I wrote before.

Do you have any idea what can cause this issue?

Thanks,
Peter

What is the Jmix version?
And how did you delete the views via IDE command or via Jmix menu Delete view command (right click on view folder containing view and controller)?
Did you delete only View descriptor or View controller as well?
I tried to reproduce the error with no success.

The old view class could remain in build/classes and usually it’s enough to remove the build folder.

Hi Sergey and Konstantin,

Thanks for your help. To be honest I could not resolve this issue any way, but I could not reproduce it either. So at the end I rewrote this part of my code and recreated these views from scratch again and solved this issue in this way. This time everything worked perfectly.

Since I have not experienced anything like this before and after rewriting this code and since I cannot reproduce this issue I guess it is the best to let it go for now. If I find a way to reproduce it or have the same issue again I will contact you.

Till then please consider this issue solved.

Thanks,
Peter

1 Like