Hi all,

The immediate error logs when trying to login to the carbon console with
the Redis session manager in place as explained above is as follows.

2017-05-12 10:40:16,916]  INFO - StartupFinalizerServiceComponent WSO2
Carbon started in 78 sec
[2017-05-12 10:40:17,213]  INFO - CarbonUIServiceComponent Mgt Console URL
 : https://172.17.0.1:9443/carbon/
[2017-05-12 10:40:17,213]  INFO - CarbonUIServiceComponent API Publisher
Default Context : https://172.17.0.1:9443/publisher
[2017-05-12 10:40:17,213]  INFO - CarbonUIServiceComponent API Store
Default Context : https://172.17.0.1:9443/store
[2017-05-12 10:40:52,616] ERROR - RedisSessionManager
org.wso2.carbon.ui.MenuAdminClient
[2017-05-12 10:40:55,685]  INFO - CarbonAuthenticationUtil
'[email protected] [-1234]' logged in at [2017-05-12 10:40:55,685+0530]
[2017-05-12 10:41:09,524] ERROR - RedisSessionManager
org.wso2.carbon.registry.core.session.UserRegistry
[2017-05-12 10:41:09,588] ERROR - RedisSessionManager
org.wso2.carbon.ui.MenuAdminClient

The attached log appears sometime after the server is working.

Thanks & Regards

On Fri, May 12, 2017 at 6:05 AM, Chamara Philips <[email protected]>
wrote:

> Thanks a lot KasunG and Thusitha.
>
> As you said, I tried to register the RedisSessionManager under the
> management element in the repository/conf/tomcat/context.xml. Then the
> manager seems to be applied only to the webapps.
>
> Then as Thusitha has mentioned, I registered the RedisSessionManager under
> the management element in repository/conf/tomcat/carbon/META-INF/context.xml.
> Note that I didn't register the Valve in that, since the valve in
> repository/conf/tomcat/context.xml seems to be applied globally. With
> this configuration, the session manager started working for carbon console.
> There were logs in the redis-cli, with the session id. Also the user
> authenticated log is there in the WSO2Server console. But the user didn't
> login to the carbon console. The final logs are attached below.
>
> What may be the root cause for this?
>
> Thanks & Regards
>
> On Thu, May 11, 2017 at 8:31 AM, KasunG Gajasinghe <[email protected]>
> wrote:
>
>>
>> You need to register the RedisSessionManager under the manager element
>> [1].
>>
>> If you are extending the CarbonTomcat valve, the valve registration needs
>> to happen by registering a instance as an OSGi service. In that case, you
>> don't have to add it to catalina-server.xml/context.xml. But, you can
>> extend tomcat BaseValve and register it via catalina-server.xml with exact
>> same result.
>>
>> [1] https://tomcat.apache.org/tomcat-7.0-doc/config/manager.html
>>
>> On Mon, May 8, 2017 at 8:32 PM, Chamara Philips <[email protected]
>> > wrote:
>>
>>> Hi all,
>>>
>>> We were able to cluster the store and publisher without using
>>> StickySessions in load balancers. We have used 
>>> CarbonTomcatSessionReplicationValve
>>> as mentioned in this article
>>> <https://docs.wso2.com/display/CLUSTER44x/Enabling+HTTP+Session+Replication>.
>>> We would like to know the concerns using this approach to jaggeryapps.
>>> (publisher, store)
>>>
>>> Still, couldn't resolve the problem with the approach using the Redis
>>> server [2]
>>> <https://discuss.pivotal.io/hc/en-us/articles/206085337-How-to-setup-Redis-Session-Manager-on-tcServer-Tomcat>.
>>> I tried to implement the Valve extending the CarbonTomcatValve.
>>>
>>> Can't we register the Valves extended by CarbonTomcatValve in the
>>> context.xml. I got the following erro
>>> <https://gist.github.com/ChamaraPhilipsuom/b9ba527a5607dd83f20c8be06c3336b8>r
>>> when I tried to do that.
>>>
>>> ERROR {org.apache.tomcat.util.digester.Digester} -  Begin event threw
>>> exception {org.apache.tomcat.util.digester.Digester}
>>> java.lang.ClassNotFoundException: com.orangefunction.tomcat.redi
>>> ssessions.RedisSessionHandlerValve cannot be found by
>>> org.wso2.carbon.tomcat_4.4.11
>>>
>>> What may be the root cause for this?
>>>
>>> When I extended the RedisSessionHandlerValve from BaseValve the server
>>> starts successfully. (Note I have registered the Valve and Manager using
>>> context.xml ) For all the webapps, RedisSessionManagers are successfully
>>> set in  RedisSessionHandlerValve.  But when I try to log in from carbon
>>> console, the RedisSessionManager is not set in the RedisSessionHandlerValve
>>> as expected. I am a bit unclear about the lifecycle of Managers and Valves
>>> in the CarbonTomcat. How can we start the life cycle of the
>>> RedisSessionManager for the carbon console?
>>>
>>> [1] https://docs.wso2.com/display/CLUSTER44x/Enabling+HTTP+Sessi
>>> on+Replication
>>> [2] https://discuss.pivotal.io/hc/en-us/articles/206085337-H
>>> ow-to-setup-Redis-Session-Manager-on-tcServer-Tomcat
>>> [3] https://gist.github.com/ChamaraPhilipsuom/b9ba527a5607dd
>>> 83f20c8be06c3336b8
>>>
>>> Thanks & Regards
>>>
>>> On Fri, May 5, 2017 at 5:08 PM, Chamara Philips <
>>> [email protected]> wrote:
>>>
>>>> Hi Kasun,
>>>>
>>>> What about login to the carbon management console? It throws the same
>>>> error.
>>>>
>>>> Thanks & Regards
>>>>
>>>> On Fri, May 5, 2017 at 4:56 PM, KasunG Gajasinghe <[email protected]>
>>>> wrote:
>>>>
>>>>>
>>>>> I don't think jaggeryapps were tested for session replication. Usually
>>>>> what we do is enabling sticky sessions in the reverse proxy that fronts 
>>>>> the
>>>>> APIM store nodes.
>>>>>
>>>>> On Fri, May 5, 2017 at 4:47 PM, Chamara Philips <
>>>>> [email protected]> wrote:
>>>>>
>>>>>> Hi all,
>>>>>>
>>>>>> I tried to replicate sessions for API manager store cluster. I tried
>>>>>> it with Redis[1]
>>>>>> <https://discuss.pivotal.io/hc/en-us/articles/206085337-How-to-setup-Redis-Session-Manager-on-tcServer-Tomcat>and
>>>>>> Hazelcast [2]
>>>>>> <https://hazelcast.com/use-cases/web-session-clustering/tomcat-web-session-replication/>
>>>>>> .
>>>>>>
>>>>>> In the first approach, I am using a valve, which I configured in the
>>>>>> context.xml. The valve successfully got registered. But when I tried to
>>>>>> login to the store it threw this error[3]
>>>>>> <https://gist.github.com/ChamaraPhilipsuom/a02e09824544b0cb59bd9d0b8bdb10a0>
>>>>>> .
>>>>>>
>>>>>> This happens because the "manager" [4]
>>>>>> <https://github.com/rmohr/tomcat-redis-session-manager/blob/2.0-tomcat-7/src/main/java/com/orangefunction/tomcat/redissessions/RedisSessionHandlerValve.java#L28>
>>>>>> is null. But here in the RedisSessionManager [5]
>>>>>> <https://github.com/rmohr/tomcat-redis-session-manager/blob/2.0-tomcat-7/src/main/java/com/orangefunction/tomcat/redissessions/RedisSessionManager.java#L279>
>>>>>>  it
>>>>>> should be assigned in the startInternal. What may be the cause for this? 
>>>>>> Do
>>>>>> valves get created after the initialization of SessionManager?
>>>>>>
>>>>>> Is there any known implementation for one of above two approaches?
>>>>>> (or any other implementation.)
>>>>>>
>>>>>> [1] https://discuss.pivotal.io/hc/en-us/articles/206085337-H
>>>>>> ow-to-setup-Redis-Session-Manager-on-tcServer-Tomcat
>>>>>> [2] https://hazelcast.com/use-cases/web-session-clustering/t
>>>>>> omcat-web-session-replication/
>>>>>> [3] https://gist.github.com/ChamaraPhilipsuom/a02e09824544b0
>>>>>> cb59bd9d0b8bdb10a0
>>>>>> [4] https://github.com/rmohr/tomcat-redis-session-manager/bl
>>>>>> ob/2.0-tomcat-7/src/main/java/com/orangefunction/tomcat/redi
>>>>>> ssessions/RedisSessionHandlerValve.java#L28
>>>>>> [5] https://github.com/rmohr/tomcat-redis-session-manager/bl
>>>>>> ob/2.0-tomcat-7/src/main/java/com/orangefunction/tomcat/redi
>>>>>> ssessions/RedisSessionManager.java#L279
>>>>>>
>>>>>> Thanks & Regards
>>>>>> --
>>>>>> --
>>>>>> Hareendra Chamara (BSc.Eng(Hons))
>>>>>> Sysco acceleration,
>>>>>> SyscoLabs(Pvt) Ltd
>>>>>> Mobile : +94 (0) 767 184161 <94767184161> | +65 (9) 425 2874
>>>>>> <6594252874>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>>
>>>>> *Kasun Gajasinghe*Associate Technical Lead, WSO2 Inc.
>>>>> email: kasung AT spamfree wso2.com
>>>>> linked-in: http://lk.linkedin.com/in/gajasinghe
>>>>> blog: http://kasunbg.org
>>>>> phone: +1 650-745-4499 <(650)%20745-4499>, 77 678 0813
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> --
>>>> Hareendra Chamara (BSc.Eng(Hons))
>>>> Sysco acceleration,
>>>> SyscoLabs(Pvt) Ltd
>>>> Mobile : +94 (0) 767 184161 <94767184161> | +65 (9) 425 2874
>>>> <6594252874>
>>>>
>>>
>>>
>>>
>>> --
>>> --
>>> Hareendra Chamara (BSc.Eng(Hons))
>>> Sysco acceleration,
>>> SyscoLabs(Pvt) Ltd
>>> Mobile : +94 (0) 767 184161 <94767184161> | +65 (9) 425 2874
>>> <6594252874>
>>>
>>
>>
>>
>> --
>>
>> *Kasun Gajasinghe*Associate Technical Lead, WSO2 Inc.
>> email: kasung AT spamfree wso2.com
>> linked-in: http://lk.linkedin.com/in/gajasinghe
>> blog: http://kasunbg.org
>> phone: +1 650-745-4499 <(650)%20745-4499>, 77 678 0813
>>
>>
>
>
>
> --
> --
> Hareendra Chamara (BSc.Eng(Hons))
> Sysco acceleration,
> SyscoLabs(Pvt) Ltd
> Mobile : +94 (0) 767 184161 <94767184161> | +65 (9) 425 2874 <6594252874>
>



