项目

一般

简介

关于java.sql.SQLException: Failed to create database '.../lib/databases/ejbtimer

由 黄 俊睿 在 超过 2 年 之前添加

异常信息:

 RAR5116 : The XA connection could not be allocated: {0}
java.sql.SQLException: Failed to create database '/opt/nodeaas/e-monitor-robot/aas/nodes/localhost-mydomain/e-monitor-robot/lib/databases/ejbtimer', see the next exception for details.
    at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
    at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
    at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown Source)
    at org.apache.derby.impl.jdbc.EmbedConnection.createDatabase(Unknown Source)
    at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
    at org.apache.derby.jdbc.InternalDriver$1.run(Unknown Source)
    at org.apache.derby.jdbc.InternalDriver$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.derby.jdbc.InternalDriver.getNewEmbedConnection(Unknown Source)
    at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
    at org.apache.derby.jdbc.BasicEmbeddedDataSource40.getConnection(Unknown Source)
    at org.apache.derby.jdbc.BasicEmbeddedDataSource40.getConnection(Unknown Source)
    at org.apache.derby.jdbc.BasicEmbeddedDataSource40.setupResourceAdapter(Unknown Source)
    at org.apache.derby.jdbc.EmbeddedXADataSource.getXAConnection(Unknown Source)
    at com.sun.gjc.spi.XAManagedConnectionFactory.createManagedConnection(XAManagedConnectionFactory.java:94)
    at com.apusic.aas.jdbc.recovery.JdbcRecoveryResourceHandler.loadXAResourcesAndItsConnections(JdbcRecoveryResourceHandler.java:255)
    at com.sun.enterprise.transaction.jts.ResourceRecoveryManagerImpl.getAllRecoverableResources(ResourceRecoveryManagerImpl.java:188)
    at com.sun.enterprise.transaction.jts.ResourceRecoveryManagerImpl.recoverXAResources(ResourceRecoveryManagerImpl.java:217)
    at com.sun.enterprise.transaction.jts.ResourceRecoveryManagerImpl.recoverXAResources(ResourceRecoveryManagerImpl.java:313)
    at com.sun.enterprise.transaction.jts.ResourceRecoveryManagerImpl.postConstruct(ResourceRecoveryManagerImpl.java:84)
    at org.jvnet.hk2.internal.ClazzCreator.postConstructMe(ClazzCreator.java:303)
    at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:351)
    at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:463)
    at org.jvnet.hk2.internal.SingletonContext$1.compute(SingletonContext.java:59)
    at org.jvnet.hk2.internal.SingletonContext$1.compute(SingletonContext.java:47)
    at org.glassfish.hk2.utilities.cache.Cache$OriginThreadAwareFuture$1.call(Cache.java:74)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at org.glassfish.hk2.utilities.cache.Cache$OriginThreadAwareFuture.run(Cache.java:131)
    at org.glassfish.hk2.utilities.cache.Cache.compute(Cache.java:176)
    at org.jvnet.hk2.internal.SingletonContext.findOrCreate(SingletonContext.java:98)
    at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2102)
    at org.jvnet.hk2.internal.ServiceLocatorImpl.internalGetService(ServiceLocatorImpl.java:754)
    at org.jvnet.hk2.internal.ServiceLocatorImpl.internalGetService(ServiceLocatorImpl.java:717)
    at org.jvnet.hk2.internal.ServiceLocatorImpl.getService(ServiceLocatorImpl.java:687)
    at com.sun.jts.jta.TransactionServiceProperties$RecoveryHelperThread.run(TransactionServiceProperties.java:337)
Caused by: ERROR XJ041: Failed to create database '/opt/nodeaas/e-monitor-robot/aas/nodes/localhost-mydomain/e-monitor-robot/lib/databases/ejbtimer', see the next exception for details.
    at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
    at org.apache.derby.impl.jdbc.SQLExceptionFactory.wrapArgsForTransportAcrossDRDA(Unknown Source)
    ... 35 more
Caused by: ERROR XBM0A: The database directory '/opt/nodeaas/e-monitor-robot/aas/nodes/localhost-mydomain/e-monitor-robot/lib/databases/ejbtimer' exists. However, it does not contain the expected 'service.properties' file. Perhaps Derby was brought down in the middle of creating this database. You may want to delete this directory and try creating the database again.
    at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
    at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
    at org.apache.derby.impl.services.monitor.StorageFactoryService.vetService(Unknown Source)
    at org.apache.derby.impl.services.monitor.StorageFactoryService.access$900(Unknown Source)
    at org.apache.derby.impl.services.monitor.StorageFactoryService$10.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.derby.impl.services.monitor.StorageFactoryService.createServiceRoot(Unknown Source)
    at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(Unknown Source)
    at org.apache.derby.impl.services.monitor.BaseMonitor.createPersistentService(Unknown Source)
    at org.apache.derby.impl.services.monitor.FileMonitor.createPersistentService(Unknown Source)
    at org.apache.derby.iapi.services.monitor.Monitor.createPersistentService(Unknown Source)
    at org.apache.derby.impl.jdbc.EmbedConnection$5.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.derby.impl.jdbc.EmbedConnection.createPersistentService(Unknown Source)
    ... 32 more

版本号:202205271532

解决时间:2022-7-18

解决方案:备份/ApusicAS/aas/modules/aas-cluster-admin.jar,将附件的同名文件放入替换,再清空ApusicAS/aas/domains/mydomain/osgi-cache/下的缓存,并重启AAS

界面现象:

日志截图:

解决操作: