peter tong

Ranch Hand
+ Follow
since Mar 15, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by peter tong

My project is a multi-module project as follow:







In eclipse, there is always an error about


but  hk.housingauthority.slis:SLIS:war:0.0.1-SNAPSHOT  is exist really in eclipse workspace and .m2 folder, so why still have this error?







2 weeks ago
In JBOSS 8 logging subsystem Filter Expressions
https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.4/html/configuration_guide/logging_with_jboss_eap#tuning_logging_subsystem

1) for the match["pattern"], is if match["pattern"] return true, then the log message will be shown, if false, the log message will not be shown?
2)

Filter checking is always done on a raw unformatted message.


for the meaning of raw unformatted message, is this include the stack trace?
3) If I want to exclude an specific exception type, how to do this using filter expression?
5 months ago
From the documentation

The Simple Logging Facade for Java (SLF4J) serves as a simple facade or abstraction for various logging frameworks (e.g. java.util.logging, logback, log4j) allowing the end user to plug in the desired logging framework at deployment time.



Given the source code


and the following pom.xml



How to know which logging framework is really used?
I see only artifactId slf4j-jobss-logging has no scope = compile, so in runtime, it should be using slf4j-jboss-logging?

But then I google and see JBoss Logging is also just a "logging bridge"
https://docs.jboss.org/hibernate/orm/4.3/topical/html/logging/Logging.html

And in this site has following

JBoss Logging understands the following back-ends as first-class citizens:

JBoss LogManager (mainly used only inside the WildFly app server)

Log4j 2

Log4j 1

Slf4j

JDK logging



And in my log, I see the logger class has more than one class as

"loggerClassName":"org.apache.commons.logging.impl.JBossLog"
"loggerClassName":"org.slf4j.impl.Slf4jLogger"
"loggerClassName":"io.undertow.UndertowLogger_$logger"



So what is the real logging implementation is using?






peter tong wrote:Example, I have a string
openshift.cluster_id:20bd0f2c-0d96-4c9a-b730-b4db9de53ce4

I want to use regular expression to find another string start with "openshift.cluster_id:" but not follow the pattern "20bd0f2c-0d96-4c9a-b730-b4db9de53ce4", how to do this?



I found this regular expression, using Negative lookahead, fulfill my criteria:


openshift.cluster_id:20bd0f2c-0d96-4c9a-b730-b4db9de53ce4 not find any match
openshift.cluster_id:02bd0f2c-0d96-4c9a-b730-b4db9de53ce4 find a match
openshift.cluster_id:120bd0f2c-0d96-4c9a-b730-b4db9de53ce4 find a match

Another similar example
find a string match "abc", but then not follow "def"
use regex:


abcdef => not find any match
abcedf => find a match
abcfde => find a match
abcdefa => not find any match
abcadef => find a match

Detail can be seen in this link
https://www.regular-expressions.info/lookaround.html
about negative lookahead
5 months ago
Example, I have a string
openshift.cluster_id:20bd0f2c-0d96-4c9a-b730-b4db9de53ce4

I want to use regular expression to find another string start with "openshift.cluster_id:" but not follow the pattern "20bd0f2c-0d96-4c9a-b730-b4db9de53ce4", how to do this?

5 months ago
Yes, it is due to csrf setting. As in Spring documentation

https://docs.spring.io/spring-security/site/docs/5.0.x/reference/html/csrf.html

Spring Security’s CSRF protection will produce an HTTP 403 access denied. This can be customized by configuring the AccessDeniedHandler to process InvalidCsrfTokenException differently.

As of Spring Security 4.0, CSRF protection is enabled by default with XML configuration. If you would like to disable CSRF protection, the corresponding XML configuration can be seen below.
<http>
<!-- ... -->
<csrf disabled="true"/>
</http>



Hope this answer can help other wit similar problem.
6 months ago
sorry, the request should be something like


not something like


and finally I found that if I add


inside <http> tag, the problem is gone, but the exactly reason is still unknown.
6 months ago

Himai Minh wrote:Does this article help:
https://www.baeldung.com/security-none-filters-none-access-permitAll ?

Section 5 of the article says this:

Also note that, if an <http> element doesn’t specify a pattern, then by default, that maps to the universal match pattern – “/**” – so again, this element
needs to be last. If the order of the elements is not correct, the creation of the security filter chain will fail:



No, it is intentional to set


at the first line for testing, then means it should paermit all request url, but still it cannot match the incoming url withunknown reason.
6 months ago


My spring-security.xml http tag is defined as follow


then for the following request:


it prompt

No mapping for POST /SLIS/error/abc
No endpoint POST /SLIS/error/abc.



why the http


fail to match the request

?


6 months ago
I think I may solve the problem finally.
From the stacktrace

Bean with name 'librarySectionService' has been injected into other beans [wordService] in its raw version as part of a circular reference, but has eventually been wrapped



I check the source code fo LibrarySectionService and WordService
LibrarySectionService.java



WordService.java


so there is circular reference, and I change the LibrarySectionService Class as follow:



then the error is disappeared.


6 months ago

Himai Minh wrote:Do these discussions help:

https://stackoverflow.com/questions/78043622/no-bean-named-mvchandlermappingintrospector-and-springsecurityfilterchain-av

https://github.com/spring-projects/spring-security/issues/12319

https://github.com/spring-projects/spring-security/issues/14636

https://github.com/spring-projects/spring-security/issues/12319#issuecomment-1338377623



the Quoted link is too difficult for me to understand and it use annotation based configuration,  I try to simulate spring document web.xml and do the following
Origin


Changed to


That is, I put the DispatcherServlet config xml (/WEB-INF/applicationContext-slis-servlet.xml) from <servlet><init-param> to <context-param>
I don't know if this equivalent to spring mentioned
https://docs.spring.io/spring-security/reference/servlet/integrations/mvc.html
<!-- All Spring Configuration (both MVC and Security) are in /WEB-INF/spring/ -->


Anyway, after this change, I see another error message, I don't know if these error is due to my change put the DispatcherServlet config xml (/WEB-INF/applicationContext-slis-servlet.xml) from <servlet><init-param> to <context-param>)
The error stacktrace is

ERROR [org.springframework.web.context.ContextLoader] (ServerService Thread Pool -- 116) Context initialization failed: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'adminCorrectionController': Unsatisfied dependency expressed through field 'publishService': Error creating bean with name 'publishService': Unsatisfied dependency expressed through field 'librarySectionService': Error creating bean with name 'librarySectionService': Bean with name 'librarySectionService' has been injected into other beans [wordService] in its raw version as part of a circular reference, but has eventually been wrapped. This means that said other beans do not use the final version of the bean. This is often the result of over-eager type matching - consider using 'getBeanNamesForType' with the 'allowEagerInit' flag turned off, for example.
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:787)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:767)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:145)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:508)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1421)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:599)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:337)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:335)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:975)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:962)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:624)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:394)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:274)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:102)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//hk.housingauthority.slis.web.SLISContextListener.contextInitialized(SLISContextListener.java:57)
at io.undertow.servlet@2.3.6.Final//io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:187)
at io.undertow.servlet@2.3.6.Final//io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:219)
at io.undertow.servlet@2.3.6.Final//io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:187)
at io.undertow.servlet@2.3.6.Final//io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42)
at io.undertow.servlet@2.3.6.Final//io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
at org.wildfly.extension.undertow@28.0.1.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1430)
at org.wildfly.extension.undertow@28.0.1.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1430)
at org.wildfly.extension.undertow@28.0.1.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1430)
at org.wildfly.extension.undertow@28.0.1.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1430)
at io.undertow.servlet@2.3.6.Final//io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:255)
at org.wildfly.extension.undertow@28.0.1.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:105)
at org.wildfly.extension.undertow@28.0.1.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:87)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.jboss.threads@2.4.0.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990)
at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
at java.base/java.lang.Thread.run(Thread.java:842)
at org.jboss.threads@2.4.0.Final//org.jboss.threads.JBossThread.run(JBossThread.java:513)
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'publishService': Unsatisfied dependency expressed through field 'librarySectionService': Error creating bean with name 'librarySectionService': Bean with name 'librarySectionService' has been injected into other beans [wordService] in its raw version as part of a circular reference, but has eventually been wrapped. This means that said other beans do not use the final version of the bean. This is often the result of over-eager type matching - consider using 'getBeanNamesForType' with the 'allowEagerInit' flag turned off, for example.
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:787)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:767)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:145)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:508)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1421)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:599)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:337)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:335)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1443)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1353)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:784)
... 37 more


The stacktrace is too long to post here, so I skip some middle stacktrace, and the final part is


WFLYCTL0186:   Services which failed to start:      service jboss.deployment.subunit."SLISEAR-0.0.1-SNAPSHOT.ear"."SLIS-0.0.1-SNAPSHOT.war".undertow-deployment: java.lang.RuntimeException: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'adminCorrectionController': Unsatisfied dependency expressed through field 'publishService': Error creating bean with name 'publishService': Unsatisfied dependency expressed through field 'librarySectionService': Error creating bean with name 'librarySectionService': Bean with name 'librarySectionService' has been injected into other beans [wordService] in its raw version as part of a circular reference, but has eventually been wrapped. This means that said other beans do not use the final version of the bean. This is often the result of over-eager type matching - consider using 'getBeanNamesForType' with the 'allowEagerInit' flag turned off, for example.
WFLYCTL0448: 2 additional services are down due to their dependencies being missing or failed



1)Are these error caused by my change to put the DispatcherServlet config xml (/WEB-INF/applicationContext-slis-servlet.xml) from <servlet><init-param> to <context-param>)?
2)How to solve it now?
3) And even strange, if I change the context param-value from
 
to

<param-value>/WEB-INF/*.xml</param-value

>

The error message is completely different. Although inside WEB-INF folder is just the above 4 xml (/WEB-INF/applicationContext-root.xml, /WEB-INF/applicationContext-slis-security.xml, /WEB-INF/applicationContext-slis.xml, /WEB-INF/applicationContext-slis-servlet.xml) plus web.xml
 
6 months ago
for the error message in stacktrace

Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'mvcHandlerMappingIntrospector' available: A Bean named mvcHandlerMappingIntrospector of type org.springframework.web.servlet.handler.HandlerMappingIntrospector is required to use MvcRequestMatcher. Please ensure Spring Security & Spring MVC are configured in a shared ApplicationContext."}}



I feel this related to the following
https://docs.spring.io/spring-security/reference/servlet/integrations/mvc.html
Spring MVC Integration > To use MvcRequestMatcher, you must place the Spring Security Configuration in the same ApplicationContext as your DispatcherServlet.
but I cannot understand what the doucment said, the document web.xml is as follow



My web.xml is as follow:



the SLISContextListener extends org.springframework.web.context.ContextLoaderListener
for my project, all my spring configuration are also in web-inf/
6 months ago
I checked that I have org.springframework.web.servlet.handler.HandlerMappingIntrospector. this can be seen in eclipse > maven dependencies also.




6 months ago

Stephan van Hulst wrote:I think you're missing a dependency on spring-security-doc.



I google but does not find spring-security-doc, my current spring-security related jar is as follow:



The complete stacktrace is too long to post here, I try to save as attachment but this site not allow to attach with extension .txt
the last part of stacktrace is as follow:

   Caused by: java.lang.RuntimeException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.filterChains': Cannot resolve reference to bean 'org.springframework.security.web.DefaultSecurityFilterChain#0' while setting bean property 'sourceList' with key [0]
   Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.filterChains': Cannot resolve reference to bean 'org.springframework.security.web.DefaultSecurityFilterChain#0' while setting bean property 'sourceList' with key [0]
   Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.web.DefaultSecurityFilterChain#0': Cannot resolve reference to bean 'org.springframework.security.web.access.intercept.AuthorizationFilter#0' while setting constructor argument with key [18]
   Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.web.access.intercept.AuthorizationFilter#0': Cannot resolve reference to bean 'org.springframework.security.config.http.AuthorizationFilterParser$RequestMatcherDelegatingAuthorizationManagerFactory#0' while setting constructor argument
   Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.config.http.AuthorizationFilterParser$RequestMatcherDelegatingAuthorizationManagerFactory#0': Cannot create inner bean '(inner bean)#198389c8' of type [org.springframework.security.web.servlet.util.matcher.MvcRequestMatcher] while setting bean property 'requestMatcherMap'
   Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#198389c8': Cannot create inner bean '(inner bean)#62116021' of type [org.springframework.security.config.http.HandlerMappingIntrospectorFactoryBean] while setting constructor argument
   Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#62116021': FactoryBean threw exception on object creation
   Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'mvcHandlerMappingIntrospector' available: A Bean named mvcHandlerMappingIntrospector of type org.springframework.web.servlet.handler.HandlerMappingIntrospector is required to use MvcRequestMatcher. Please ensure Spring Security & Spring MVC are configured in a shared ApplicationContext."}}
17:24:53,240 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 47) WFLYSRV0010: Deployed "SLISEAR-0.0.1-SNAPSHOT.ear" (runtime-name : "SLISEAR-0.0.1-SNAPSHOT.ear")
17:24:53,248 INFO  [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
WFLYCTL0186:   Services which failed to start:      service jboss.deployment.subunit."SLISEAR-0.0.1-SNAPSHOT.ear"."SLIS-0.0.1-SNAPSHOT.war".undertow-deployment: java.lang.RuntimeException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.filterChains': Cannot resolve reference to bean 'org.springframework.security.web.DefaultSecurityFilterChain#0' while setting bean property 'sourceList' with key [0]
WFLYCTL0448: 2 additional services are down due to their dependencies being missing or failed






6 months ago
My application use spring security 6.2.4 and spring core 6.1.7 as follow:






When start wildfly 28 server, a long stacktrace is prompted as follow:


17:24:52,605 INFO  [org.hibernate.engine.transaction.jta.platform.internal.JtaPlatformInitiator] (ServerService Thread Pool -- 89) HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.WildFlyStandAloneJtaPlatform]
17:24:53,100 WARN  [org.springframework.web.context.support.XmlWebApplicationContext] (ServerService Thread Pool -- 89) Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.filterChains': Cannot resolve reference to bean 'org.springframework.security.web.DefaultSecurityFilterChain#0' while setting bean property 'sourceList' with key [0]
17:24:53,105 ERROR [org.springframework.web.context.ContextLoader] (ServerService Thread Pool -- 89) Context initialization failed: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.filterChains': Cannot resolve reference to bean 'org.springframework.security.web.DefaultSecurityFilterChain#0' while setting bean property 'sourceList' with key [0]
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:377)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:135)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:460)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:191)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1687)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1436)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:599)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:337)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:335)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:969)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:962)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:624)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:394)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:274)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:102)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//hk.housingauthority.slis.web.SLISContextListener.contextInitialized(SLISContextListener.java:57)
at io.undertow.servlet@2.3.6.Final//io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:187)
at io.undertow.servlet@2.3.6.Final//io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:219)
at io.undertow.servlet@2.3.6.Final//io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:187)
at io.undertow.servlet@2.3.6.Final//io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42)
at io.undertow.servlet@2.3.6.Final//io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
at org.wildfly.extension.undertow@28.0.1.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1430)
at org.wildfly.extension.undertow@28.0.1.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1430)
at org.wildfly.extension.undertow@28.0.1.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1430)
at org.wildfly.extension.undertow@28.0.1.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1430)
at io.undertow.servlet@2.3.6.Final//io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:255)
at org.wildfly.extension.undertow@28.0.1.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:105)
at org.wildfly.extension.undertow@28.0.1.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:87)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.jboss.threads@2.4.0.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990)
at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
at java.base/java.lang.Thread.run(Thread.java:842)
at org.jboss.threads@2.4.0.Final//org.jboss.threads.JBossThread.run(JBossThread.java:513)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.web.DefaultSecurityFilterChain#0': Cannot resolve reference to bean 'org.springframework.security.web.access.intercept.AuthorizationFilter#0' while setting constructor argument with key [18]
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:377)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:135)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:460)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:191)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:682)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:203)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1357)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1194)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:562)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:337)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:335)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:365)
... 38 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.web.access.intercept.AuthorizationFilter#0': Cannot resolve reference to bean 'org.springframework.security.config.http.AuthorizationFilterParser$RequestMatcherDelegatingAuthorizationManagerFactory#0' while setting constructor argument
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:377)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:135)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:682)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:203)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1357)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1194)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:562)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:337)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:335)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:365)
... 52 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.config.http.AuthorizationFilterParser$RequestMatcherDelegatingAuthorizationManagerFactory#0': Cannot create inner bean '(inner bean)#198389c8' of type [org.springframework.security.web.servlet.util.matcher.MvcRequestMatcher] while setting bean property 'requestMatcherMap'
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBeanValue(BeanDefinitionValueResolver.java:421)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.BeanDefinitionValueResolver.lambda$resolveValueIfNecessary$1(BeanDefinitionValueResolver.java:153)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:262)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:152)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.BeanDefinitionValueResolver.lambda$resolveManagedMap$3(BeanDefinitionValueResolver.java:484)
at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:721)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedMap(BeanDefinitionValueResolver.java:483)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:199)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1687)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1436)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:599)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:337)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:335)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:365)
... 64 more

........



What is the problem?
6 months ago