gpt4 book ai didi

java - 为什么我收到以下异常

转载 作者:行者123 更新时间:2023-12-01 16:39:14 26 4
gpt4 key购买 nike

这是我的nodefinder.java 文件

package com.acme.web.action.executer;

import java.sql.ResultSet;
import java.util.Map;

import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.ui.common.component.UIActionLink;

import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;

import org.alfresco.service.cmr.model.FileFolderService;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.repository.StoreRef;
import org.alfresco.service.cmr.search.SearchParameters;
import org.alfresco.service.cmr.search.SearchService;

public class NodeFinder {

// private static final String = null;
SearchParameters sp = new SearchParameters();
private NodeService nodeService;
private FileFolderService fileFolderService;
//geting the filefolder service
public FileFolderService getFileFolderService() {
return fileFolderService;
}
// setting the file folder service
public void setFileFolderService(FileFolderService fileFolderService) {
this.fileFolderService = fileFolderService;
}
// getting the node servise
public NodeService getNodeService() {
return nodeService;
}
// setting the node server

public void setNodeService(NodeService nodeService) {
this.nodeService = nodeService;
}

public void execute(ActionEvent event) {
ResultSet resultSet_s = null;
UIActionLink comp = (UIActionLink) event.getComponent();
Map<String, String> params = comp.getParameterMap();
String id = params.get("id1");
System.out.println("1");

NodeRef actionedUponNodeRef = new NodeRef(Repository.getStoreRef(), id);
String qry_s = "@cm\\:name:train";
System.out.println("2");

SearchParameters sp_s = new SearchParameters();
System.out.println("3");

sp_s.addStore(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE);
sp_s.setLanguage(SearchService.LANGUAGE_LUCENE);

sp_s.setQuery(qry_s);
System.out.println( "4" );

Node node = new Node(actionedUponNodeRef);
System.out.println("5");
resultSet_s = (ResultSet) Repository.getServiceRegistry(
FacesContext.getCurrentInstance()).getSearchService().query(
sp_s);
System.out.println("5.1");

if (resultSet_s != null) {
System.out.println("6");

System.out.println("Node value is::::" + node.getName());

}
}
}

最佳答案

因为您导入了 java.sql.ResultSet 而不是与 org.alfresco.repo.search.impl.lucene.PagingLuceneResultSet 兼容的 alfresco 类/接口(interface)

>

关于java - 为什么我收到以下异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5828844/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com