-- 
-- 
Hareendra Chamara Philips (BSc.Eng(Hons))
Sysco acceleration,
SyscoLabs(Pvt) Ltd
Mobile : +94 (0) 767 184161 <94767184161> | +65 (9) 425 2874 <6594252874>
TID: [-1234] [] [2017-05-09 12:06:04,695]  INFO 
{org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -  
'[email protected] [-1234]' logged in at [2017-05-09 12:06:04,695+0530] 
{org.wso2.carbon.core.services.util.CarbonAuthenticationUtil}
TID: [-1234] [] [2017-05-09 12:06:04,736] ERROR 
{org.thorins.tomcat.redissessions.RedisSessionManager} -  
org.wso2.carbon.registry.core.session.UserRegistry 
{org.thorins.tomcat.redissessions.RedisSessionManager}
TID: [-1234] [] [2017-05-09 12:06:04,781]  WARN 
{org.wso2.carbon.server.admin.module.handler.AuthenticationHandler} -  Illegal 
access attempt at [2017-05-09 12:06:04,0781] from IP address 127.0.0.1 while 
trying to authenticate access to service LoggedUserInfoAdmin 
{org.wso2.carbon.server.admin.module.handler.AuthenticationHandler}
TID: [-1234] [] [2017-05-09 12:06:04,792]  INFO 
{org.apache.axis2.transport.http.HTTPSender} -  Unable to sendViaPost to 
url[https://localhost:9443/services/LoggedUserInfoAdmin] 
{org.apache.axis2.transport.http.HTTPSender}
org.apache.axis2.AxisFault: Transport error: 401 Error: Unauthorized
        at 
org.apache.axis2.transport.http.HTTPSender.handleResponse(HTTPSender.java:326)
        at 
org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:196)
        at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:77)
        at 
org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:451)
        at 
org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:278)
        at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
        at 
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:430)
        at 
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:225)
        at 
org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
        at 
org.wso2.carbon.core.commons.stub.loggeduserinfo.LoggedUserInfoAdminStub.getUserInfo(LoggedUserInfoAdminStub.java:187)
        at 
org.wso2.carbon.apimgt.impl.utils.APIUtil.getLoggedInUserInfo(APIUtil.java:2294)
        at 
org.wso2.carbon.apimgt.hostobjects.APIStoreHostObject.jsFunction_login(APIStoreHostObject.java:682)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
        at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:386)
        at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:42)
        at 
org.jaggeryjs.rhino.store.modules.user.c1._c_anonymous_1(/store/modules/user/login.jag:19)
        at 
