MobileFirst 7.0服务器中的运行时同步失败

时间:2015-07-16 06:54:31

标签: tomcat ibm-mobilefirst mobilefirst-server

enter image description here

在将适配器部署到worklight控制台时发现此错误。我们通过重新启动应用程序服务器(apache tomcat)来解决此问题。

与此相关的日志:

日志文件:catalina.2015-07-16.log

SEVERE: Operation to deploy adapter 'LoginHTTPAdapter' failed.
java.lang.IllegalStateException: removeAttribute: Session already invalidated
    at org.apache.catalina.session.StandardSession.removeAttribute(StandardSession.java:1373)
    at org.apache.catalina.session.StandardSession.removeAttribute(StandardSession.java:1348)
    at org.apache.catalina.session.StandardSessionFacade.removeAttribute(StandardSessionFacade.java:171)
    at com.worklight.core.auth.impl.AuthenticationContext.destroy(AuthenticationContext.java:332)
    at com.worklight.integration.model.AdapterSessionContainer.destroyAdapterSessions(AdapterSessionContainer.java:71)
    at com.worklight.integration.services.impl.AdapterManagerImpl.closeAdapterResources(AdapterManagerImpl.java:144)
    at com.worklight.integration.services.impl.AdapterManagerImpl.deployAdapter(AdapterManagerImpl.java:87)
    at com.worklight.twopc.runtime.AdapterDeployAction.commit(AdapterDeployAction.java:50)
    at com.worklight.twopc.runtime.RuntimeTransactionHandler.commit(RuntimeTransactionHandler.java:203)
    at com.worklight.core.jmx.ProjectSynchronizationBean.sync(ProjectSynchronizationBean.java:265)
    at com.worklight.core.jmx.ProjectManagementMXBeanImpl.sync(ProjectManagementMXBeanImpl.java:1045)

    *** ***

