Error on adding view policy

When new view policy is added, following error shows - SAXParseException: The processing instruction target matching “[xX][mM][lL]” is not allowed. (flow 2.1.3)

> org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 8; The processing instruction target matching "[xX][mM][lL]" is not allowed.
> 	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.XMLScanner.scanPIData(Unknown Source)
> 	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanPIData(Unknown Source)
> 	at org.apache.xerces.impl.XMLScanner.scanPI(Unknown Source)
> 	at org.apache.xerces.impl.XMLDocumentScannerImpl$PrologDispatcher.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:409)
> 	at java.base/java.util.Optional.map(Optional.java:260)
> 	at io.jmix.flowui.sys.ViewSupport.loadViewXml(ViewSupport.java:409)
> 	at io.jmix.flowui.sys.ViewSupport.getViewTitleValue(ViewSupport.java:436)
> 	at io.jmix.flowui.sys.ViewSupport.getLocalizedTitle(ViewSupport.java:296)
> 	at io.jmix.flowui.sys.ViewSupport.getLocalizedTitle(ViewSupport.java:247)
> 	at io.jmix.securityflowui.view.resourcepolicy.ResourcePolicyViewUtils.getViewTitle(ResourcePolicyViewUtils.java:164)
> 	at io.jmix.securityflowui.view.resourcepolicy.ResourcePolicyViewUtils.getDetailedViewTitle(ResourcePolicyViewUtils.java:153)
> 	at java.base/java.util.stream.Collectors.lambda$toMap$68(Collectors.java:1674)
> 	at java.base/java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169)
> 	at java.base/java.util.HashMap$ValueSpliterator.forEachRemaining(HashMap.java:1779)
> 	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:119)
> 	at io.jmix.securityflowui.view.resourcepolicy.ViewResourcePolicyModelCreateView.onInit(ViewResourcePolicyModelCreateView.java:55)
> 	at com.vaadin.flow.component.ComponentEventBus.fireEventForListener(ComponentEventBus.java:233)
> 	at com.vaadin.flow.component.ComponentEventBus.fireEvent(ComponentEventBus.java:222)
> 	at com.vaadin.flow.component.Component.fireEvent(Component.java:411)
> 	at com.vaadin.flow.component.ComponentUtil.fireEvent(ComponentUtil.java:416)
> 	at io.jmix.flowui.view.ViewControllerUtils.fireEvent(ViewControllerUtils.java:109)
> 	at io.jmix.flowui.sys.ViewSupport.fireViewInitEvent(ViewSupport.java:403)
> 	at io.jmix.flowui.sys.ViewSupport.initView(ViewSupport.java:121)
> 	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:95)
> 	at io.jmix.flowui.view.builder.AbstractWindowBuilder.open(AbstractWindowBuilder.java:104)
> 	at io.jmix.securityflowui.view.resourcerole.ResourceRoleModelDetailView.onResourcePoliciesTableCreateViewPolicy(ResourceRoleModelDetailView.java:289)
> 	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:557)
> 	at com.vaadin.flow.component.ComponentEventBus.fireEventForListener(ComponentEventBus.java:233)
> 	at com.vaadin.flow.component.ComponentEventBus.handleDomEvent(ComponentEventBus.java:475)
> 	at com.vaadin.flow.component.ComponentEventBus.lambda$addDomTrigger$dd1b7957$1(ComponentEventBus.java:292)
> 	at com.vaadin.flow.internal.nodefeature.ElementListenerMap.lambda$fireEvent$2(ElementListenerMap.java:447)
> 	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
> 	at com.vaadin.flow.internal.nodefeature.ElementListenerMap.fireEvent(ElementListenerMap.java:447)
> 	at com.vaadin.flow.server.communication.rpc.EventRpcHandler.handleNode(EventRpcHandler.java:62)
> 	at com.vaadin.flow.server.communication.rpc.AbstractRpcInvocationHandler.handle(AbstractRpcInvocationHandler.java:74)
> 	at com.vaadin.flow.server.communication.ServerRpcHandler.handleInvocationData(ServerRpcHandler.java:459)
> 	at com.vaadin.flow.server.communication.ServerRpcHandler.lambda$handleInvocations$2(ServerRpcHandler.java:440)
> 	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
> 	at com.vaadin.flow.server.communication.ServerRpcHandler.handleInvocations(ServerRpcHandler.java:440)
> 	at com.vaadin.flow.server.communication.ServerRpcHandler.handleRpc(ServerRpcHandler.java:323)
> 	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:1529)
> 	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:658)
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:205)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149)
> 	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:642)
> 	at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:408)
> 	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:313)
> 	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:277)
> 	at org.springframework.web.servlet.mvc.ServletForwardingController.handleRequestInternal(ServletForwardingController.java:141)
> 	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:1081)
> 	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:974)
> 	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:590)
> 	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:885)
> 	at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658)
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:205)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149)
> 	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149)
> 	at org.apache.catalina.filters.HttpHeaderSecurityFilter.doFilter(HttpHeaderSecurityFilter.java:129)
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149)
> 	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:174)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149)
> 	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.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.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:117)
> 	at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
> 	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:225)
> 	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:174)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149)
> 	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:174)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149)
> 	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:174)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149)
> 	at org.springframework.boot.web.servlet.support.ErrorPageFilter.doFilter(ErrorPageFilter.java:124)
> 	at org.springframework.boot.web.servlet.support.ErrorPageFilter$1.doFilterInternal(ErrorPageFilter.java:99)
> 	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116)
> 	at org.springframework.boot.web.servlet.support.ErrorPageFilter.doFilter(ErrorPageFilter.java:117)
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149)
> 	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:174)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149)
> 	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:482)
> 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:115)
> 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93)
> 	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:673)
> 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
> 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:340)
> 	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:391)
> 	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63)
> 	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:896)
> 	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1744)
> 	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52)
> 	at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
> 	at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
> 	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
> 	at java.base/java.lang.Thread.run(Thread.java:840)

please aDVICE

The problem was due to Inadvertent space in first line of one view xml. Corrected and now working perfectly.

1 Like