SAXParseException In Security Resource Roles- Unknown Error on V2.3.1 through 2.4

I’m working on a project with a significant amount of collections in each view and have an error of
"SAXParseException: Element type "collection" must be followed by either attribute specifications, ">" or "/>".

I’ll include the complete error at buttom, at first I thought this was a me issue as it only appeared in a many to many relationship I was creating, but now it has appeared in our production model as well when attempting to add a “View policy” to a “Resource Role”. I’ve completed the following debugging steps and have mixed results but I cannot create any useful logs on what is happening either. Any support is appreciated as this effectively makes the entire application stack unusable if I can’t create view roles for users to use the data.

Debug Steps

  1. Cleared all gradle caches in intellij
  2. Manually deleted all caches on the local machine
  3. Created a new blank project and screen works correctly. So compared the code from both project’s library for io.jmix.security:jmix-security-flowui:2.4.0 and found no discrepancies. The dependency appears to be functioning properly.
  4. Project was originally on version 2.3.1, upgraded to 2.3.4 then to 2.4.0 (Update was planned but, this changed nothing on the error except the version numbers)
  5. Tried a different SDK, was on IBM JDK 21.0.3 am now on Amazon Coretto 21.0.2
  6. Turned logging to debug to see if I could get more information and the error remained the same

Bug Stopping Point

I have noticed that the failure happens in the same during each step of my debugging. In package org.dom4j.DocumentException.class at line 23 of “Deprecated” I get the error. Other than that I am just at a loss after 6 hours of debugging. The only thing else I can think to do it just start a new project and port the code base over to a clean template since I can’t find the error.

Thank you for any help or ideas to figure this out,
Oran

Complete Error

org.xml.sax.SAXParseException; lineNumber: 23; columnNumber: 9; Element type "collection" must be followed by either attribute specifications, ">" or "/>".
	at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
	at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
	at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
	at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
	at org.dom4j.io.SAXReader.read(SAXReader.java:494)
	at org.dom4j.io.SAXReader.read(SAXReader.java:408)
	at io.jmix.core.common.util.Dom4j.readDocument(Dom4j.java:67)
	at io.jmix.core.common.util.Dom4j.readDocument(Dom4j.java:62)
	at io.jmix.core.common.util.Dom4j.readDocument(Dom4j.java:54)
	at io.jmix.flowui.sys.ViewXmlParser.parseDescriptor(ViewXmlParser.java:52)
	at io.jmix.flowui.sys.ViewXmlLoader.createDocument(ViewXmlLoader.java:100)
	at io.jmix.flowui.sys.ViewXmlLoader.getDocument(ViewXmlLoader.java:92)
	at io.jmix.flowui.sys.ViewXmlLoader.load(ViewXmlLoader.java:72)
	at io.jmix.flowui.sys.ViewSupport.lambda$loadViewXml$9(ViewSupport.java:434)
	at java.base/java.util.Optional.map(Optional.java:260)
	at io.jmix.flowui.sys.ViewSupport.loadViewXml(ViewSupport.java:434)
	at io.jmix.flowui.sys.ViewSupport.getViewTitleValue(ViewSupport.java:461)
	at io.jmix.flowui.sys.ViewSupport.getLocalizedTitle(ViewSupport.java:321)
	at io.jmix.flowui.sys.ViewSupport.getLocalizedTitle(ViewSupport.java:272)
	at io.jmix.securityflowui.view.resourcepolicy.ResourcePolicyViewUtils.getViewTitle(ResourcePolicyViewUtils.java:170)
	at io.jmix.securityflowui.view.resourcepolicy.ResourcePolicyViewUtils.getDetailedViewTitle(ResourcePolicyViewUtils.java:159)
	at java.base/java.util.stream.Collectors.lambda$toMap$68(Collectors.java:1637)
	at java.base/java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169)
	at java.base/java.util.HashMap$ValueSpliterator.forEachRemaining(HashMap.java:1787)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
	at io.jmix.securityflowui.view.resourcepolicy.ResourcePolicyViewUtils.getViewsOptionsMap(ResourcePolicyViewUtils.java:125)
	at io.jmix.securityflowui.view.resourcepolicy.ResourcePolicyViewUtils.getViewsOptionsMap(ResourcePolicyViewUtils.java:116)
	at io.jmix.securityflowui.view.resourcepolicy.ViewResourcePolicyModelCreateView.onInit(ViewResourcePolicyModelCreateView.java:55)
	at com.vaadin.flow.component.ComponentEventBus.fireEventForListener(ComponentEventBus.java:239)
	at com.vaadin.flow.component.ComponentEventBus.fireEvent(ComponentEventBus.java:228)
	at com.vaadin.flow.component.Component.fireEvent(Component.java:411)
	at com.vaadin.flow.component.ComponentUtil.fireEvent(ComponentUtil.java:438)
	at io.jmix.flowui.view.ViewControllerUtils.fireEvent(ViewControllerUtils.java:118)
	at io.jmix.flowui.sys.ViewSupport.fireViewInitEvent(ViewSupport.java:428)
	at io.jmix.flowui.sys.ViewSupport.initView(ViewSupport.java:144)
	at io.jmix.flowui.sys.vaadin.JmixSpringInstantiator.init(JmixSpringInstantiator.java:65)
	at io.jmix.flowui.sys.vaadin.JmixSpringInstantiator.getOrCreate(JmixSpringInstantiator.java:58)
	at io.jmix.flowui.impl.ViewsImpl.createInternal(ViewsImpl.java:51)
	at io.jmix.flowui.impl.ViewsImpl.create(ViewsImpl.java:40)
	at io.jmix.flowui.impl.ViewsImpl.create(ViewsImpl.java:47)
	at io.jmix.flowui.view.builder.AbstractWindowBuilderProcessor.createView(AbstractWindowBuilderProcessor.java:55)
	at io.jmix.flowui.view.builder.WindowBuilderProcessor.build(WindowBuilderProcessor.java:44)
	at io.jmix.flowui.view.builder.AbstractWindowBuilder.build(AbstractWindowBuilder.java:113)
	at io.jmix.flowui.view.builder.AbstractWindowBuilder.open(AbstractWindowBuilder.java:122)
	at io.jmix.securityflowui.view.resourcerole.ResourceRoleModelDetailView.onResourcePoliciesTableCreateViewPolicy(ResourceRoleModelDetailView.java:299)
	at io.jmix.flowui.kit.event.EventBus.fireEvent(EventBus.java:82)
	at io.jmix.flowui.kit.action.BaseAction.actionPerform(BaseAction.java:67)
	at io.jmix.flowui.kit.component.dropdownbutton.AbstractDropdownButton$ActionItemImpl.onItemClick(AbstractDropdownButton.java:559)
	at com.vaadin.flow.component.ComponentEventBus.fireEventForListener(ComponentEventBus.java:239)
	at com.vaadin.flow.component.ComponentEventBus.handleDomEvent(ComponentEventBus.java:488)
	at com.vaadin.flow.component.ComponentEventBus.lambda$addDomTrigger$dd1b7957$1(ComponentEventBus.java:298)
	at com.vaadin.flow.internal.nodefeature.ElementListenerMap.lambda$fireEvent$2(ElementListenerMap.java:473)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
	at com.vaadin.flow.internal.nodefeature.ElementListenerMap.fireEvent(ElementListenerMap.java:473)
	at com.vaadin.flow.server.communication.rpc.EventRpcHandler.handleNode(EventRpcHandler.java:62)
	at com.vaadin.flow.server.communication.rpc.AbstractRpcInvocationHandler.handle(AbstractRpcInvocationHandler.java:73)
	at com.vaadin.flow.server.communication.ServerRpcHandler.handleInvocationData(ServerRpcHandler.java:475)
	at com.vaadin.flow.server.communication.ServerRpcHandler.lambda$handleInvocations$5(ServerRpcHandler.java:456)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
	at com.vaadin.flow.server.communication.ServerRpcHandler.handleInvocations(ServerRpcHandler.java:456)
	at com.vaadin.flow.server.communication.ServerRpcHandler.handleRpc(ServerRpcHandler.java:324)
	at com.vaadin.flow.server.communication.UidlRequestHandler.synchronizedHandleRequest(UidlRequestHandler.java:114)
	at com.vaadin.flow.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:40)
	at com.vaadin.flow.server.VaadinService.handleRequest(VaadinService.java:1584)
	at com.vaadin.flow.server.VaadinServlet.service(VaadinServlet.java:398)
	at com.vaadin.flow.spring.SpringServlet.service(SpringServlet.java:106)
	at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:614)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:195)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140)
	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:632)
	at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:408)
	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:303)
	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:267)
	at org.springframework.web.servlet.mvc.ServletForwardingController.handleRequestInternal(ServletForwardingController.java:142)
	at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:178)
	at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:51)
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1089)
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:979)
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1014)
	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:914)
	at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:547)
	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:885)
	at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:614)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:195)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140)
	at io.jmix.core.impl.logging.LogMdcFilter.doFilterInternal(LogMdcFilter.java:28)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140)
	at org.springframework.web.filter.CompositeFilter$VirtualFilterChain.doFilter(CompositeFilter.java:108)
	at org.springframework.security.web.FilterChainProxy.lambda$doFilterInternal$3(FilterChainProxy.java:231)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:365)
	at org.springframework.security.web.access.intercept.AuthorizationFilter.doFilter(AuthorizationFilter.java:100)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
	at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:126)
	at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:120)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
	at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:131)
	at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:85)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
	at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:100)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
	at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:110)
	at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:101)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
	at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:179)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
	at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
	at org.springframework.security.web.session.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:151)
	at org.springframework.security.web.session.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:129)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
	at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:227)
	at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:221)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
	at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:107)
	at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:93)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
	at org.springframework.security.web.csrf.CsrfFilter.doFilterInternal(CsrfFilter.java:117)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
	at org.springframework.web.filter.CorsFilter.doFilterInternal(CorsFilter.java:91)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
	at org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:90)
	at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:75)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
	at org.springframework.security.web.context.SecurityContextHolderFilter.doFilter(SecurityContextHolderFilter.java:82)
	at org.springframework.security.web.context.SecurityContextHolderFilter.doFilter(SecurityContextHolderFilter.java:69)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
	at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:62)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
	at org.springframework.security.web.session.DisableEncodeUrlFilter.doFilterInternal(DisableEncodeUrlFilter.java:42)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:374)
	at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:233)
	at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:191)
	at org.springframework.web.filter.CompositeFilter$VirtualFilterChain.doFilter(CompositeFilter.java:113)
	at org.springframework.web.servlet.handler.HandlerMappingIntrospector.lambda$createCacheFilter$3(HandlerMappingIntrospector.java:195)
	at org.springframework.web.filter.CompositeFilter$VirtualFilterChain.doFilter(CompositeFilter.java:113)
	at org.springframework.web.filter.CompositeFilter.doFilter(CompositeFilter.java:74)
	at org.springframework.security.config.annotation.web.configuration.WebMvcSecurityConfiguration$CompositeFilterChainProxy.doFilter(WebMvcSecurityConfiguration.java:230)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:352)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:268)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140)
	at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140)
	at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140)
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:164)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:140)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:167)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:483)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:115)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:384)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:905)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1741)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52)
	at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1190)
	at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:63)
	at java.base/java.lang.Thread.run(Thread.java:1583)

Hi

Judging by the exception, there is a typo in one of your View XML descriptor file that prevents the file from being parsed to load the view.

Try to look through all your XML descriptors and find a typo (not closing collection tag).
You can try embedded full-text search (Cmd+Shift+F/Ctrl+Shift+F) by this string: <collection>.

Best regards,
Dmitriy

Just to clarify if it wasn’t clear above. This is an error coming from a Jmix dependency for the security view creator. I have validated in the occurrences on the regular views that there are no missing closures but the problem is still persisting.

I have redownload all of the dependencies to ensure it was not a corruption in the cache and I spected the cached assets to compare them with known good assets.

Thank you,
Oran Clay

Yes, I understand that the error comes from the security add-on. The thing is that after analyzing the log, I can conclude that the ViewResourcePolicyModelCreateView view in the add-on is trying to get a list of your views by displaying their localized titles.
To calculate localized titles, a search for an XML views descriptor occurs. This descriptor contains the title attribute. And the error occurs when parsing this XML.