Welcome to Knowage Q&A, where you can ask questions and receive answers from other members of the community.
0 votes
1 view

I would like to delete the default users & roles (barring admin) and create my own set of users & roles. But while deleting the roles, it says the dependencies are to be deleted. 

Error while deleting item. Control eventual items to which it is associated and then try to delete it again!

I thought the eventual item is users, and tried to remove the users before removing roles. However, I face error as '

Error with deleting resource with id: 3

I see in the log as follows:

[http-bio-8080-exec-2] 19 Jul 2017 10:46:14,002 ERROR it.eng.spagobi.rest.interceptors.RestExceptionMapper.toResponseFromGenericException:97 - Catched service error: 
it.eng.spagobi.utilities.exceptions.SpagoBIRestServiceException: Error with deleting resource with id: 5
    at it.eng.spagobi.api.v2.UserResource.deleteCheck(UserResource.java:261)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:167)
    at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:257)
    at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:222)
    at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:211)
    at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:542)
    at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:524)
    at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:126)
    at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208)
    at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55)
    at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:409)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1044)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:313)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: it.eng.spago.error.EMFUserError: severity [ERROR] description [Generic Error]
    at it.eng.spagobi.profiling.dao.SbiUserDAOHibImpl.deleteSbiUserById(SbiUserDAOHibImpl.java:435)
    at it.eng.spagobi.api.v2.UserResource.deleteCheck(UserResource.java:256)
    ... 34 more

Please advise the solution

Regards,

Vinay 

in Users and Roles by (310 points)

1 Answer

0 votes
I think you (or the log itself) didn't catch the error.

Can you please look for an hibernate exception, and then edit you question to include it?
by (15.2k points)
The error is:

[http-bio-8080-exec-4] 19 Jul 2017 10:51:54,399 ERROR org.hibernate.util.JDBCExceptionReporter.logExceptions:234 - Cannot delete or update a parent row: a foreign key constraint fails (`knowage_ce`.`sbi_paruse_det`, CONSTRAINT `FK_SBI_PARUSE_DET_2` FOREIGN KEY (`EXT_ROLE_ID`) REFERENCES `sbi_ext_roles` (`EXT_ROLE_ID`))

I changed the default users details to suite my requirements. This issue does not to occur with users i have created / after i rename the users and reassign the roles; but only with the default users created
...