Hi,
I'm getting the following exception when invoking an API in a distributed
APIM setup. In the deployment, we have two gateway nodes, one serving as a
manager and the other as the worker. Published APIs are first deployed on
the manager node and then propagated to the worker node  through the svn
deployment synchronizer.
This was only observed when invoking an API created by a tenant.

[2013-09-06 18:41:29,653] ERROR - JDBCResourceDAO Failed to add resource to
path /. Referential integrity constraint violation:
"REG_RESOURCE_FK_BY_PATH_ID: PUBLIC.REG_RESOURCE FOREIGN KEY(REG_PATH_ID,
REG_TENANT_ID) REFERENCES PUBLIC.REG_PATH(REG_PATH_ID, REG_TENANT_ID)"; SQL
statement:
INSERT INTO REG_RESOURCE (REG_PATH_ID, REG_NAME, REG_MEDIA_TYPE,
REG_CREATOR, REG_CREATED_TIME, REG_LAST_UPDATOR, REG_LAST_UPDATED_TIME,
REG_DESCRIPTION, REG_TENANT_ID, REG_UUID) VALUES (?, ?, ?, ?, ?, ?, ?, ?,
?, ?) [23002-140]
org.h2.jdbc.JdbcSQLException: Referential integrity constraint violation:
"REG_RESOURCE_FK_BY_PATH_ID: PUBLIC.REG_RESOURCE FOREIGN KEY(REG_PATH_ID,
REG_TENANT_ID) REFERENCES PUBLIC.REG_PATH(REG_PATH_ID, REG_TENANT_ID)"; SQL
statement:
INSERT INTO REG_RESOURCE (REG_PATH_ID, REG_NAME, REG_MEDIA_TYPE,
REG_CREATOR, REG_CREATED_TIME, REG_LAST_UPDATOR, REG_LAST_UPDATED_TIME,
REG_DESCRIPTION, REG_TENANT_ID, REG_UUID) VALUES (?, ?, ?, ?, ?, ?, ?, ?,
?, ?) [23002-140]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:327)
at org.h2.message.DbException.get(DbException.java:167)
at org.h2.message.DbException.get(DbException.java:144)
at
org.h2.constraint.ConstraintReferential.checkRowOwnTable(ConstraintReferential.java:329)
at
org.h2.constraint.ConstraintReferential.checkRow(ConstraintReferential.java:271)
at org.h2.table.Table.fireConstraints(Table.java:801)
at org.h2.table.Table.fireAfterRow(Table.java:818)
at org.h2.command.dml.Insert.insertRows(Insert.java:122)
at org.h2.command.dml.Insert.update(Insert.java:82)
at org.h2.command.CommandContainer.update(CommandContainer.java:70)
at org.h2.command.Command.executeUpdate(Command.java:199)
at
org.h2.jdbc.JdbcPreparedStatement.executeUpdateInternal(JdbcPreparedStatement.java:141)
at
org.h2.jdbc.JdbcPreparedStatement.executeUpdate(JdbcPreparedStatement.java:127)
at
org.wso2.carbon.registry.core.jdbc.dao.JDBCResourceDAO.addResourceWithoutContentId(JDBCResourceDAO.java:1391)
at
org.wso2.carbon.registry.core.jdbc.dao.JDBCResourceDAO.addRoot(JDBCResourceDAO.java:445)
at
org.wso2.carbon.registry.core.session.UserRegistry.addRootCollection(UserRegistry.java:365)
at
org.wso2.carbon.registry.core.session.UserRegistry.init(UserRegistry.java:299)
at
org.wso2.carbon.registry.core.session.UserRegistry.<init>(UserRegistry.java:226)
at
org.wso2.carbon.registry.core.session.UserRegistry.<init>(UserRegistry.java:205)
at
org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService.getUserRegistry(EmbeddedRegistryService.java:427)
at
org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService.getSystemRegistry(EmbeddedRegistryService.java:292)
at
org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService.getConfigSystemRegistry(EmbeddedRegistryService.java:485)
at
org.wso2.carbon.core.multitenancy.utils.TenantAxisUtils.createTenantConfigurationContext(TenantAxisUtils.java:295)
at
org.wso2.carbon.core.multitenancy.utils.TenantAxisUtils.getTenantConfigurationContext(TenantAxisUtils.java:135)
at
org.wso2.carbon.core.multitenancy.MultitenantMessageReceiver.processRequest(MultitenantMessageReceiver.java:196)
at
org.wso2.carbon.core.multitenancy.MultitenantMessageReceiver.receive(MultitenantMessageReceiver.java:77)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at
org.apache.synapse.transport.passthru.ServerWorker.processNonEntityEnclosingRESTHandler(ServerWorker.java:337)
at
org.apache.synapse.transport.passthru.ServerWorker.processEntityEnclosingRequest(ServerWorker.java:378)
at
org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:184)
at
org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
[2013-09-06 18:41:29,656] FATAL - UserRegistry Failed to add the root
collection to the coreRegistry.
org.wso2.carbon.registry.core.exceptions.RegistryException: Failed to add
resource to path /. Referential integrity constraint violation:
"REG_RESOURCE_FK_BY_PATH_ID: PUBLIC.REG_RESOURCE FOREIGN KEY(REG_PATH_ID,
REG_TENANT_ID) REFERENCES PUBLIC.REG_PATH(REG_PATH_ID, REG_TENANT_ID)"; SQL
statement:
INSERT INTO REG_RESOURCE (REG_PATH_ID, REG_NAME, REG_MEDIA_TYPE,
REG_CREATOR, REG_CREATED_TIME, REG_LAST_UPDATOR, REG_LAST_UPDATED_TIME,
REG_DESCRIPTION, REG_TENANT_ID, REG_UUID) VALUES (?, ?, ?, ?, ?, ?, ?, ?,
?, ?) [23002-140]
at
org.wso2.carbon.registry.core.jdbc.dao.JDBCResourceDAO.addResourceWithoutContentId(JDBCResourceDAO.java:1410)
at
org.wso2.carbon.registry.core.jdbc.dao.JDBCResourceDAO.addRoot(JDBCResourceDAO.java:445)
at
org.wso2.carbon.registry.core.session.UserRegistry.addRootCollection(UserRegistry.java:365)
at
org.wso2.carbon.registry.core.session.UserRegistry.init(UserRegistry.java:299)
at
org.wso2.carbon.registry.core.session.UserRegistry.<init>(UserRegistry.java:226)
at
org.wso2.carbon.registry.core.session.UserRegistry.<init>(UserRegistry.java:205)
at
org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService.getUserRegistry(EmbeddedRegistryService.java:427)
at
org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService.getSystemRegistry(EmbeddedRegistryService.java:292)
at
org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService.getConfigSystemRegistry(EmbeddedRegistryService.java:485)
at
org.wso2.carbon.core.multitenancy.utils.TenantAxisUtils.createTenantConfigurationContext(TenantAxisUtils.java:295)
at
org.wso2.carbon.core.multitenancy.utils.TenantAxisUtils.getTenantConfigurationContext(TenantAxisUtils.java:135)
at
org.wso2.carbon.core.multitenancy.MultitenantMessageReceiver.processRequest(MultitenantMessageReceiver.java:196)
at
org.wso2.carbon.core.multitenancy.MultitenantMessageReceiver.receive(MultitenantMessageReceiver.java:77)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at
org.apache.synapse.transport.passthru.ServerWorker.processNonEntityEnclosingRESTHandler(ServerWorker.java:337)
at
org.apache.synapse.transport.passthru.ServerWorker.processEntityEnclosingRequest(ServerWorker.java:378)
at
org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:184)
at
org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.h2.jdbc.JdbcSQLException: Referential integrity constraint
violation: "REG_RESOURCE_FK_BY_PATH_ID: PUBLIC.REG_RESOURCE FOREIGN
KEY(REG_PATH_ID, REG_TENANT_ID) REFERENCES PUBLIC.REG_PATH(REG_PATH_ID,
REG_TENANT_ID)"; SQL statement:
INSERT INTO REG_RESOURCE (REG_PATH_ID, REG_NAME, REG_MEDIA_TYPE,
REG_CREATOR, REG_CREATED_TIME, REG_LAST_UPDATOR, REG_LAST_UPDATED_TIME,
REG_DESCRIPTION, REG_TENANT_ID, REG_UUID) VALUES (?, ?, ?, ?, ?, ?, ?, ?,
?, ?) [23002-140]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:327)
at org.h2.message.DbException.get(DbException.java:167)
at org.h2.message.DbException.get(DbException.java:144)
at
org.h2.constraint.ConstraintReferential.checkRowOwnTable(ConstraintReferential.java:329)
at
org.h2.constraint.ConstraintReferential.checkRow(ConstraintReferential.java:271)
at org.h2.table.Table.fireConstraints(Table.java:801)
at org.h2.table.Table.fireAfterRow(Table.java:818)
at org.h2.command.dml.Insert.insertRows(Insert.java:122)
at org.h2.command.dml.Insert.update(Insert.java:82)
at org.h2.command.CommandContainer.update(CommandContainer.java:70)
at org.h2.command.Command.executeUpdate(Command.java:199)
at
org.h2.jdbc.JdbcPreparedStatement.executeUpdateInternal(JdbcPreparedStatement.java:141)
at
org.h2.jdbc.JdbcPreparedStatement.executeUpdate(JdbcPreparedStatement.java:127)
at
org.wso2.carbon.registry.core.jdbc.dao.JDBCResourceDAO.addResourceWithoutContentId(JDBCResourceDAO.java:1391)
... 20 more
[2013-09-06 18:41:29,657] ERROR - TenantAxisUtils Error occurred while
running deployment for tenant foo1.com
org.wso2.carbon.registry.core.exceptions.RegistryException: Failed to add
the root collection to the coreRegistry.
at
org.wso2.carbon.registry.core.session.UserRegistry.addRootCollection(UserRegistry.java:399)
at
org.wso2.carbon.registry.core.session.UserRegistry.init(UserRegistry.java:299)
at
org.wso2.carbon.registry.core.session.UserRegistry.<init>(UserRegistry.java:226)
at
org.wso2.carbon.registry.core.session.UserRegistry.<init>(UserRegistry.java:205)
at
org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService.getUserRegistry(EmbeddedRegistryService.java:427)
at
org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService.getSystemRegistry(EmbeddedRegistryService.java:292)
at
org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService.getConfigSystemRegistry(EmbeddedRegistryService.java:485)
at
org.wso2.carbon.core.multitenancy.utils.TenantAxisUtils.createTenantConfigurationContext(TenantAxisUtils.java:295)
at
org.wso2.carbon.core.multitenancy.utils.TenantAxisUtils.getTenantConfigurationContext(TenantAxisUtils.java:135)
at
org.wso2.carbon.core.multitenancy.MultitenantMessageReceiver.processRequest(MultitenantMessageReceiver.java:196)
at
org.wso2.carbon.core.multitenancy.MultitenantMessageReceiver.receive(MultitenantMessageReceiver.java:77)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at
org.apache.synapse.transport.passthru.ServerWorker.processNonEntityEnclosingRESTHandler(ServerWorker.java:337)
at
org.apache.synapse.transport.passthru.ServerWorker.processEntityEnclosingRequest(ServerWorker.java:378)
at
org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:184)
at
org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)


-- 
*Amila De Silva*
*
*
*Software Engineer*
WSO2 Inc.*
*
mobile :(+94) 775119302
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to