NFA 9.5 SSO Error

Document ID : KB000115508
Last Modified Date : 20/09/2018
Show Technical Document Details
Issue:
There is a benign error you may see in NFA 9.5 in the SSOService.log:

ERROR | qtp1661773684-25         | 2018-09-20 12:03:08,145 | com.ca.im.portal.common.web.logs.AuditLogServiceImpl            
      | Error in inserting audit log
org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Communications link failure
 
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.)
               at com.ca.im.portal.api.common.services.impl.database.PersistentDBConnection.createDataSource(PersistentDBConnection.java:179)
               at com.ca.im.portal.api.common.services.impl.database.TransientDBConnection.init(TransientDBConnection.java:65)
               at com.ca.im.portal.api.common.services.impl.database.TransientDBConnection.execute(TransientDBConnection.java:326)
               at com.ca.im.portal.common.web.logs.AuditLogServiceImpl.log(AuditLogServiceImpl.java:54)
               at com.ca.im.portal.common.web.logs.AuditLogServiceImpl.log(AuditLogServiceImpl.java:34)
               at org.apache.jsp.sign_002din_002dprocess_jsp._jspService(sign_002din_002dprocess_jsp.java:330)
               at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
               at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
               at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:443)
               at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:385)
               at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:329)
               at org.eclipse.jetty.jsp.JettyJspServlet.service(JettyJspServlet.java:112)
               at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
               at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:841)
               at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650)
               at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:206)
               at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
               at com.ca.im.portal.common.web.security.RequestFilter.doFilter(RequestFilter.java:26)
               at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1629)
               at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533)
               at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
               at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
               at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
               at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:190)
               at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
               at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
               at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)
               at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)
               at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
               at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
               at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)
               at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1155)
               at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
               at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:219)
               at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)
               at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
               at org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(RewriteHandler.java:335)
               at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
               at org.eclipse.jetty.server.Server.handle(Server.java:561)
               at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:334)
               at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
               at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
               at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:104)
               at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
               at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:247)
               at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:140)
               at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:679)
               at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:597)
               at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Communications link failure
 
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.)
               at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549)
               at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
               at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
               at com.ca.im.portal.api.common.services.impl.database.PersistentDBConnection.createDataSource(PersistentDBConnection.java:175)
               ... 48 more
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
 
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
               at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
               at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
               at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
               at java.lang.reflect.Constructor.newInstance(Unknown Source)
               at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
               at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:989)
               at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:341)
               at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2192)
               at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2225)
               at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2024)
               at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:779)
               at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
               at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
               at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
               at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
               at java.lang.reflect.Constructor.newInstance(Unknown Source)
               at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
               at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:389)
               at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:330)
               at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
               at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
               at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1556)
               at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545)
               ... 51 more
Caused by: java.net.ConnectException: Connection refused: connect
               at java.net.DualStackPlainSocketImpl.connect0(Native Method)
               at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
               at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
               at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
               at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
               at java.net.PlainSocketImpl.connect(Unknown Source)
               at java.net.SocksSocketImpl.connect(Unknown Source)
               at java.net.Socket.connect(Unknown Source)
               at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:211)
               at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:300)
               ... 67 more
 
Environment:
NFA 9.5.0
Cause:
There is an auditing part of the code that is activated via config file, which should not be. 
Resolution:
Edit the: installdir/portal/sso/webapps/sso/sign-in-process.jsp  

and find:

// Audit logging
WebApplicationContext context = WebApplicationContextUtils.getRequiredWebApplicationContext( request.getServletContext() );
AuditLogService auditLogService = (AuditLogService)context.getBean( "auditLogService" );
auditLogService.log( "Sign In", auditSubCategory, auditLogMsg ); 

Add // to the 3 lines like below:

// Audit logging
// WebApplicationContext context = WebApplicationContextUtils.getRequiredWebApplicationContext( request.getServletContext() );
// AuditLogService auditLogService = (AuditLogService)context.getBean( "auditLogService" );
// auditLogService.log( "Sign In", auditSubCategory, auditLogMsg );