一个操作员删除了数据字典,然后重新启动Alfresco 3.4.12 Enterprise Edition。上下文/ alfresco不会以以下异常开头:
Delegate Sub AutoScrollPositionDelegate(ByVal sender As ScrollableControl, ByVal p As Point)
Private Sub TextBox1_Enter(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.Enter
Dim p As Point = Panel1.AutoScrollPosition
Dim del As AutoScrollPositionDelegate = New AutoScrollPositionDelegate(AddressOf SetAutoScrollPosition)
Panel1.BeginInvoke(del, {Panel1, p})
End Sub
Private Sub SetAutoScrollPosition(ByVal sender As ScrollableControl, ByVal p As Point)
p.X = Math.Abs(p.X)
p.Y = Math.Abs(p.Y)
sender.AutoScrollPosition = p
End Sub
查看org.alfresco.repo.action.scheduled.ScheduledPersistedActionServiceImpl.java中的源代码,路径是固定的。
然后,我们遵循https://community.alfresco.com/thread/202859-error-failed-to-find-appdictionary-node的技巧,编辑bootstrap-context.xml,注释掉该类。
更改后,错误消失了,现在RenditionService无法启动。
我们正在寻找一种恢复已删除节点的方法,因为我们可以从数据库中获取节点ID。因此,我们创建了一个小类,并在bootstrap-context.xml中通过spring调用了它,但是由于权限的原因而失败了。您能否看一下代码并告诉我们出什么问题了。代码是:
17:43:11,100 INFO [STDOUT] 17:43:11,097 ERROR [web.context.ContextLoader] Context initialization failed
org.alfresco.error.AlfrescoRuntimeException: 08050000 Failed to find 'app:dictionary' node
at org.alfresco.repo.action.scheduled.ScheduledPersistedActionServiceImpl.locatePersistanceFolder(ScheduledPersistedActionServiceImpl.java:132)
例外是:
package com.impulseit.test;
import javax.transaction.UserTransaction;
import org.alfresco.repo.node.archive.NodeArchiveService;
import org.alfresco.repo.node.archive.RestoreNodeReport;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.cmr.repository.NodeRef;
public class RestoreNode {
private NodeArchiveService nodeArchiveService;
private ServiceRegistry serviceRegistry;
private String nodeName ="archive://SpacesStore/adfc0cfe-e20b-467f-ad71-253aea8f9ac9";
public void setNodeArchiveService(NodeArchiveService value)
{
this.nodeArchiveService = value;
}
public void setServiceRegistry(ServiceRegistry value)
{
this.serviceRegistry = value;
}
public void doRestore() {
RunAsWork<Void> runAsWork = new RunAsWork<Void>()
{
public Void doWork() throws Exception
{
NodeRef nodeRef = new NodeRef(nodeName);
//RestoreNodeReport restoreNodeReport =
UserTransaction trx_A = serviceRegistry.getTransactionService().getUserTransaction();
trx_A.begin();
AuthenticationUtil.setFullyAuthenticatedUser(AuthenticationUtil.getSystemUserName());
RestoreNodeReport restored = nodeArchiveService.restoreArchivedNode(nodeRef);
trx_A.commit();
return null;
}
};
AuthenticationUtil.runAs(runAsWork,AuthenticationUtil.getSystemUserName());
}
public RestoreNode() {
}
}
谢谢。
路易斯