Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot delete application with existing subscriptions #3941

Closed
chamilaadhi opened this issue Apr 17, 2017 · 1 comment
Closed

Cannot delete application with existing subscriptions #3941

chamilaadhi opened this issue Apr 17, 2017 · 1 comment
Labels

Comments

@chamilaadhi
Copy link
Contributor

  • create and application and subscribe to an API
  • delete application

this will throw

[2017-04-17 11:39:18,359] ERROR {org.wso2.carbon.apimgt.rest.api.store.impl.ApplicationsApiServiceImpl} - Error while deleting application: a61952c1-8417-4606-b1d9-3bb7511ca554 org.wso2.carbon.apimgt.core.exception.APIManagementException: Error occurred while deleting the application - a61952c1-8417-4606-b1d9-3bb7511ca554
at org.wso2.carbon.apimgt.core.impl.APIStoreImpl.deleteApplication(APIStoreImpl.java:611)
at org.wso2.carbon.apimgt.core.impl.UserAwareAPIStore.deleteApplication(UserAwareAPIStore.java:57)
at org.wso2.carbon.apimgt.rest.api.store.impl.ApplicationsApiServiceImpl.applicationsApplicationIdDelete(ApplicationsApiServiceImpl.java:74)
at org.wso2.carbon.apimgt.rest.api.store.ApplicationsApi.applicationsApplicationIdDelete(ApplicationsApi.java:44)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.wso2.msf4j.internal.router.HttpMethodInfo.invoke(HttpMethodInfo.java:132)
at org.wso2.msf4j.internal.MSF4JMessageProcessor.dispatchMethod(MSF4JMessageProcessor.java:139)
at org.wso2.msf4j.internal.MSF4JMessageProcessor.lambda$receive$0(MSF4JMessageProcessor.java:81)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.wso2.carbon.apimgt.core.exception.APIMgtDAOException: org.h2.jdbc.JdbcSQLException: Referential integrity constraint violation: "CONSTRAINT_E1: PUBLIC.AM_SUBSCRIPTION FOREIGN KEY(APPLICATION_ID) REFERENCES PUBLIC.AM_APPLICATION(UUID) ('a61952c1-8417-4606-b1d9-3bb7511ca554')"; SQL statement:
DELETE FROM AM_APPLICATION WHERE UUID = ? [23503-192]
at org.wso2.carbon.apimgt.core.dao.impl.ApplicationDAOImpl.deleteApplication(ApplicationDAOImpl.java:355)
at org.wso2.carbon.apimgt.core.impl.APIStoreImpl.completeWorkflow(APIStoreImpl.java:836)
at org.wso2.carbon.apimgt.core.impl.APIStoreImpl.deleteApplication(APIStoreImpl.java:605)
... 13 more
Caused by: org.h2.jdbc.JdbcSQLException: Referential integrity constraint violation: "CONSTRAINT_E1: PUBLIC.AM_SUBSCRIPTION FOREIGN KEY(APPLICATION_ID) REFERENCES PUBLIC.AM_APPLICATION(UUID) ('a61952c1-8417-4606-b1d9-3bb7511ca554')"; SQL statement:
DELETE FROM AM_APPLICATION WHERE UUID = ? [23503-192]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
at org.h2.message.DbException.get(DbException.java:179)
at org.h2.message.DbException.get(DbException.java:155)
at org.h2.constraint.ConstraintReferential.checkRow(ConstraintReferential.java:426)
at org.h2.constraint.ConstraintReferential.checkRowRefTable(ConstraintReferential.java:443)
at org.h2.constraint.ConstraintReferential.checkRow(ConstraintReferential.java:318)
at org.h2.table.Table.fireConstraints(Table.java:967)
at org.h2.table.Table.fireAfterRow(Table.java:985)
at org.h2.command.dml.Delete.update(Delete.java:101)
at org.h2.command.CommandContainer.update(CommandContainer.java:98)
at org.h2.command.Command.executeUpdate(Command.java:258)
at org.h2.jdbc.JdbcPreparedStatement.execute(JdbcPreparedStatement.java:201)
at com.zaxxer.hikari.proxy.PreparedStatementProxy.execute(PreparedStatementProxy.java:44)
at com.zaxxer.hikari.proxy.HikariPreparedStatementProxy.execute(HikariPreparedStatementProxy.java)
at org.wso2.carbon.apimgt.core.dao.impl.ApplicationDAOImpl.deleteApplication(ApplicationDAOImpl.java:351)
... 15 more

@harsha89
Copy link
Member

Please check c5 product and reopen if it's exist.

AnuGayan pushed a commit to AnuGayan/carbon-apimgt that referenced this issue Aug 9, 2022
[WUM] [3.2.0] Fix NPE in OAuthParams
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants