问题描述
confluence服务和数据库重启以后打开confluence页面报如下所示的错误:
解决步骤:
1、第一件事查看日志,查看日志报
Confluence returns system error due to ‘Invocation of method ‘isShowSignUp’ in class com.atlassian.confluence.user.actions.LoginAction threw exception java.lang.NullPointerException at /login.vm’
Application cannot be null
2、根据日志可以看出来confluence服务查询是空的没有程序的。到confluence的数据库里查看对应的表,看表里是否有数据。
select * from cwd_application;
select * from cwd_app_dir_mapping;
3、查看这两张表里确实都没有数据。查出来原因了,原来是cwd_application表和表cwd_app_dir_mapping是空的。没有数据的。
4、解决过程:
(1)首先先关闭confluence (2)备份数据库
(2)依次执行如下命令:
INSERT INTO cwd_application (id, application_name, lower_application_name, created_date, updated_date, active, description, application_type, credential )
VALUES ('327681','crowd-embedded','crowd-embedded','2012-8-14 12:00:43','2022-5-16 15:41:35', 'T', 'NULL', 'GENERIC_APPLICATION', 'X');
INSERT INTO cwd_app_dir_mapping (id, application_id, directory_id, allow_all, list_index) VALUES ('393217','327681','360449','T','0');
如果上述查询导致为cwd_directory 返回外键约束错误,则在继续执行插入管理员用户的查询之前,运行以下两个查询以创建内部目录:
INSERT INTO cwd_directory(id,directory_name,lower_directory_name,created_date,updated_date,active,description,impl_class,lower_impl_class,directory_type) VALUES ('360449','Confluence Internal Directory','confluence internal directory','2020-02-14 13:14:58.331','2020-02-14 13:14:58.331','T','Confluence default internal directory','com.atlassian.crowd.directory.InternalDirectory','com.atlassian.crowd.directory.internaldirectory','INTERNAL');
INSERT INTO cwd_directory_attribute (directory_id, attribute_value, attribute_name) VALUES ('360449','atlassian-security','user_encryption_method');
INSERT INTO cwd_user(id, user_name, lower_user_name, active, created_date, updated_date, first_name, lower_first_name, last_name, lower_last_name, display_name, lower_display_name, email_address, lower_email_address, directory_id, credential) VALUES (1212121, 'admin', 'admin', 'T', '2009-11-26 17:42:08', '2009-11-26 17:42:08', 'A. D.', 'a. d.', 'Ministrator', 'ministrator', 'A. D. Ministrator', 'a. d. ministrator', 'admin@example.com', 'admin@example.com', (select id from cwd_directory where directory_name='Confluence Internal Directory'), 'x61Ey612Kl2gpFL56FT9weDnpSo4AV8j8+qx2AuTHdRyY036xxzTTrw10Wq3+4qQyB+XURPWx1ONxp3Y3pB37A==');
INSERT INTO user_mapping
VALUES ('2c9681954172cf560000000000000001', 'admin', 'admin');
如果由于遇到 FK 约束错误而必须添加这 2 个,请返回并尝试再次运行cwd_app_dir_mapping INSERT 语句,然后再继续。
INSERT INTO cwd_group(id, group_name, lower_group_name, active, local, created_date, updated_date, description, group_type, directory_id)
VALUES ( '888888','confluence-administrators','confluence-administrators','T','F','2011-03-21 12:20:29','2011-03-21 12:20:29',NULL,'GROUP',(select id from cwd_directory where directory_name='Confluence Internal Directory'));
INSERT INTO cwd_group(id, group_name, lower_group_name, active, local, created_date, updated_date, description, group_type, directory_id)
VALUES ( '999999','confluence-users','confluence-users','T','F','2011-03-21 12:20:29','2011-03-21 12:20:29',NULL,'GROUP',(select id from cwd_directory where directory_name='Confluence Internal Directory'));
INSERT INTO cwd_membership (id, parent_id, child_user_id)
VALUES (888888, (select id from cwd_group where group_name='confluence-users' and directory_id=(select id from cwd_directory where directory_name='Confluence Internal Directory')), 1212121);
INSERT INTO cwd_membership (id, parent_id, child_user_id)
VALUES (999999, (select id from cwd_group where group_name='confluence-administrators' and directory_id=(select id from cwd_directory where directory_name='Confluence Internal Directory')), 1212121);
UPDATE cwd_user
SET credential =
'x61Ey612Kl2gpFL56FT9weDnpSo4AV8j8+qx2AuTHdRyY036xxzTTrw10Wq3+4qQyB+XURPWx1ONxp3Y3pB37A==' WHERE id=1212121;
运行上述查询后,重新启动 Confluence 并尝试使用以下凭据登录:
用户名:admin
密码:admin