Jul 16, 2015 2:28:39 PM com.worklight.core.auth.impl.AuthenticationFilter setSyncRequired
INFO: FWLSE0273I: Set sync required to 'true' [project worklight]
Jul 16, 2015 2:28:39 PM com.worklight.core.jmx.ProjectSynchronizationBean sync
SEVERE: FWLSE0081E: Failed synchronizing application from the administration service. This prevents the application from running. The reason is There was an error during the rollback, the runtime is not in sync with the other nodes. Status CombineStatusMessage [children=[StatusMessage [severity=ERROR, message='removeAttribute: Session already invalidated', timestamp=1437028119197, detailedMessage=java.lang.IllegalStateException: removeAttribute: Session already invalidated
    at org.apache.catalina.session.StandardSession.removeAttribute(StandardSession.java:1373)
    at org.apache.catalina.session.StandardSession.removeAttribute(StandardSession.java:1348)
    at org.apache.catalina.session.StandardSessionFacade.removeAttribute(StandardSessionFacade.java:171)
    at com.worklight.core.auth.impl.AuthenticationContext.destroy(AuthenticationContext.java:332)
    at com.worklight.integration.model.AdapterSessionContainer.destroyAdapterSessions(AdapterSessionContainer.java:71)
    at com.worklight.integration.services.impl.AdapterManagerImpl.closeAdapterResources(AdapterManagerImpl.java:144)
    at com.worklight.integration.services.impl.AdapterManagerImpl.deployAdapter(AdapterManagerImpl.java:87)
    at com.worklight.twopc.runtime.AdapterDeployAction.commit(AdapterDeployAction.java:50)
    at com.worklight.twopc.runtime.RuntimeTransactionHandler.commit(RuntimeTransactionHandler.java:203)
    at com.worklight.core.jmx.ProjectSynchronizationBean.sync(ProjectSynchronizationBean.java:265)
    at com.worklight.core.jmx.ProjectManagementMXBeanImpl.sync(ProjectManagementMXBeanImpl.java:1045)

    *** ***

]], super=StatusMessage [severity=ERROR, message='Commit', timestamp=1437028119197, detailedMessage=null]]. Please restart the application server after taking the proper corrective actions. [project worklight]
OutOfSyncException [receivedTransactionDetails=com.worklight.common.type.TransactionDetails{currentTransactionId=1437028119196, previousTransactionId=1437028118819 is dbMaster=false, lastTransactionID=1437028118819]
    at com.worklight.twopc.runtime.RuntimeTransactionHandler.commit(RuntimeTransactionHandler.java:213)
    at com.worklight.core.jmx.ProjectSynchronizationBean.sync(ProjectSynchronizationBean.java:265)
    at com.worklight.core.jmx.ProjectManagementMXBeanImpl.sync(ProjectManagementMXBeanImpl.java:1045)

    *** ***

Jul 16, 2015 2:28:39 PM StatusMessage createStatusMessage
SEVERE: Synchronize operation failed.
OutOfSyncException [receivedTransactionDetails=com.worklight.common.type.TransactionDetails{currentTransactionId=1437028119196, previousTransactionId=1437028118819 is dbMaster=false, lastTransactionID=1437028118819]
    at com.worklight.twopc.runtime.RuntimeTransactionHandler.commit(RuntimeTransactionHandler.java:213)
    at com.worklight.core.jmx.ProjectSynchronizationBean.sync(ProjectSynchronizationBean.java:265)
    at com.worklight.core.jmx.ProjectManagementMXBeanImpl.sync(ProjectManagementMXBeanImpl.java:1045)

    *** ***

Jul 16, 2015 2:28:39 PM com.ibm.worklight.admin.jmx.JMXCommunicationUtil logOperationResult
SEVERE: Result: worklight: null///192.168.135.4: Runtime synchronization failed
Jul 16, 2015 2:28:39 PM com.ibm.worklight.admin.jmx.JMXCommunicationUtil logOperationResult
INFO: worklight: null///192.168.135.4: 2015-07-16T06:28:38.819Z: Preparation to deploy 'DuDuHuanBao' finished
Jul 16, 2015 2:28:39 PM com.ibm.worklight.admin.jmx.JMXCommunicationUtil logOperationResult
INFO: worklight: null///192.168.135.4: 2015-07-16T06:28:39.196Z: Preparation to deploy adapter 'LoginHTTPAdapter' finished successfully, FWLSE0103W: Procedure 'onLogout' will always require authentication when connectAs='endUser'. [project worklight]
Jul 16, 2015 2:28:39 PM com.ibm.worklight.admin.jmx.JMXCommunicationUtil logOperationResult
SEVERE: worklight: null///192.168.135.4: 2015-07-16T06:28:39.198Z: There was an error during the rollback, the runtime is not in sync with the other nodes. Status CombineStatusMessage [children=[StatusMessage [severity=ERROR, message='removeAttribute: Session already invalidated', timestamp=1437028119197, detailedMessage=java.lang.IllegalStateException: removeAttribute: Session already invalidated
    at org.apache.catalina.session.StandardSession.removeAttribute(StandardSession.java:1373)
    at org.apache.catalina.session.StandardSession.removeAttribute(StandardSession.java:1348)
    at org.apache.catalina.session.StandardSessionFacade.removeAttribute(StandardSessionFacade.java:171)
    at com.worklight.core.auth.impl.AuthenticationContext.destroy(AuthenticationContext.java:332)
    at com.worklight.integration.model.AdapterSessionContainer.destroyAdapterSessions(AdapterSessionContainer.java:71)
    at com.worklight.integration.services.impl.AdapterManagerImpl.closeAdapterResources(AdapterManagerImpl.java:144)
    at com.worklight.integration.services.impl.AdapterManagerImpl.deployAdapter(AdapterManagerImpl.java:87)
    at com.worklight.twopc.runtime.AdapterDeployAction.commit(AdapterDeployAction.java:50)
    at com.worklight.twopc.runtime.RuntimeTransactionHandler.commit(RuntimeTransactionHandler.java:203)
    at com.worklight.core.jmx.ProjectSynchronizationBean.sync(ProjectSynchronizationBean.java:265)
    at com.worklight.core.jmx.ProjectManagementMXBeanImpl.sync(ProjectManagementMXBeanImpl.java:1045)

    *** ***

]], super=StatusMessage [severity=ERROR, message='Commit', timestamp=1437028119197, detailedMessage=null]]
Jul 16, 2015 2:28:39 PM StatusMessage createStatusMessage
SEVERE: Cannot synchronized
com.worklight.core.exceptions.ProjectSynchronizationException: Runtime synchronization failed
    at com.worklight.core.jmx.ProjectSynchronizationBean.sync(ProjectSynchronizationBean.java:342)
    at com.worklight.core.jmx.ProjectManagementMXBeanImpl.sync(ProjectManagementMXBeanImpl.java:1045)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)

    *** ***

