Workbox Notification Throws NullPointerException
プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Fisheye および Crucible は除く
問題
When clicking the Workbox Notification icon in Confluence, the generic error message is displayed in the Workbox window.
While the following appears in the atlassian-confluence.log
2016-03-15 12:55:10,309 ERROR [http-8090-22] [mywork.host.rest.ExceptionLogger] toResponse Exception thrown from resource
-- url: /rest/mywork/latest/status/notification/count | userName: user1 | referer: <ConfluenceBaseURL>/pages/viewpage.action?pageId=48398725
com.atlassian.activeobjects.internal.ActiveObjectsInitException: Active Objects failed to initalize for bundle com.atlassian.mywork.confluence-host-plugin
at com.atlassian.activeobjects.osgi.ActiveObjectsServiceFactory$5.apply(ActiveObjectsServiceFactory.java:207)
at com.atlassian.activeobjects.osgi.ActiveObjectsServiceFactory$5.apply(ActiveObjectsServiceFactory.java:187)
at com.atlassian.util.concurrent.Promises$Of$2.apply(Promises.java:259)
at com.atlassian.util.concurrent.Promises$Of$2.apply(Promises.java:256)
at com.atlassian.util.concurrent.Promises$2.onFailure(Promises.java:162)
at com.google.common.util.concurrent.Futures$7.run(Futures.java:1074)
at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:253)
at com.google.common.util.concurrent.ExecutionList$RunnableExecutorPair.execute(ExecutionList.java:161)
at com.google.common.util.concurrent.ExecutionList.execute(ExecutionList.java:146)
at com.google.common.util.concurrent.JdkFutureAdapters$ListenableFutureAdapter$1.run(JdkFutureAdapters.java:151)
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: java.lang.NullPointerException
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:187)
at com.google.common.cache.CustomConcurrentHashMap.getOrCompute(CustomConcurrentHashMap.java:3801)
at com.google.common.cache.ComputingCache.get(ComputingCache.java:46)
at com.google.common.cache.AbstractCache.getUnchecked(AbstractCache.java:49)
at com.atlassian.mywork.host.upgrade.v8.UserIdMigrationUpgradeTask$3.apply(UserIdMigrationUpgradeTask.java:68)
at com.atlassian.mywork.host.upgrade.v8.UserIdMigrationUpgradeTask$3.apply(UserIdMigrationUpgradeTask.java:64)
...
診断
As the issue occurs due to appears in the java.lang.NullPointerException
, we'd then need to check the Confluence code and see what's the parameter Confluence is expecting.
update(ao, AONotification.class, new Effect() {
public void apply(AONotification notification) {
String userKey = (String)((Option)userKeyByUsername.getUnchecked(notification.getUser())).getOrNull();
if(userKey == null) {
ao.delete(new RawEntity[]{notification});
} else {
notification.setUserKey(userKey);
notification.save();
}
}
};
As shown in the code snippet above, Confluence is expecting user information.
To identify if there are indeed any any NULL
values exist in the database, please execute the following SQL query against your Confluence database. We should be seeing some records returned.
SELECT * FROM "AO_9412A1_AONOTIFICATION"
WHERE USER IS NULL;
原因
Here, we can then concluded that the issue was caused by the NULL
values on a non-nullable column in the responsible table for the Workbox notification - AO_9412A1_AONOTIFICATION
table.
ソリューション
Please do take note to generate a full backup of your Confluence database before deleting these records to minimize the impact to your Confluence users.
- Confluence を停止します。
Delete these records from your Confluence database by executing the SQL query below:
DELETE FROM "AO_9412A1_AONOTIFICATION" WHERE USER IS NULL;
- Confluence を再起動します。
注意
We've seen in some cases where even if the user column is not NULL, this error in the logs can occur. In that case, truncating the entire AONOTIFICATION
table is necessary. Substitute step 2 from the Resolution with the following SQL query:
DELETE FROM "AO_9412A1_AONOTIFICATION";