By: Hannah McKee user 29 Nov 2016 at 3:48 a.m. CST

8 Responses
Hannah McKee gravatar
Hey, We have a custom attribute, "PartyGID". We can manually add this to a User through the GUI. We have a custom authentication script, from which we want to create a user if it doesn't exist: ``` newUser = User() newUser.setAttribute("displayName", "PartyGid: " + partyGid + " created by CP06 Test Client") newUser.setAttribute("partygid", partyGid) newUser = userService.addUser(newUser, True) ``` However, when this runs we are getting an exception: ``` org.gluu.site.ldap.persistence.exception.EntryPersistenceException: Failed to persist entry: inum=@!67DA.D9A5.E289.D773!0001!F485.929A!0000!832D.F48A,ou=people,o=@!67DA.D9A5.E289.D773!0001!F485.929A,o=gluu ``` Not really sure what is going wrong here, assuming it is because this is a custom attribute. Any help is appreciated, thanks, Hannah

By Aliaksandr Samuseu staff 29 Nov 2016 at 7:57 a.m. CST

Aliaksandr Samuseu gravatar
Hi, Hannah. Is this really all you have in logs when this happens? Please provide full error traces, and also check other logs (I take this one message is from `oxauth-script.log`? Please specify which log each trace belongs to) - `wrapper.log`, at least - for possible clues. Best regards, Alex.

By Hannah McKee user 29 Nov 2016 at 8:02 a.m. CST

Hannah McKee gravatar
Hey Alex, this was the only error that really gave much away **oxauth_script.log** ``` 2016-11-29 13:04:28,208 INFO [org.xdi.service.PythonService] (ajp-bio-127.0.0.1-8009-exec-146) CP06 Test Client. Prepare for Step 1 2016-11-29 13:05:00,616 INFO [org.xdi.service.PythonService] (ajp-bio-127.0.0.1-8009-exec-145) CP06 Test Client. Authenticating user 2016-11-29 13:05:00,619 INFO [org.xdi.service.PythonService] (ajp-bio-127.0.0.1-8009-exec-145) CP06 Test Client. Authenticate for step 1 2016-11-29 13:05:00,621 INFO [org.xdi.service.PythonService] (ajp-bio-127.0.0.1-8009-exec-145) CP06 Test Client. Sending request to authentication service 2016-11-29 13:05:02,249 INFO [org.xdi.service.PythonService] (ajp-bio-127.0.0.1-8009-exec-145) CP06 Test Client. Response from Authentication Server: 200 2016-11-29 13:05:02,251 INFO [org.xdi.service.PythonService] (ajp-bio-127.0.0.1-8009-exec-145) CP06 Test Client. Party GID: 123456789 2016-11-29 13:05:02,252 INFO [org.xdi.service.PythonService] (ajp-bio-127.0.0.1-8009-exec-145) CP06 Test Client. Check if user with PartyGid exists 2016-11-29 13:05:02,254 INFO [org.xdi.service.PythonService] (ajp-bio-127.0.0.1-8009-exec-145) CP06 Test Client. Could not find existing user. Creating new User 2016-11-29 13:05:02,260 INFO [org.xdi.service.PythonService] (ajp-bio-127.0.0.1-8009-exec-145) CP06 Test Client. Validate User in LDAP. Exception: 2016-11-29 13:05:02,260 INFO [org.xdi.service.PythonService] (ajp-bio-127.0.0.1-8009-exec-145) org.gluu.site.ldap.persistence.exception.EntryPersistenceException: Failed to persist entry: inum=@!67DA.D9A5.E289.D773!0001!F485.929A!0000!7F80.984D,ou=people,o=@!67DA.D9A5.E289.D773!0001!F485.929A,o=gluu ``` **Wrapper.log** ``` INFO | jvm 1 | 2016/11/29 13:53:44 | WARNING: Unable to find component with ID j_idt244 in view. INFO | jvm 1 | 2016/11/29 13:54:31 | 2016-11-29 13:54:31,907 ERROR [org.xdi.oxauth.auth.Authenticator] INFO | jvm 1 | 2016/11/29 13:54:31 | java.lang.NullPointerException INFO | jvm 1 | 2016/11/29 13:54:31 | at org.xdi.oxauth.service.AuthenticationService.configureSessionUser(AuthenticationService.java:404) INFO | jvm 1 | 2016/11/29 13:54:31 | at sun.reflect.GeneratedMethodAccessor1296.invoke(Unknown Source) INFO | jvm 1 | 2016/11/29 13:54:31 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) INFO | jvm 1 | 2016/11/29 13:54:31 | at java.lang.reflect.Method.invoke(Method.java:606) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.jboss.seam.util.Reflections.invoke(Reflections.java:22) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:79) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:196) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:114) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.xdi.oxauth.service.AuthenticationService_$$_javassist_seam_42.configureSessionUser(AuthenticationService_$$_javassist_seam_42.java) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.xdi.oxauth.auth.Authenticator.userAuthenticationInteractive(Authenticator.java:298) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.xdi.oxauth.auth.Authenticator.authenticateImpl(Authenticator.java:135) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.xdi.oxauth.auth.Authenticator.authenticate(Authenticator.java:97) INFO | jvm 1 | 2016/11/29 13:54:31 | at sun.reflect.GeneratedMethodAccessor1198.invoke(Unknown Source) INFO | jvm 1 | 2016/11/29 13:54:31 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) INFO | jvm 1 | 2016/11/29 13:54:31 | at java.lang.reflect.Method.invoke(Method.java:606) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.jboss.seam.util.Reflections.invoke(Reflections.java:22) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:79) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:196) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:114) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.xdi.oxauth.auth.Authenticator_$$_javassist_seam_52.authenticate(Authenticator_$$_javassist_seam_52.java) INFO | jvm 1 | 2016/11/29 13:54:31 | at sun.reflect.GeneratedMethodAccessor1197.invoke(Unknown Source) INFO | jvm 1 | 2016/11/29 13:54:31 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) INFO | jvm 1 | 2016/11/29 13:54:31 | at java.lang.reflect.Method.invoke(Method.java:606) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:335) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:348) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.jboss.el.parser.AstValue.invoke(AstValue.java:96) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276) INFO | jvm 1 | 2016/11/29 13:54:31 | at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105) INFO | jvm 1 | 2016/11/29 13:54:31 | at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:87) INFO | jvm 1 | 2016/11/29 13:54:31 | at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:101) INFO | jvm 1 | 2016/11/29 13:54:31 | at javax.faces.component.UICommand.broadcast(UICommand.java:315) INFO | jvm 1 | 2016/11/29 13:54:31 | at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:786) INFO | jvm 1 | 2016/11/29 13:54:31 | at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1251) INFO | jvm 1 | 2016/11/29 13:54:31 | at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81) INFO | jvm 1 | 2016/11/29 13:54:31 | at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) INFO | jvm 1 | 2016/11/29 13:54:31 | at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) INFO | jvm 1 | 2016/11/29 13:54:31 | at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:748) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:486) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:411) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:338) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.jboss.seam.web.RewriteFilter.process(RewriteFilter.java:98) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.jboss.seam.web.RewriteFilter.doFilter(RewriteFilter.java:57) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:190) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316) INFO | jvm 1 | 2016/11/29 13:54:31 | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) INFO | jvm 1 | 2016/11/29 13:54:31 | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) INFO | jvm 1 | 2016/11/29 13:54:31 | at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) INFO | jvm 1 | 2016/11/29 13:54:31 | at java.lang.Thread.run(Thread.java:745) INFO | jvm 1 | 2016/11/29 13:54:31 | 2016-11-29 13:54:31,909 INFO [org.xdi.oxauth.auth.Authenticator] Authentication failed for 'test' ``` However, I think the null pointer exception in wrapper.log is because a User does not exist.