Caused by: OutOfSyncException [receivedTransactionDetails=com.worklight.common.type.TransactionDetails{currentTransactionId=1437028119196, previousTransactionId=1437028118819 is dbMaster=false, lastTransactionID=1437028118819]
    at com.worklight.twopc.runtime.RuntimeTransactionHandler.commit(RuntimeTransactionHandler.java:213)
    at com.worklight.core.jmx.ProjectSynchronizationBean.sync(ProjectSynchronizationBean.java:265)
    ... 42 more

Jul 16, 2015 2:28:39 PM com.ibm.worklight.admin.jmx.JMXCommunicationUtil logOperationResult
SEVERE: Result: worklight: null///192.168.135.4: Runtime synchronization failed
Jul 16, 2015 2:28:49 PM com.worklight.common.util.jmx.RuntimeMBeanHandler getRMIConnection
INFO: Establishing RMI connection on localhost with port number 8686

日志文件:localhost.2015-07-16.log

Jul 16, 2015 10:02:38 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [ManagementServlet] in context with path [/wladmin] threw exception
<openjpa-1.2.2-r422266:898935 fatal store error> org.apache.openjpa.persistence.RollbackException: The last packet successfully received from the server was 85,896,513 milliseconds ago.  The last packet sent successfully to the server was 85,896,513 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
    at org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.java:523)
    at com.ibm.worklight.admin.services.BaseService.auditStart(BaseService.java:719)
    at com.ibm.worklight.admin.services.BaseService.auditStart(BaseService.java:684)
    at com.ibm.worklight.admin.services.BaseService.auditStart(BaseService.java:661)
    at com.ibm.worklight.admin.services.ManagementService.loginAudit(ManagementService.java:132)

    *** ***

    at java.lang.Thread.run(Thread.java:745)
Caused by: <openjpa-1.2.2-r422266:898935 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: The last packet successfully received from the server was 85,896,513 milliseconds ago.  The last packet sent successfully to the server was 85,896,513 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
    at org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4246)
    at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4211)
    at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:102)
    at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:88)
    at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:64)
    at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.connect(JDBCStoreManager.java:934)
    at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.retainConnection(JDBCStoreManager.java:216)
    at org.apache.openjpa.kernel.DelegatingStoreManager.retainConnection(DelegatingStoreManager.java:163)
    at org.apache.openjpa.kernel.BrokerImpl.retainConnection(BrokerImpl.java:3734)
    at org.apache.openjpa.kernel.BrokerImpl.beginStoreManagerTransaction(BrokerImpl.java:1302)
    at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1987)
    at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1927)
    at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1845)
    at org.apache.openjpa.kernel.LocalManagedRuntime.commit(LocalManagedRuntime.java:81)
    at org.apache.openjpa.kernel.BrokerImpl.commit(BrokerImpl.java:1369)
    at org.apache.openjpa.kernel.DelegatingBroker.commit(DelegatingBroker.java:877)
    at org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.java:512)
    ... 79 more
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 85,896,513 milliseconds ago.  The last packet sent successfully to the server was 85,896,513 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
    at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1122)
    at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3317)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1941)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2114)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2690)
    at com.mysql.jdbc.ConnectionImpl.setAutoCommit(ConnectionImpl.java:5093)
    at org.apache.tomcat.dbcp.dbcp.DelegatingConnection.setAutoCommit(DelegatingConnection.java:371)
    at org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.setAutoCommit(PoolingDataSource.java:328)
    at org.apache.openjpa.lib.jdbc.DelegatingConnection.setAutoCommit(DelegatingConnection.java:198)
    at org.apache.openjpa.lib.jdbc.DelegatingConnection.setAutoCommit(DelegatingConnection.java:198)
    at org.apache.openjpa.lib.jdbc.ConfiguringConnectionDecorator$ConfiguringConnection.setAutoCommit(ConfiguringConnectionDecorator.java:117)
    at org.apache.openjpa.lib.jdbc.ConfiguringConnectionDecorator$ConfiguringConnection.<init>(ConfiguringConnectionDecorator.java:111)
    at org.apache.openjpa.lib.jdbc.ConfiguringConnectionDecorator.decorate(ConfiguringConnectionDecorator.java:93)
    at org.apache.openjpa.lib.jdbc.DecoratingDataSource.decorate(DecoratingDataSource.java:100)
    at org.apache.openjpa.lib.jdbc.DecoratingDataSource.getConnection(DecoratingDataSource.java:88)
    at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.connectInternal(JDBCStoreManager.java:945)
    at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.connect(JDBCStoreManager.java:930)
    ... 90 more
Caused by: java.net.SocketException: Broken pipe
    at java.net.SocketOutputStream.socketWrite0(Native Method)
    at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:113)
    at java.net.SocketOutputStream.write(SocketOutputStream.java:159)
    at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
    at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
    at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3298)
    ... 105 more

Jul 16, 2015 2:28:47 PM org.apache.catalina.authenticator.SingleSignOn expire
WARNING: SSO unable to expire session [Host: [localhost], Context: [/worklightconsole], SessionID: [1690FBC4A81ABB560ECC9203CC2CC8D2]] because the Session could not be found
Jul 16, 2015 2:31:35 PM org.apache.catalina.authenticator.SingleSignOn expire
WARNING: SSO unable to expire session [Host: [localhost], Context: [/worklightconsole], SessionID: [185C6AA9E08F71E4A4F16E689D0FD426]] because the Session could not be found
Jul 16, 2015 2:32:09 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [GadgetAPIServlet] in context with path [/worklight] threw exception [OutOfSyncException [receivedTransactionDetails=com.worklight.common.type.TransactionDetails{currentTransactionId=1437028119196, previousTransactionId=1437028118819 is dbMaster=false, lastTransactionID=1437028118819]] with root cause
OutOfSyncException [receivedTransactionDetails=com.worklight.common.type.TransactionDetails{currentTransactionId=1437028119196, previousTransactionId=1437028118819 is dbMaster=false, lastTransactionID=1437028118819]
    at com.worklight.twopc.runtime.RuntimeTransactionHandler.commit(RuntimeTransactionHandler.java:213)
    at com.worklight.core.jmx.ProjectSynchronizationBean.sync(ProjectSynchronizationBean.java:265)
    at com.worklight.core.jmx.ProjectManagementMXBeanImpl.sync(ProjectManagementMXBeanImpl.java:1045)

    *** ***

1 个答案:

答案 0 :(得分:1)

它与MySQL陈旧连接的处理有关。 MySQL数据库在连接上一段非活动后关闭其连接。此超时由名为wait_timeout的系统变量定义。默认值为28000秒(8小时)。

要避免此行为,请查看: http://www.nysol.sakura.ne.jp/mcmd2/en/sect-mcat.html