Hi everybody,
I am facing a strange NullPointerException, when I programmatically save a profile picture for a user.
My add-on uses the UserProfileService of Confluence:
newSetProfilePictureCommand(User paramUser, InputStream paramInputStream, String paramString);
Then the following NPE occurs:
[INFO] [talledLocalContainer] 2015-11-23 13:43:38,157 ERROR [com.atlassian.confluence.notifications.impl.DefaultDispatchService:thread-4] [confluence.notifications.impl.DefaultDispatchService] errorOrDebug Error computing recipients [INFO] [talledLocalContainer] java.lang.NullPointerException [INFO] [talledLocalContainer] at com.atlassian.confluence.plugins.files.notifications.email.FileContentRecipientProvider$1.apply(FileContentRecipientProvider.java:31) [INFO] [talledLocalContainer] at com.atlassian.confluence.plugins.files.notifications.email.FileContentRecipientProvider$1.apply(FileContentRecipientProvider.java:27) [INFO] [talledLocalContainer] at com.google.common.collect.Iterators$8.next(Iterators.java:812) [INFO] [talledLocalContainer] at com.google.common.collect.Iterators$5.next(Iterators.java:554) [INFO] [talledLocalContainer] at com.google.common.collect.Iterators$5.next(Iterators.java:554) [INFO] [talledLocalContainer] at com.google.common.collect.Iterators$7.computeNext(Iterators.java:648) [INFO] [talledLocalContainer] at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143) [INFO] [talledLocalContainer] at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138) [INFO] [talledLocalContainer] at com.google.common.collect.Lists.newArrayList(Lists.java:138) [INFO] [talledLocalContainer] at com.google.common.collect.Iterables.toCollection(Iterables.java:315) [INFO] [talledLocalContainer] at com.google.common.collect.Iterables.toArray(Iterables.java:306) [INFO] [talledLocalContainer] at com.google.common.collect.SortedIterables.sortedUnique(SortedIterables.java:93) [INFO] [talledLocalContainer] at com.google.common.collect.ImmutableSortedSet.copyOfInternal(ImmutableSortedSet.java:417) [INFO] [talledLocalContainer] at com.google.common.collect.ImmutableSortedSet.copyOf(ImmutableSortedSet.java:352) [INFO] [talledLocalContainer] at com.atlassian.confluence.notifications.impl.DefaultDispatchService.compileDistinctRecipients(DefaultDispatchService.java:251) [INFO] [talledLocalContainer] at com.atlassian.confluence.notifications.impl.DefaultDispatchService.access$100(DefaultDispatchService.java:43) [INFO] [talledLocalContainer] at com.atlassian.confluence.notifications.impl.DefaultDispatchService$1.call(DefaultDispatchService.java:89) [INFO] [talledLocalContainer] at com.atlassian.confluence.notifications.impl.DefaultDispatchService$1.call(DefaultDispatchService.java:86) [INFO] [talledLocalContainer] at com.atlassian.confluence.notifications.impl.DefaultDispatchService$6$1$1.doInTransaction(DefaultDispatchService.java:170) [INFO] [talledLocalContainer] at com.atlassian.confluence.notifications.impl.DefaultDispatchService$6$1$1.doInTransaction(DefaultDispatchService.java:166) [INFO] [talledLocalContainer] at com.atlassian.sal.core.transaction.HostContextTransactionTemplate$1.doInTransaction(HostContextTransactionTemplate.java:25) [INFO] [talledLocalContainer] at com.atlassian.sal.spring.component.SpringHostContextAccessor$1.doInTransaction(SpringHostContextAccessor.java:88) [INFO] [talledLocalContainer] at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:128) [INFO] [talledLocalContainer] at com.atlassian.sal.spring.component.SpringHostContextAccessor.doInTransaction(SpringHostContextAccessor.java:82) [INFO] [talledLocalContainer] at sun.reflect.GeneratedMethodAccessor180.invoke(Unknown Source) [INFO] [talledLocalContainer] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [INFO] [talledLocalContainer] at java.lang.reflect.Method.invoke(Method.java:483) [INFO] [talledLocalContainer] at com.atlassian.plugin.osgi.hostcomponents.impl.DefaultComponentRegistrar$ContextClassLoaderSettingInvocationHandler.invoke(DefaultComponentRegistrar.java:117) [INFO] [talledLocalContainer] at com.sun.proxy.$Proxy221.doInTransaction(Unknown Source) [INFO] [talledLocalContainer] at sun.reflect.GeneratedMethodAccessor180.invoke(Unknown Source) [INFO] [talledLocalContainer] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [INFO] [talledLocalContainer] at java.lang.reflect.Method.invoke(Method.java:483) [INFO] [talledLocalContainer] at com.atlassian.plugin.osgi.bridge.external.HostComponentFactoryBean$DynamicServiceInvocationHandler.invoke(HostComponentFactoryBean.java:130) [INFO] [talledLocalContainer] at com.sun.proxy.$Proxy221.doInTransaction(Unknown Source) [INFO] [talledLocalContainer] at com.atlassian.sal.core.transaction.HostContextTransactionTemplate.execute(HostContextTransactionTemplate.java:21) [INFO] [talledLocalContainer] at sun.reflect.GeneratedMethodAccessor191.invoke(Unknown Source) [INFO] [talledLocalContainer] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [INFO] [talledLocalContainer] at java.lang.reflect.Method.invoke(Method.java:483) [INFO] [talledLocalContainer] at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) [INFO] [talledLocalContainer] at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:58) [INFO] [talledLocalContainer] at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:62) [INFO] [talledLocalContainer] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) [INFO] [talledLocalContainer] at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131) [INFO] [talledLocalContainer] at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119) [INFO] [talledLocalContainer] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) [INFO] [talledLocalContainer] at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:56) [INFO] [talledLocalContainer] at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:39) [INFO] [talledLocalContainer] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) [INFO] [talledLocalContainer] at org.springframework.osgi.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:59) [INFO] [talledLocalContainer] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) [INFO] [talledLocalContainer] at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131) [INFO] [talledLocalContainer] at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119) [INFO] [talledLocalContainer] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) [INFO] [talledLocalContainer] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) [INFO] [talledLocalContainer] at com.sun.proxy.$Proxy1765.execute(Unknown Source) [INFO] [talledLocalContainer] at com.atlassian.confluence.notifications.impl.DefaultDispatchService$6$1.run(DefaultDispatchService.java:165) [INFO] [talledLocalContainer] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [INFO] [talledLocalContainer] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [INFO] [talledLocalContainer] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [INFO] [talledLocalContainer] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [INFO] [talledLocalContainer] at java.lang.Thread.run(Thread.java:745) [INFO] [talledLocalContainer] 2015-11-23 13:43:38,157 WARN [com.atlassian.confluence.notifications.impl.DefaultDispatchService:thread-5] [confluence.notifications.impl.DefaultDispatchService] warnOrDebug No recipients were compiled for notification [com.atlassian.confluence.notifications.impl.DescriptorBasedNotificationFactory$PayloadBasedNotification@71671635[key=com.atlassian.confluence.plugins.confluence-file-notifications:file-content-update-notification,payload=com.atlassian.confluence.plugins.files.notifications.email.FileContentUpdatePayload@33e07dc,id=c29bf5cb-8a72-43f9-856e-608c67d110c7,originator=ff8081814bc07a12014bc088434b010b]] from the following list of providers [{com.atlassian.confluence.plugins.files.notifications.email.FileContentRecipientProvider@4eabbdfa}], thus aborting dispatch.
Any suggestions how to avoid this exception? And why it occurs?
Thanks in advance
Sven
Community moderators have prevented the ability to post new answers.
Hi Sven,
apparently the only way to fix this is by bypassing the UserAccessor and implementing the methods yourself, without triggering the event, that causes the exception.
Best regards,
Robert
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.