By Aliaksandr Samuseu staff 29 Nov 2016 at 8:23 a.m. CST

Aliaksandr Samuseu gravatar
Thanks, Hannah. > Not really sure what is going wrong here, assuming it is because this is a custom attribute. Have you tried to comment out the string that adds custom attribute to it? Will it work this way?

By Hannah McKee user 29 Nov 2016 at 8:35 a.m. CST

Hannah McKee gravatar
Hi, Without the custom attribute the user will be created, yes. There are really 2 issues here I guess. 1. I cannot get the custom authentication script to work - true is returned, however the login page says "Please enter correct username and password" - Is this because a user does not exist in Gluu or something else? 2. I cannot create a user with a custom attribute property

By Michael Schwartz Account Admin 29 Nov 2016 at 3:37 p.m. CST

Michael Schwartz gravatar
Can you email your script to support@gluu.org and reference issue 3521.

By William Lowe user 05 Dec 2016 at 1:14 p.m. CST

William Lowe gravatar
Hannah's script attached.

By Hannah McKee user 06 Dec 2016 at 5:11 a.m. CST

Hannah McKee gravatar
Hey! Thanks for all your help with this. Managed to get this working. Think the piece of the puzzle we were missing was setting the custom object classes of the user. ``` newUser.setCustomObjectClasses(["gluuPerson", "ox-67DAD9A5E289D7730001F485929A"]) ``` Thanks, Hannah

By William Lowe user 06 Dec 2016 at 9:10 a.m. CST

William Lowe gravatar
Wow! Nice work, Hannah. Thanks for your persistence.