cancel
Showing results for 
Search instead for 
Did you mean: 

Creat user/people on demand bug?

tinghaii
Champ in-the-making
Champ in-the-making
Not sure if this is bug or not? I have created my own AuthenticationComponent and wired it into Spring.

It is running well with create user on demand. But when i trying to reomve the new user / people from web admin console, it throws exception below. From wiki, alfresco should ready created this user/people when this user missing and populated with default person info.

Crroect me if i am wrong. Thanks.


14:48:34,534 ERROR [ui.common.Utils] Failed to delete User due to error: User does not exist: yuanli

org.alfresco.repo.security.authentication.AuthenticationException: User does not exist: tinghaii
        at org.alfresco.repo.security.authentication.RepositoryAuthenticationDao.deleteUser(Reposito
ryAuthenticationDao.java:225)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:287
)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMe
thodInvocation.java:155)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvo
cation.java:122)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInte
rceptor.java:57)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvo
cation.java:144)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:174)
        at $Proxy14.deleteUser(Unknown Source)
        at org.alfresco.repo.security.authentication.AuthenticationServiceImpl.deleteAuthentication(
AuthenticationServiceImpl.java:75)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:287
)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMe
thodInvocation.java:155)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvo
cation.java:122)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInte
rceptor.java:57)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvo
cation.java:144)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:174)
        at $Proxy19.deleteAuthentication(Unknown Source)
        at org.alfresco.web.bean.users.UsersBean.deleteOK(UsersBean.java:246)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:129)
        at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:6
3)
        at javax.faces.component.UICommand.broadcast(UICommand.java:106)
        at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:90)
        at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:164)
        at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:271)
        at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:94)
        at org.alfresco.web.app.servlet.AlfrescoFacesServlet.service(AlfrescoFacesServlet.java:49)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j
ava:252)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)

        at org.alfresco.web.app.servlet.ModeDetectionFilter.doFilter(ModeDetectionFilter.java:59)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j
ava:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)

        at org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:70)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j
ava:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)

        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11P
rotocol.java:744)
        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
        at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.ja
va:80)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
        at java.lang.Thread.run(Thread.java:595)
2 REPLIES 2

andy
Champ on-the-rise
Champ on-the-rise
Hi

Yes, there is a bug/issue under here ….

The authentication service is being asked to delete a user.

In the alfresco implementation, the user will be deleted.
In your implementation you need a DAO that supports deletes, ignores deletes or throws an exception, …, when delete user is called through the API. You seem to be mixing one authentication system with the DAO for another. If you want users deleted via alfresco you also need to implement your own DAO. The DAO is trying to delete an alfresco user that does not exist. The AuthenticationComponent and DAO go as a pair.

It is possible the AuthenticationService should be able to report if it should delete users - update etc. Or the PersonService should be the only one called (and it delete the user if appropriate). Both ways, some more meta data is required about the capabilities of the service …

People are created on demand (not users). People are distinct from users: the user information holds just the user id and authentication info - no first name etc. The two are linked using the userid. People are part of the repository, but authentication, and user information, can be anywhere.

Create people on demand is there for authentication systems that already have users etc, and you do not want to pre-populate the people, so someone can log in, and get a default person entry. It has drawbacks and is there for convenience. For example, you will only be able to assign permissions to the userids of  people who have logged in at least once.

I hope this helps.

Regards

Andy

tinghaii
Champ in-the-making
Champ in-the-making
I am so surprised your prompt reply and thanks andy for your help.

I have noticed the drawback and trying to wire the spring context into my web user registration class. From registration class, when admin doing the CRUD i can synchronize personService to do the same thing.

But problem came again, i am not able to cast the proxybean to the personService interface. It looks my approach is not workable and i am trying to google web for it. Do you have any suggestion for me?

Thanks again.