Hello,

I am running a CAS server with a client, and they work flawlessly for 
sometime (2-24 hours). Then after this time, if I try to access an api 
which needs authorization, I get redirected to the CAS login page, and 
after logging in succesfully, I get this error (ERROR CommonUtils:442 - 
Connection refused: connect). If I access the server /cas/login it logs me 
in successfully, and if I access an api that doesn't need authorization it 
loads properly, any idea where the problem might be? Another thing I 
noticed is that I need to restart the server(not just the tomcat instance) 
for it to work again. Below is the log from Tomcat server after logging in, 
any help would be highly appreciated,


2017-03-29 08:06:58,201 INFO 
[org.jasig.cas.authentication.PolicyBasedAuthenticationManager] - 
<SearchModeSearchDatabaseAuthenticationHandler successfully authenticated 
login6+password>
2017-03-29 08:06:58,201 INFO 
[org.jasig.cas.authentication.PolicyBasedAuthenticationManager] - 
<Authenticated login6 with credentials [login6+password].>
2017-03-29 08:06:58,201 INFO 
[com.github.inspektr.audit.support.Slf4jLoggingAuditTrailManager] - <Audit 
trail record BEGIN
=============================================================
WHO: audit:unknown
WHAT: supplied credentials: [login6+password]
ACTION: AUTHENTICATION_SUCCESS
APPLICATION: CAS
WHEN: Wed Mar 29 08:06:58 AST 2017
CLIENT IP ADDRESS: xxx
SERVER IP ADDRESS: xxx
=============================================================

>
2017-03-29 08:06:58,201 INFO 
[com.github.inspektr.audit.support.Slf4jLoggingAuditTrailManager] - <Audit 
trail record BEGIN
=============================================================
WHO: audit:unknown
WHAT: TGT-4-x7IbardTYKthV1AfuerGtTfLloP7jPSpXjOWnA95iliS7Ccg3d-SERVER_NAME
ACTION: TICKET_GRANTING_TICKET_CREATED
APPLICATION: CAS
WHEN: Wed Mar 29 08:06:58 AST 2017
CLIENT IP ADDRESS: xxx
SERVER IP ADDRESS: xxx
=============================================================

>
2017-03-29 08:06:58,217 INFO 
[org.jasig.cas.CentralAuthenticationServiceImpl] - <Granted service ticket 
[ST-2-BLQdym1GcpwNfDSrn6fr-SERVER_NAME] for service [SERVER_NAME/login/cas] 
for user [login6]>
2017-03-29 08:06:58,217 INFO 
[com.github.inspektr.audit.support.Slf4jLoggingAuditTrailManager] - <Audit 
trail record BEGIN
=============================================================
WHO: login6
WHAT: ST-2-BLQdym1GcpwNfDSrn6fr-SERVER_NAME for SERVER_NAME/login/cas
ACTION: SERVICE_TICKET_CREATED
APPLICATION: CAS
WHEN: Wed Mar 29 08:06:58 AST 2017
CLIENT IP ADDRESS: xxx
SERVER IP ADDRESS: xxx
=============================================================

>
2017-03-29 08:06:59 ERROR CommonUtils:442 - Connection refused: connect
java.net.ConnectException: Connection refused: connect
        at java.net.DualStackPlainSocketImpl.connect0(Native Method)
        at 
java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)
        at 
java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
        at 
java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
        at 
java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
        at java.net.Socket.connect(Socket.java:589)
        at java.net.Socket.connect(Socket.java:538)
        at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
        at sun.net.www.http.HttpClient.<init>(HttpClient.java:211)
        at sun.net.www.http.HttpClient.New(HttpClient.java:308)
        at sun.net.www.http.HttpClient.New(HttpClient.java:326)
        at 
sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1202)
        at 
sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1138)
        at 
sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1032)
        at 
sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:966)
        at 
sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1546)
        at 
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474)
        at 
org.jasig.cas.client.util.CommonUtils.getResponseFromServer(CommonUtils.java:429)
        at 
org.jasig.cas.client.validation.AbstractCasProtocolUrlBasedTicketValidator.retrieveResponseFromServer(AbstractCasProtocolUrlBasedTicketValidator.java:41)
        at 
org.jasig.cas.client.validation.AbstractUrlBasedTicketValidator.validate(AbstractUrlBasedTicketValidator.java:193)
        at 
org.springframework.security.cas.authentication.CasAuthenticationProvider.authenticateNow(CasAuthenticationProvider.java:158)
        at 
org.springframework.security.cas.authentication.CasAuthenticationProvider.authenticate(CasAuthenticationProvider.java:143)
        at 
org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:174)
        at 
org.springframework.security.cas.web.CasAuthenticationFilter.attemptAuthentication(CasAuthenticationFilter.java:270)
        at 
org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:212)
        at 
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at 
org.jasig.cas.client.session.SingleSignOutFilter.doFilter(SingleSignOutFilter.java:97)
        at 
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at 
org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:121)
        at 
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at 
org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:121)
        at 
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at 
org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:66)
        at 
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at 
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at 
org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56)
        at 
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at 
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at 
org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105)
        at 
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at 
org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:214)
        at 
org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:177)
        at 
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
        at 
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
        at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
        at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
        at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
        at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
        at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:474)
        at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
        at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
        at 
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624)
        at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
        at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)
        at 
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:783)
        at 
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
        at 
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:745)
        at 
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1437)
        at 
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
        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)

-- 


هذه الرسالة ومرفقاتها (إن وجدت) تمثل وثيقة سرية قد تحتوي على معلومات تتمتع 
بحماية وحصانة قانونية. إذا لم تكن الشخص المعني بهذه الرسالة يجب عليك تنبيه 
المُرسل بخطأ وصولها إليك، وحذف الرسالة ومرفقاتها (إن وجدت) من الحاسب الآلي 
الخاص بك. ولا يجوز لك نسخ هذه الرسالة أو مرفقاتها (إن وجدت) أو أي جزء منها، 
أو البوح بمحتوياتها لأي شخص أو استعمالها لأي غرض. علماً بأن الإفادات 
والآراء التي تحويها هذه الرسالة تعبر فقط عن رأي المُرسل وليس بالضرورة رأي 
مؤسسة المعامل المستقلة، ولا تتحمل المؤسسة أي مسؤولية عن الأضرار الناتجة عن 
أي ملفات ضارة أو فيروسات قد يحملها هذا البريد.

This e-mail message may contain confidential or legally privileged 
information and is intended only for the use of the intended recipient(s). 
Any unauthorized disclosure, dissemination, distribution, copying or the 
taking of any action in reliance on the information herein is prohibited. 
E-mails are not secure and cannot be guaranteed to be error free as they 
can be intercepted, amended, or contain viruses. Anyone who communicates 
with us by e-mail is deemed to have accepted these risks. indieLabs is not 
responsible for errors or omissions in this message and denies any 
responsibility for any damage arising from the use of e-mail. Any opinion 
and other statement contained in this message and any attachment are solely 
those of the author and do not necessarily represent those of indieLabs.

-- 
- CAS gitter chatroom: https://gitter.im/apereo/cas
- CAS mailing list guidelines: https://apereo.github.io/cas/Mailing-Lists.html
- CAS documentation website: https://apereo.github.io/cas
- CAS project website: https://github.com/apereo/cas
--- 
You received this message because you are subscribed to the Google Groups "CAS 
Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/a/apereo.org/d/msgid/cas-user/17ca51ad-cc75-4eaa-b9e1-ede98859ad28%40apereo.org.

Reply via email to