ShibbolethLoginHandler: 500 Error when login the first time

Steps to reproduce

Steps to reproduce:
1. Configure Shibboleth authentication support using Matterhorn's ShibbolethRequestHeaderAuthenticationFilter
2. Login as a Shibboleth user the first time

Actual Results:

The error message below will be displayed in the frontend. In the log file 'opencast.log' I can see that the method 'newUserLogin' of the Implementation-Class of the interface 'ShibbolethLoginHandler' will be called multiple times.

HTTP ERROR 500

Problem accessing /engage/ui/index.html. Reason:

User '...' already exists

Caused by:

java.lang.IllegalStateException: User '154FC5459358D89A' already exists
at org.opencastproject.userdirectory.JpaUserReferenceProvider.addUserReference(JpaUserReferenceProvider.java:240)
at sun.reflect.GeneratedMethodAccessor228.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318)
at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:58)
at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:62)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:56)
at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:39)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.osgi.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:59)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.Cglib2AopProxy$FixedChainStaticTargetInterceptor.intercept(Cglib2AopProxy.java:573)
at org.opencastproject.userdirectory.JpaUserReferenceProvider$$EnhancerByCGLIB$$1e485191.addUserReference(<generated>)
at org.opencastproject.security.shibboleth.test.ShibbolethLoginHandlerTest.newUserLogin(ShibbolethLoginHandlerTest.java:106)

Expected Results:
no error message.
(The method 'existingUserLogin' should be called)

Workaround (if any):
no workaround. But it seems to be a caching issue. If you wait for an unspecific time (1 minute?) then the issue gone away. (in the logs i can see that the "existingUserLogin"-method was then correctly called)

Status

Assignee

Lukas Rohner

Reporter

DonC

Severity

Non Functioning

Tags (folksonomy)

Components

Fix versions

Affects versions

Priority

Major
Configure