filenet-p8 - FileNet 异常“读取 RenditionEngineConnection 期间发生异常”
问题描述
我正在尝试使用 IBM FileNet 发布文档。
但我得到一个异常“读取 RenditionEngineConnection 期间发生异常”。
我的错误是什么?我们应该如何设置“FileNet P8 Rendition Engine”? https://www.ibm.com/support/knowledgecenter/it/SSNW2F_5.1.0/com.ibm.p8.installingre.doc/p8pic003.htm
我的源代码:
/**
* Create {@link PublishStyleTemplate}
*
* @param objectStore {@link ObjectStore}
* @param description description
*/
public void createPublishStyleTemplate(final ObjectStore objectStore, final String description) {
PublishStyleTemplate pst = Factory.PublishStyleTemplate.createInstance(objectStore);
pst.set_Title(description);
pst.set_Description(description);
StringList formats = Factory.StringList.createList();
formats.add("text/plain");
formats.add("application/msword");
formats.add("application/vnd.ms-excel");
formats.add("application/vnd.ms-powerpoint");
formats.add("application/vnd.openxmlformat");
formats.add("application/vnd.openxmlformats-officedocument.wordprocessingml.document");
formats.add("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
formats.add("application/vnd.openxmlformats-officedocument.presentationml.presentation");
pst.set_InputFormats(formats);
// ProviderID must use the well-known handler name.
String PDF_HANDLER = "PublishRequestPDFHandler";
pst.set_ProviderID(PDF_HANDLER);
pst.set_OutputFormat("application/pdf"); // PDF transformation
pst.save(RefreshMode.REFRESH);
}
/**
* Create {@link PublishTemplate}
*
* @param objectStore {@link ObjectStore}
* @param publishStyleTemplate {@link PublishStyleTemplate}
* @param description description
*/
public void createPublishTemplate(final ObjectStore objectStore, final PublishStyleTemplate publishStyleTemplate, final String description) {
// Create a publish template object.
PublishTemplate pt = Factory.PublishTemplate.createInstance(objectStore);
pt.set_StyleTemplate(publishStyleTemplate);
// Set document title for the publish template
pt.getProperties().putValue("DocumentTitle", description);
pt.set_Description("test_PublishTemplate");
// Is there a cascade delete dependency between source document and publication?
boolean isSourceDependency = true;
// isSourceDependency is a boolean variable that specifies whether the user wants
// to delete the publication automatically when the source is deleted. It is whichever value
// (true or false) the user chooses.
String VALUE_ISSOURCEDEPENDENCY = isSourceDependency ? "true" : "false";
// Publish template content.
String PT_CONTENT =
"<?xml version='1.0'?>" +
"<publishtemplatecontent>" +
"<version>2.0.1</version>" +
"<newinstructions>" +
"<issourcedependent>" + VALUE_ISSOURCEDEPENDENCY + "</issourcedependent>" +
"<outputfolderid>" + "B0FA3471-0000-CD1D-9D5E-B1E6E5E82135" + "</outputfolderid>" +
"<applyproperties><from>source</from></applyproperties>" +
"<applysecurity><from>default</from></applysecurity>" +
"</newinstructions>" +
"<republishinstructions>" +
"<versionablerepublishtype>versionandkeep</versionablerepublishtype>" +
"<nonversionablerepublishtype>addandkeep</nonversionablerepublishtype>" +
"<applypropertiesfrom>destination</applypropertiesfrom>" +
"<applysecurityfrom>destination</applysecurityfrom>" +
"</republishinstructions>" +
"</publishtemplatecontent>";
String[] PT_DATA = {"myNewPublishTemplate.xml", "application/x-filenet-publishtemplate", PT_CONTENT};
// Create content elements.
ContentElementList cel = Factory.ContentElement.createList();
ContentTransfer ctNew = Factory.ContentTransfer.createInstance();
ByteArrayInputStream is = new ByteArrayInputStream(PT_CONTENT.getBytes());
ctNew.setCaptureSource(is);
ctNew.set_RetrievalName(PT_DATA[0]);
ctNew.set_ContentType(PT_DATA[1]);
cel.add(ctNew);
pt.set_ContentElements(cel);
// Check in publish template as major version.
pt.checkin(AutoClassify.DO_NOT_AUTO_CLASSIFY, CheckinType.MAJOR_VERSION);
pt.save(RefreshMode.REFRESH);
}
/**
* Create {@link PublishRequest}
*
* @param objectStore
* @param document
* @param publishTemplate
* @return
*/
public PublishRequest createPublishRequest(
final ObjectStore objectStore,
final Document document,
final PublishTemplate publishTemplate) {
System.out.println(String.format("Document Id = %s", document.get_Id().toString()));
System.out.println(String.format("Document MimeType = %s", document.get_MimeType()));
System.out.println(String.format("Document Name = %s", document.get_Name()));
System.out.println(String.format("PublishTemplate Id = %s", publishTemplate.get_Id().toString()));
PublishStyleTemplate publishStyleTemplate = publishTemplate.get_StyleTemplate();
System.out.println(String.format("PublishStyleTemplate ProviderID = %s", publishStyleTemplate.get_ProviderID()));
StringList stringList = publishStyleTemplate.get_InputFormats();
Iterator iterator = stringList.iterator();
while(iterator.hasNext()) {
String inputFormat = (String) iterator.next();
System.out.println(String.format("PublishStyleTemplate InputFormat = %s", inputFormat));
}
String publishOpts = new String(
"<publishoptions><publicationname>"
+ document.get_Name()
+ "</publicationname></publishoptions>");
PublishRequest publishRequest = Factory.PublishRequest.createInstance(objectStore);
publishRequest.set_InputDocument(document);
publishRequest.set_PublishTemplate(publishTemplate);
publishRequest.setPublishOptions(publishOpts);
publishRequest.save(RefreshMode.REFRESH);
return publishRequest;
}
日志:2020-04-14T12:47:57.492 9F0B4BDE PUBL FNRCE0000E - 错误错误:读取 RenditionEngineConnection 抛出:发生意外异常。2020-04-14T12:47:57.493 9F0B4BDE PUBL FNRCE0000I - 信息 InvokeVista 异常:读取 RenditionEngineConnection 期间发生异常。2020-04-14T12:47:57.493 E0476562 PUBL FNRCE0066E - 错误分派 PublishRequest 行 {B0AB7771-0000-CA39-BFFD-BF7A84D30A96}\ncom.filenet.api.exception.EngineRuntimeException: FNRCE0066E: E_UNEXPECTED_EXCEPTION: n 在 com.filenet.engine.publish.PublishRequestPDFHandler.publishPDF(PublishRequestPDFHandler.java:435)\n 在 com.filenet.engine.publish.PublishRequestPDFHandler.execute(PublishRequestPDFHandler.java:169)\n 在 com.filenet.engine。发布.PublishRequestHandlerBase$1.run(PublishRequestHandlerBase.java:
解决方案
推荐阅读
- java - “继承”函数参数
- python - Pandas:dataframe.apply() - 在函数中包含单独的数据框
- php - 为数组中的每个项目运行 wp 元查询 arg
- c - 第 14 次重新分配时出现堆错误
- sql - 从 FOR XML PATH 函数中删除前导逗号
- ios - “不允许应用内购买”Testflight 用户尝试购买我的 IAP 时出现错误消息
- java - 使用默认浏览器按钮重新加载时转到原始 HTML
- twilio - 将 SIP 域呼叫转发到弹性 SIP 中继
- javascript - 多个实例时动态生成的 jQuery 函数停止工作
- ios - 应用程序崩溃原因:'-[HOV1.itemShowViewController collectionView:numberOfItemsInSection:]: unrecognized selector sent to instance 0x7fcc8f6a1320'