AnsweredAssumed Answered

Exception Triggered while generating renditions programmat..

Question asked by muru on Mar 31, 2010
Hi,
We ported the working code from one Alfresco environment(3.1) to another environment.We used the same configuration for both the environments. Following Exception triggered while generating the renditions programmatically in the new environment,This exception occurs all the time (Not intermittent)

Exception Message: A channel has already been opened

The stackTrace attached below:
A channel has already been opened
org.alfresco.repo.content.AbstractContentReader.getReadableChannel(AbstractContentReader.java:224)
org.alfresco.repo.content.AbstractContentReader.getContentInputStream(AbstractContentReader.java:330)
org.alfresco.repo.template.ClassPathRepoTemplateLoader$RepoTemplateSource.getReader(ClassPathRepoTemplateLoader.java:253)
org.alfresco.repo.template.ClassPathRepoTemplateLoader.getReader(ClassPathRepoTemplateLoader.java:108)
freemarker.cache.TemplateCache.loadTemplate(TemplateCache.java:452)
freemarker.cache.TemplateCache.getTemplate(TemplateCache.java:361)
freemarker.cache.TemplateCache.getTemplate(TemplateCache.java:235)
freemarker.template.Configuration.getTemplate(Configuration.java:487)
freemarker.template.Configuration.getTemplate(Configuration.java:452)
org.alfresco.repo.template.FreeMarkerProcessor.process(FreeMarkerProcessor.java:194)
net.comcast.cim.cms.repo.util.CIMWebFormUtil.renderAsset(CIMWebFormUtil.java:737
)net.comcast.cim.cms.webscripts.content.helper.ScheduleHelper.publish(ScheduleHelper.java:259)
net.comcast.cim.cms.webscripts.content.ContentWebScript.scheduleImmediately(ContentWebScript.java:226)
net.comcast.cim.cms.webscripts.content.ContentWebScript.scheduleTransactionCall(ContentWebScript.java:266)
net.comcast.cim.cms.webscripts.content.ContentWebScript.access$100(ContentWebScript.java:47)
net.comcast.cim.cms.webscripts.content.ContentWebScript$1.execute(ContentWebScript.java:164
)org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:322)
org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:229)
net.comcast.cim.cms.webscripts.content.ContentWebScript.execute(ContentWebScript.java:178)
org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:305)
org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:390)
org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:273)
org.alfresco.web.scripts.AbstractRuntime.executeScript(AbstractRuntime.java:261)
org.alfresco.web.scripts.AbstractRuntime.executeScript(AbstractRuntime.java:139


The Block of the Code which Triggers the Exception is given below
Writer out = new OutputStreamWriter(os);

// Create the model that will be used for the freemarker rendition
Map<QName, Object> ftlModel = buildModel(serviceRegistry, assetInfo, assetNode, AVMNodeConverter.ToAVMVersionPath(assetNode).getSecond(), renditionFile, req, xmlDoc);
// Convert the model to the freemarker readable format
TemplateHashModel templateHashModel = convertModel(ftlModel);
LOG.debug("Created FTL template model.");

#######EXCEPTION OCCURS HERE#########
proc.process(templateNode.toString(), templateHashModel, out);

LOG.debug("Processed FTL template.");

// Close the file
out.flush();
out.close();



Whether we missed any config changes?

Thanks
Muru

Outcomes