Hi Eddie, Thanks for the suggestion. I have limited time to work on this so my response may be slow now and again, but I'm still working on it. Your input is very much appreciated!
First of all, the command:
runRemoteAsyncAE.sh/cmd tcp://localhost:61616
MeetingDetectorTaeQueue \
-d Deploy_MeetingDetectorTAE.xml \
-c
$UIMA_HOME/examples/descriptors/collection_reader/FileSystemCollectionR
eader.xml
completes without any errors, so the example seems to be running fine.
I've been fiddling around with it and I was able to pinpoint the problem to
the collection reader. I have a collection reader (subclassed from
CollectionReader_ImplBase) that is added to the AsynchronousEngine.
However, it does not seem to be the specific implementation.
I've reduced all code / annotators etc to a very basic set that still shows
the problem, where the AE only has one (very basic) annotator and the
Collection Reader actually doesn't do anything except stating that there's
nothing left to do.
I'll attach the Minimum Working Examples (or actually, not-working
examples) that I've constructed to pinpoint the problem.
Commenting out line 62 (the call to setCollectionReader) 'fixes' the
problem. However, as you can see, the implementation of MWEReader
doesn't do anything at all, so I don't really see why it would cause this
trouble.
Any ideas on what is causing this problem?
Thanks,
Egbert
On Monday, July 28, 2014 05:14:39 PM Eddie Epstein wrote:
> Hi Egbert,
>
> The README file for UIMA-AS shows an application example with
> Deploy_MeetingDetectorTAE.xml.Does that run OK for you?
>
> Assuming yes, can you give more details about the scenario, perhaps
the
> explicit commands used? The descriptors used?
>
> Eddie
>
>
>
> On Mon, Jul 28, 2014 at 11:46 AM, Egbert van der Wal
<[email protected]>
>
> wrote:
> > Hi,
> >
> > I'm trying to convert an existing and functional UIMA pipeline to a UIMA
> > AS pipeline.
> >
> >
> >
> > I'm getting there, I created deployment descriptors for the annotators
and
> > when running my application all individual annotators are launched
> > correctly. The composite analysis engine also loads fine but I'm getting
a
> > NullPointerException when calling initialize(deployCtx) on the
> > UimaAsEngine
> > on line 66. See the attached text document for the full exception.
> >
> >
> >
> >
> >
> > I found a similar issue in the bug tracker which was fixed in UIMA AS
2.3:
> >
> >
> >
> > https://issues.apache.org/jira/browse/UIMA-1376
> >
> >
> >
> > But this seems to arise in mergeTypeSystem and this does not seem
to be
> > the case in my situation. The line number is the same however.
> >
> >
> >
> > Any clues on where I should look for the solution? Are my descriptors
> > faulty? Is the Java code faulty? Or is this a bug in UIMA AS 2.4.0? How
> > can
> > I debug this issue?
> >
> >
> >
> > Thanks,
> >
> >
> >
> > Egbert
package nl.novay.keywordSpotter;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import org.apache.uima.aae.client.UimaAsynchronousEngine;
import org.apache.uima.adapter.jms.client.BaseUIMAAsynchronousEngine_impl;
public class MWE
{
public static void main(String [] args)
{
MWE engine = new MWE();
try
{
engine.initializeEngine();
}
catch (Exception e)
{}
}
private UimaAsynchronousEngine ae;
private MWEReader reader;
protected void initializeEngine() throws Exception
{
reader = new MWEReader();
// preparing map for use in deploying services
Map<String,Object> deployCtx = new HashMap<String,Object>();
deployCtx.put(UimaAsynchronousEngine.DD2SpringXsltFilePath, System.getenv("UIMA_HOME") + "/bin/dd2spring.xsl");
deployCtx.put(UimaAsynchronousEngine.SaxonClasspath, "file:" + System.getenv("UIMA_HOME") + "/saxon/saxon8.jar");
// Set up paths
String base_path = "./";
String deploy_path = base_path + "desc/deployment/";
String ae_path = base_path + "desc/analysis_engines/Deploy";
String engine = "MWEEngine.xml";
// Initialize the UIMA AS Engine
ae = new BaseUIMAAsynchronousEngine_impl();
System.setProperty("defaultBrokerURL", "tcp://localhost:61616");
// Iterate over all to-be-deployed annotators
String filenames [] = {
"DeployRegExp.xml"
};
for (String filename : filenames)
{
File file = new File(deploy_path + filename);
System.out.println("Deploying UIMA AS Annotator: " + file.getName());
ae.deploy(file.getAbsolutePath(), deployCtx);
System.out.println("Deployed UIMA AS Annotator: " + file.getName() + "\n\n\n\n");
}
System.out.println("Deploying UIMA AS Annotation Engine: " + engine);
ae.deploy(ae_path + engine, deployCtx);
System.out.println("Attaching collection reader to AS Engine: " + reader);
ae.setCollectionReader(reader);
System.out.println("Initializing AS Engine");
deployCtx.put(UimaAsynchronousEngine.ServerUri, "tcp://localhost:61616");
deployCtx.put(UimaAsynchronousEngine.Endpoint, "MWEQueue");
deployCtx.put(UimaAsynchronousEngine.CasPoolSize, 2);
ae.initialize(deployCtx);
}
}
package nl.novay.keywordSpotter;
import java.io.IOException;
import org.apache.uima.cas.CAS;
import org.apache.uima.collection.CollectionException;
import org.apache.uima.collection.CollectionReader_ImplBase;
import org.apache.uima.util.Progress;
import org.apache.uima.util.ProgressImpl;
public class MWEReader extends CollectionReader_ImplBase
{
@Override
public void initialize()
{}
@Override
public boolean hasNext()
{
return false;
}
@Override
public void getNext(CAS cas) throws IOException, CollectionException
{
if (true)
throw new CollectionException(new Exception("Not implemented"));
}
@Override
public Progress[] getProgress()
{
return new Progress[]{new ProgressImpl(0, 0, Progress.ENTITIES)};
}
@Override
public void close() throws IOException
{}
}
DeployMWEEngine.xml
Description: XML document
MWEEngine.xml
Description: XML document
DeployRegExp.xml
Description: XML document
RegExpTokenizer.xml
Description: XML document