org.jaggeryjs.rhino.store.modules.user.c1.call(/store/modules/user/login.jag)
        at 
org.mozilla.javascript.ScriptRuntime.applyOrCall(ScriptRuntime.java:2430)
        at org.mozilla.javascript.BaseFunction.execIdCall(BaseFunction.java:269)
        at 
org.mozilla.javascript.IdFunctionObject.call(IdFunctionObject.java:97)
        at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:42)
        at 
org.jaggeryjs.rhino.store.modules.user.c0._c_anonymous_5(/store/modules/user/module.jag:21)
        at 
org.jaggeryjs.rhino.store.modules.user.c0.call(/store/modules/user/module.jag)
        at org.mozilla.javascript.optimizer.OptRuntime.callN(OptRuntime.java:52)
        at 
org.jaggeryjs.rhino.store.site.blocks.user.login.ajax.c0._c_anonymous_1(/store/site/blocks/user/login/ajax/login.jag:93)
        at 
org.jaggeryjs.rhino.store.site.blocks.user.login.ajax.c0.call(/store/site/blocks/user/login/ajax/login.jag)
        at org.mozilla.javascript.optimizer.OptRuntime.call0(OptRuntime.java:23)
        at 
org.jaggeryjs.rhino.store.site.blocks.user.login.ajax.c0._c_script_0(/store/site/blocks/user/login/ajax/login.jag:4)
        at 
org.jaggeryjs.rhino.store.site.blocks.user.login.ajax.c0.call(/store/site/blocks/user/login/ajax/login.jag)
        at 
org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:394)
        at 
org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3091)
        at 
org.jaggeryjs.rhino.store.site.blocks.user.login.ajax.c0.call(/store/site/blocks/user/login/ajax/login.jag)
        at 
org.jaggeryjs.rhino.store.site.blocks.user.login.ajax.c0.exec(/store/site/blocks/user/login/ajax/login.jag)
        at 
org.jaggeryjs.scriptengine.engine.RhinoEngine.execScript(RhinoEngine.java:567)
        at 
org.jaggeryjs.scriptengine.engine.RhinoEngine.exec(RhinoEngine.java:273)
        at 
org.jaggeryjs.jaggery.core.manager.WebAppManager.exec(WebAppManager.java:588)
        at 
org.jaggeryjs.jaggery.core.manager.WebAppManager.execute(WebAppManager.java:508)
        at 
org.jaggeryjs.jaggery.core.JaggeryServlet.doPost(JaggeryServlet.java:29)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
        at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
        at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at 
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:747)
        at 
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:485)
        at 
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:377)
        at 
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:337)
        at 
org.jaggeryjs.jaggery.core.JaggeryFilter.doFilter(JaggeryFilter.java:21)
        at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at 
org.wso2.carbon.ui.filters.cache.ContentTypeBasedCachePreventionFilter.doFilter(ContentTypeBasedCachePreventionFilter.java:53)
        at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at 
org.apache.catalina.filters.HttpHeaderSecurityFilter.doFilter(HttpHeaderSecurityFilter.java:120)
        at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:218)
        at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
        at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
        at 
org.thorins.tomcat.redissessions.RedisSessionHandlerValve.invoke(RedisSessionHandlerValve.java:26)
        at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
        at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
        at 
org.wso2.carbon.tomcat.ext.valves.CompositeValve.continueInvocation(CompositeValve.java:99)
        at 
org.wso2.carbon.tomcat.ext.valves.CarbonTomcatValve$1.invoke(CarbonTomcatValve.java:47)
        at 
org.wso2.carbon.webapp.mgt.TenantLazyLoaderValve.invoke(TenantLazyLoaderValve.java:57)
        at 
org.wso2.carbon.event.receiver.core.internal.tenantmgt.TenantLazyLoaderValve.invoke(TenantLazyLoaderValve.java:48)
        at 
org.wso2.carbon.tomcat.ext.valves.TomcatValveContainer.invokeValves(TomcatValveContainer.java:47)
        at 
org.wso2.carbon.tomcat.ext.valves.CompositeValve.invoke(CompositeValve.java:62)
        at 
org.wso2.carbon.tomcat.ext.valves.CarbonStuckThreadDetectionValve.invoke(CarbonStuckThreadDetectionValve.java:159)
        at 
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:958)
        at 
org.wso2.carbon.tomcat.ext.valves.CarbonContextCreatorValve.invoke(CarbonContextCreatorValve.java:57)
        at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
        at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:452)
        at 
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1087)
        at 
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
        at 
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1756)
        at 
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1715)
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at 
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:745)
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to