Re: UIMA AS NullPointerException in CasDefinition constructor

2014-08-04 Thread Eddie Epstein
Hi,

Very good. The Deploy_MeetingDetectorTAE.xml does not have a CR in the
aggregate either. It is designed to be used with a driver as you have done,
or by plugging a CR into the UimaAsynchronousEngine as is done in the
README example. This approach is scalable by increasing the number of
processing threads in the deployment descriptor, and by launching
additional instances of the service

Another example that plugs a CR directly into an AE, also referenced in
README, is
 $UIMA_HOME/examples/deploy/as/MeetingFinderAggregate.xml
 $UIMA_HOME/examples/deploy/as/Deploy_MeetingFinder.xml
This approach fits better the scaling model used by DUCC, where individual
services have a CasMultiplier at the front of each service.

Eddie





On Mon, Aug 4, 2014 at 10:52 AM, Egbert van der Wal 
wrote:

> Just to post an update on my own message:
>
> In the full version, I was able to fix it by not adding the Collection
> Reader to
> the AsychronousEngine but just initializing it without and afterwards doing
> it manually:
>
> reader.initialize();
> while (reader.hasNext())
>   ae.sendCAS(reader.getNext(ae.getCAS()));
>
> instead of just calling:
>
> ae.process();
>
> makes it work as it should. So it seems that in my situation, there is a
> problem with adding the CollectionReader to the engine. Not such a big
> deal as my new approach works, but it would be nice to use the
> CollectionReader as it's meant to be used.
>
> Thanks for any suggestions!
>
> Regards,
>
> Egbert
>
>
> On Monday, August 04, 2014 02:07:18 PM you wrote:
> > 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
> >
> > 
> >
> > > 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.
> > > >
> > > >
> > > >
>


Re: UIMA AS NullPointerException in CasDefinition constructor

2014-08-04 Thread Egbert van der Wal
Just to post an update on my own message:

In the full version, I was able to fix it by not adding the Collection Reader 
to 
the AsychronousEngine but just initializing it without and afterwards doing 
it manually:

reader.initialize();
while (reader.hasNext())
  ae.sendCAS(reader.getNext(ae.getCAS()));

instead of just calling:

ae.process();

makes it work as it should. So it seems that in my situation, there is a 
problem with adding the CollectionReader to the engine. Not such a big 
deal as my new approach works, but it would be nice to use the 
CollectionReader as it's meant to be used.

Thanks for any suggestions!

Regards,

Egbert


On Monday, August 04, 2014 02:07:18 PM you wrote:
> 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
> 
> 
> 
> > 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.
> > > 
> > > 
> > > 

Re: UIMA AS NullPointerException in CasDefinition constructor

2014-08-04 Thread Egbert van der Wal
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 

> 
> 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 deployCtx = new HashMap();
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.p