Eddie Epstein wrote:
Hi Jörn,
From CVD I can repeatedly run aggregates containing cas mutiplier
delegates. Can you be more specific about the scenario? For example,
are you re-instantiating the AE between runs? Would it be easy for you
to make a minimal code sample that demonstrates the problem?
Here is my code which interacts with the PEAR Api. Maybe it differs a bit
from the usual use case, because I also instantiate a CollectionReader.
Errors occurs if this code is run twice.
BTW, is it safe it run it concurrently in multiple threads for different
pears ?
In the case it failed it did not run concurrently, but it is possible
that is run the second time in a different thread.
I can try to make a minimal code sample, but maybe you see something
wrong in my interaction with UIMA.
Jörn
PackageBrowser instPear =
PackageInstaller.installPackage(...);
ResourceManager rsrcMgr = UIMAFramework
.newDefaultResourceManager();
InstallationDescriptor instDesc =
instPear.getInstallationDescriptor();
XMLInputSource in = new XMLInputSource(instPear
.getComponentPearDescPath());
ResourceSpecifier specifier = UIMAFramework.getXMLParser()
.parseResourceSpecifier(in);
AnalysisEngine ae = UIMAFramework.produceAnalysisEngine(
specifier, rsrcMgr, null);
rsrcMgr = UIMAFramework.newDefaultResourceManager();
rsrcMgr.setExtensionClassPath(instPear.getComponentPearDescPath() + ":"
+ instPear.buildComponentClassPath(), false);
XMLInputSource collectionReaderIn = new XMLInputSource(
instDesc.getMainCollIteratorDesc());
ResourceSpecifier colReaderSpecifier =
UIMAFramework.getXMLParser().parseResourceSpecifier(collectionReaderIn);
Thread.currentThread().setContextClassLoader(rsrcMgr.getExtensionClassLoader());
CollectionReader colReader =
UIMAFramework.produceCollectionReader(colReaderSpecifier, rsrcMgr, null);
colReader.typeSystemInit(ae.newCAS().getTypeSystem());
CAS cas = ae.newCAS();
while (colReader.hasNext()) {
colReader.getNext(cas);
ae.process(cas);
cas.reset();
}
isCompletingCollectionProcessing = true;
ae.collectionProcessComplete();