fbaligand / lognavigator

Navigate into your logs with the comfort of a web interface
Apache License 2.0
28 stars 5 forks source link

No bean named 'springSecurityFilterChain' is defined on WebSphere 7.0 #9

Closed saquibsayyad closed 5 years ago

saquibsayyad commented 5 years ago

We are getting "No bean named 'springSecurityFilterChain' is defined" while deploying LogNavigator on WebSphere 7.0. Although the same works on Tomcat 6.

WebSphere 7.0 Java 1.6

Please check below stack trace.

[17/12/18 11:28:10:736 AST] 00000025 SystemOut     O ERROR - org.lognavigator.mvc.LogNavigatorHandlerExceptionResolver - Error when calling web action
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'springSecurityFilterChain' is defined
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:698)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1174)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:283)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:201)
        at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1054)
        at org.springframework.web.filter.DelegatingFilterProxy.initDelegate(DelegatingFilterProxy.java:326)
        at org.springframework.web.filter.DelegatingFilterProxy.initFilterBean(DelegatingFilterProxy.java:235)
        at org.springframework.web.filter.GenericFilterBean.init(GenericFilterBean.java:199)
        at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.init(FilterInstanceWrapper.java:142)
        at com.ibm.ws.webcontainer.filter.WebAppFilterManager._loadFilter(WebAppFilterManager.java:548)
        at com.ibm.ws.webcontainer.filter.WebAppFilterManager.loadFilter(WebAppFilterManager.java:462)
        at com.ibm.ws.webcontainer.filter.WebAppFilterManager.getFilterInstanceWrapper(WebAppFilterManager.java:319)
        at com.ibm.ws.webcontainer.filter.WebAppFilterManager.getFilterChain(WebAppFilterManager.java:379)
        at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:860)
        at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:965)
        at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:508)
        at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:181)
        at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3994)
        at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:276)
        at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:945)
        at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1592)
        at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:191)
        at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:454)
        at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:516)
        at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:307)
        at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:278)
        at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
        at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
        at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
        at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
        at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
        at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
        at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
        at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
        at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
        at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1662)
fbaligand commented 5 years ago

Hi, this seems to be a generic Spring Security incompatibility problem, not related precisely to LogNavigator itself. If you know a workaround (in web.xml config, spring version or anywhere else), tell me and I will try to fix it.

saquibsayyad commented 5 years ago

Thanks, I just removed the spring security configurations as it is deployed on an internal server, It works fine now.

I will check this later if got time.

Thanks for your effort, it will help our developers to easily access the logs without doing SSH.

fbaligand commented 5 years ago

I just made some searches on Google, and this blog is interesting : https://www.baeldung.com/no-bean-named-springsecurityfilterchain-is-defined

It seems that this config is not considered:

<context-param>
        <param-name>spring.profiles.default</param-name>
        <param-value>security-disabled</param-value>
</context-param>

To avoid to modify war content, an option is to set this java system property or JNDI environment entry at websphere startup: spring.profiles.active=security-disabled

fbaligand commented 5 years ago

And happy to see that LogNavigator helps your team!