You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@uima.apache.org by Martin Wunderlich <ma...@gmx.net> on 2015/07/11 10:18:30 UTC

NPE when trying to get casProcessors from CPE description

Hi  all, 

I am  trying to run a pair-wise classification experiment using the DKPro TC framework. The execution fails during the meta-info stage due to a NullPointerException that originates in the CpeBuilder class from UIMAfit v.2.1.0 (hence the post to this list and not the DKpro list). I had a closer look at the code and the NPE is triggered at the following line in the CpeBuilder: 

cpeDesc.getCpeCasProcessors().setPoolSize(maxProcessingUnitThreadCount + 2);

The underlying root cause is that the casProcessors object returned by the call to cpeDesc is Null, but I don’t understand why. The cpeDesc lists a number of fields as having Null values: 

org.apache.uima.collection.impl.metadata.cpe.CpeDescriptionImpl: 
casInitializer = NULL
configParameterSettings = NULL
configurationParameterSettings = NULL
import = NULL
sofaNameMappings = NULL
configurationParameterSettings = NULL
cpeCasProcessors = NULL
outputQueue = NULL
startAt = NULL
startingEntityId = NULL


Unfortunately, I am not too familiar with the inner workings of the UIMA(fit) framework so I am not sure how, why and where these fields were set to Null. 
Could someone perhaps point me in the right direction where I should dig deeper to identify the cause for this problem? 

Thanks a lot. 

Cheers, 

Martin
 

Re: NPE when trying to get casProcessors from CPE description

Posted by Martin Wunderlich <ma...@gmx.net>.
Hi, 

I just want to briefly reveal how this situation has been resolved. 

First, Richard was so kind to contact me via chat to check the Maven dependencies. We discovered that two different versions of DKPro Lab were referenced (one of them rather indirectly, from the similarity project). Richard quickly resolved this with a commit and I re-installed the snapshot version locally. However, this didn’t fix this situation listed below. But kudos to Richard who helped out and made me feel less lonely on this hot summer sunday. 

As a next step, I tried to isolate the problem. So, I cloned the TC github repo, imported that into a new Eclipse workspace and ran the example there. This worked. So, I figured it might be something in my particular workspace arrangement. I had my forked TC project loaded there, which I now set to the master branch of the original repo’s snapshot version. This didn’t help either. Then, I re-installed the newly cloned version using maven install, removed the TC project from the eclipse workspace, imported only the examples project and ran the example again. Now it worked. I went back to my actual project and - lo and behold - the pair-wise classification now worked, too. 

I still don’t know what caused the problem. It might have been some of my code changes or config changes to the forked copy of the project. Anyway, I am documenting this here in case someone else runs into a similar situation. 

Cheers, 

Martin
 

> Am 12.07.2015 um 16:39 schrieb Martin Wunderlich <ma...@gmx.net>:
> 
> As a side-note*, the problem does not occur when I run the experiment from the branch of the 0.7.0 tag version of DKPro TC. In that version, PairTwentyNewsgroupsDemo runs fine without the NPE. Not sure, if this observation adds to the clarification or rather to the confusion. 
> 
> Cheers, 
> 
> Martin
> 
> * (and we should probably move this conversation to the DKpro list, which I am putting on CC now, so feel free to respond there)
>  
> 
>> Am 12.07.2015 um 13:23 schrieb Martin Wunderlich <martin_wu@gmx.net <ma...@gmx.net>>:
>> 
>> Hi Richard, 
>> 
>> I have based this experiment on the PairTwentyNewsgroupsDemo from the DKPro examples. The CPE would be build during the experiment execution, I guess. 
>> 
>> I have just tried to re-run the example, but now I am getting the same exception: 
>> (using the 0.8.0 snapshort version of TC). 
>> 
>> 2015-07-12 11:01:31 DEBUG [main] (DefaultLoggingService) - [MetaInfoTask-TwentyNewsgroupsTrainTest-966ab1a7-2874-11e5-b53c-37fcf6476d26] Problem stack trace:
>> java.lang.NullPointerException
>> 	at org.apache.uima.fit.cpe.CpeBuilder.createCpe(CpeBuilder.java:159)
>> 	at de.tudarmstadt.ukp.dkpro.lab.uima.engine.cpe.CpeExecutionEngine.run(CpeExecutionEngine.java:93)
>> 	at de.tudarmstadt.ukp.dkpro.lab.task.impl.BatchTask.runNewExecution(BatchTask.java:350)
>> 	at de.tudarmstadt.ukp.dkpro.lab.task.impl.BatchTask.executeConfiguration(BatchTask.java:255)
>> 	at de.tudarmstadt.ukp.dkpro.lab.task.impl.BatchTask.execute(BatchTask.java:185)
>> 	at de.tudarmstadt.ukp.dkpro.tc.ml.ExperimentTrainTest.execute(ExperimentTrainTest.java:91)
>> 	at de.tudarmstadt.ukp.dkpro.lab.engine.impl.ExecutableTaskEngine.run(ExecutableTaskEngine.java:55)
>> 	at de.tudarmstadt.ukp.dkpro.lab.engine.impl.DefaultTaskExecutionService.run(DefaultTaskExecutionService.java:48)
>> 	at de.tudarmstadt.ukp.dkpro.lab.Lab.run(Lab.java:97)
>> 	at de.tudarmstadt.ukp.dkpro.tc.examples.single.pair.PairTwentyNewsgroupsDemo.runTrainTest(PairTwentyNewsgroupsDemo.java:147)
>> 	at de.tudarmstadt.ukp.dkpro.tc.examples.single.pair.PairTwentyNewsgroupsDemo.main(PairTwentyNewsgroupsDemo.java:84)
>> 
>> Cheers, 
>> 
>> Martin
>>  
>> 
>> 
>>> Am 11.07.2015 um 19:10 schrieb Richard Eckart de Castilho <rec@apache.org <ma...@apache.org>>:
>>> 
>>> Hi,
>>> 
>>> how to you build your CPE? The CAS processors should be set during setAnalysisEngine(...).
>>> 
>>> Cheers,
>>> 
>>> -- Richard 
>>> 
>>> On 11.07.2015, at 10:18, Martin Wunderlich <martin_wu@gmx.net <ma...@gmx.net>> wrote:
>>> 
>>>> Hi  all, 
>>>> 
>>>> I am  trying to run a pair-wise classification experiment using the DKPro TC framework. The execution fails during the meta-info stage due to a NullPointerException that originates in the CpeBuilder class from UIMAfit v.2.1.0 (hence the post to this list and not the DKpro list). I had a closer look at the code and the NPE is triggered at the following line in the CpeBuilder: 
>>>> 
>>>> cpeDesc.getCpeCasProcessors().setPoolSize(maxProcessingUnitThreadCount + 2);
>>>> 
>>>> The underlying root cause is that the casProcessors object returned by the call to cpeDesc is Null, but I don’t understand why. The cpeDesc lists a number of fields as having Null values: 
>>>> 
>>>> org.apache.uima.collection.impl.metadata.cpe.CpeDescriptionImpl: 
>>>> casInitializer = NULL
>>>> configParameterSettings = NULL
>>>> configurationParameterSettings = NULL
>>>> import = NULL
>>>> sofaNameMappings = NULL
>>>> configurationParameterSettings = NULL
>>>> cpeCasProcessors = NULL
>>>> outputQueue = NULL
>>>> startAt = NULL
>>>> startingEntityId = NULL
>>>> 
>>>> 
>>>> Unfortunately, I am not too familiar with the inner workings of the UIMA(fit) framework so I am not sure how, why and where these fields were set to Null. 
>>>> Could someone perhaps point me in the right direction where I should dig deeper to identify the cause for this problem? 
>>>> 
>>>> Thanks a lot. 
>>>> 
>>>> Cheers, 
>>>> 
>>>> Martin
>>> 
>> 
> 


Re: NPE when trying to get casProcessors from CPE description

Posted by Martin Wunderlich <ma...@gmx.net>.
As a side-note*, the problem does not occur when I run the experiment from the branch of the 0.7.0 tag version of DKPro TC. In that version, PairTwentyNewsgroupsDemo runs fine without the NPE. Not sure, if this observation adds to the clarification or rather to the confusion. 

Cheers, 

Martin

* (and we should probably move this conversation to the DKpro list, which I am putting on CC now, so feel free to respond there)
 

> Am 12.07.2015 um 13:23 schrieb Martin Wunderlich <ma...@gmx.net>:
> 
> Hi Richard, 
> 
> I have based this experiment on the PairTwentyNewsgroupsDemo from the DKPro examples. The CPE would be build during the experiment execution, I guess. 
> 
> I have just tried to re-run the example, but now I am getting the same exception: 
> (using the 0.8.0 snapshort version of TC). 
> 
> 2015-07-12 11:01:31 DEBUG [main] (DefaultLoggingService) - [MetaInfoTask-TwentyNewsgroupsTrainTest-966ab1a7-2874-11e5-b53c-37fcf6476d26] Problem stack trace:
> java.lang.NullPointerException
> 	at org.apache.uima.fit.cpe.CpeBuilder.createCpe(CpeBuilder.java:159)
> 	at de.tudarmstadt.ukp.dkpro.lab.uima.engine.cpe.CpeExecutionEngine.run(CpeExecutionEngine.java:93)
> 	at de.tudarmstadt.ukp.dkpro.lab.task.impl.BatchTask.runNewExecution(BatchTask.java:350)
> 	at de.tudarmstadt.ukp.dkpro.lab.task.impl.BatchTask.executeConfiguration(BatchTask.java:255)
> 	at de.tudarmstadt.ukp.dkpro.lab.task.impl.BatchTask.execute(BatchTask.java:185)
> 	at de.tudarmstadt.ukp.dkpro.tc.ml.ExperimentTrainTest.execute(ExperimentTrainTest.java:91)
> 	at de.tudarmstadt.ukp.dkpro.lab.engine.impl.ExecutableTaskEngine.run(ExecutableTaskEngine.java:55)
> 	at de.tudarmstadt.ukp.dkpro.lab.engine.impl.DefaultTaskExecutionService.run(DefaultTaskExecutionService.java:48)
> 	at de.tudarmstadt.ukp.dkpro.lab.Lab.run(Lab.java:97)
> 	at de.tudarmstadt.ukp.dkpro.tc.examples.single.pair.PairTwentyNewsgroupsDemo.runTrainTest(PairTwentyNewsgroupsDemo.java:147)
> 	at de.tudarmstadt.ukp.dkpro.tc.examples.single.pair.PairTwentyNewsgroupsDemo.main(PairTwentyNewsgroupsDemo.java:84)
> 
> Cheers, 
> 
> Martin
>  
> 
> 
>> Am 11.07.2015 um 19:10 schrieb Richard Eckart de Castilho <rec@apache.org <ma...@apache.org>>:
>> 
>> Hi,
>> 
>> how to you build your CPE? The CAS processors should be set during setAnalysisEngine(...).
>> 
>> Cheers,
>> 
>> -- Richard 
>> 
>> On 11.07.2015, at 10:18, Martin Wunderlich <martin_wu@gmx.net <ma...@gmx.net>> wrote:
>> 
>>> Hi  all, 
>>> 
>>> I am  trying to run a pair-wise classification experiment using the DKPro TC framework. The execution fails during the meta-info stage due to a NullPointerException that originates in the CpeBuilder class from UIMAfit v.2.1.0 (hence the post to this list and not the DKpro list). I had a closer look at the code and the NPE is triggered at the following line in the CpeBuilder: 
>>> 
>>> cpeDesc.getCpeCasProcessors().setPoolSize(maxProcessingUnitThreadCount + 2);
>>> 
>>> The underlying root cause is that the casProcessors object returned by the call to cpeDesc is Null, but I don’t understand why. The cpeDesc lists a number of fields as having Null values: 
>>> 
>>> org.apache.uima.collection.impl.metadata.cpe.CpeDescriptionImpl: 
>>> casInitializer = NULL
>>> configParameterSettings = NULL
>>> configurationParameterSettings = NULL
>>> import = NULL
>>> sofaNameMappings = NULL
>>> configurationParameterSettings = NULL
>>> cpeCasProcessors = NULL
>>> outputQueue = NULL
>>> startAt = NULL
>>> startingEntityId = NULL
>>> 
>>> 
>>> Unfortunately, I am not too familiar with the inner workings of the UIMA(fit) framework so I am not sure how, why and where these fields were set to Null. 
>>> Could someone perhaps point me in the right direction where I should dig deeper to identify the cause for this problem? 
>>> 
>>> Thanks a lot. 
>>> 
>>> Cheers, 
>>> 
>>> Martin
>> 
> 


Re: NPE when trying to get casProcessors from CPE description

Posted by Martin Wunderlich <ma...@gmx.net>.
Hi Richard, 

I have based this experiment on the PairTwentyNewsgroupsDemo from the DKPro examples. The CPE would be build during the experiment execution, I guess. 

I have just tried to re-run the example, but now I am getting the same exception: 
(using the 0.8.0 snapshort version of TC). 

2015-07-12 11:01:31 DEBUG [main] (DefaultLoggingService) - [MetaInfoTask-TwentyNewsgroupsTrainTest-966ab1a7-2874-11e5-b53c-37fcf6476d26] Problem stack trace:
java.lang.NullPointerException
	at org.apache.uima.fit.cpe.CpeBuilder.createCpe(CpeBuilder.java:159)
	at de.tudarmstadt.ukp.dkpro.lab.uima.engine.cpe.CpeExecutionEngine.run(CpeExecutionEngine.java:93)
	at de.tudarmstadt.ukp.dkpro.lab.task.impl.BatchTask.runNewExecution(BatchTask.java:350)
	at de.tudarmstadt.ukp.dkpro.lab.task.impl.BatchTask.executeConfiguration(BatchTask.java:255)
	at de.tudarmstadt.ukp.dkpro.lab.task.impl.BatchTask.execute(BatchTask.java:185)
	at de.tudarmstadt.ukp.dkpro.tc.ml.ExperimentTrainTest.execute(ExperimentTrainTest.java:91)
	at de.tudarmstadt.ukp.dkpro.lab.engine.impl.ExecutableTaskEngine.run(ExecutableTaskEngine.java:55)
	at de.tudarmstadt.ukp.dkpro.lab.engine.impl.DefaultTaskExecutionService.run(DefaultTaskExecutionService.java:48)
	at de.tudarmstadt.ukp.dkpro.lab.Lab.run(Lab.java:97)
	at de.tudarmstadt.ukp.dkpro.tc.examples.single.pair.PairTwentyNewsgroupsDemo.runTrainTest(PairTwentyNewsgroupsDemo.java:147)
	at de.tudarmstadt.ukp.dkpro.tc.examples.single.pair.PairTwentyNewsgroupsDemo.main(PairTwentyNewsgroupsDemo.java:84)

Cheers, 

Martin
 


> Am 11.07.2015 um 19:10 schrieb Richard Eckart de Castilho <re...@apache.org>:
> 
> Hi,
> 
> how to you build your CPE? The CAS processors should be set during setAnalysisEngine(...).
> 
> Cheers,
> 
> -- Richard 
> 
> On 11.07.2015, at 10:18, Martin Wunderlich <ma...@gmx.net> wrote:
> 
>> Hi  all, 
>> 
>> I am  trying to run a pair-wise classification experiment using the DKPro TC framework. The execution fails during the meta-info stage due to a NullPointerException that originates in the CpeBuilder class from UIMAfit v.2.1.0 (hence the post to this list and not the DKpro list). I had a closer look at the code and the NPE is triggered at the following line in the CpeBuilder: 
>> 
>> cpeDesc.getCpeCasProcessors().setPoolSize(maxProcessingUnitThreadCount + 2);
>> 
>> The underlying root cause is that the casProcessors object returned by the call to cpeDesc is Null, but I don’t understand why. The cpeDesc lists a number of fields as having Null values: 
>> 
>> org.apache.uima.collection.impl.metadata.cpe.CpeDescriptionImpl: 
>> casInitializer = NULL
>> configParameterSettings = NULL
>> configurationParameterSettings = NULL
>> import = NULL
>> sofaNameMappings = NULL
>> configurationParameterSettings = NULL
>> cpeCasProcessors = NULL
>> outputQueue = NULL
>> startAt = NULL
>> startingEntityId = NULL
>> 
>> 
>> Unfortunately, I am not too familiar with the inner workings of the UIMA(fit) framework so I am not sure how, why and where these fields were set to Null. 
>> Could someone perhaps point me in the right direction where I should dig deeper to identify the cause for this problem? 
>> 
>> Thanks a lot. 
>> 
>> Cheers, 
>> 
>> Martin
> 


Re: NPE when trying to get casProcessors from CPE description

Posted by Richard Eckart de Castilho <re...@apache.org>.
Hi,

how to you build your CPE? The CAS processors should be set during setAnalysisEngine(...).

Cheers,

-- Richard 

On 11.07.2015, at 10:18, Martin Wunderlich <ma...@gmx.net> wrote:

> Hi  all, 
> 
> I am  trying to run a pair-wise classification experiment using the DKPro TC framework. The execution fails during the meta-info stage due to a NullPointerException that originates in the CpeBuilder class from UIMAfit v.2.1.0 (hence the post to this list and not the DKpro list). I had a closer look at the code and the NPE is triggered at the following line in the CpeBuilder: 
> 
> cpeDesc.getCpeCasProcessors().setPoolSize(maxProcessingUnitThreadCount + 2);
> 
> The underlying root cause is that the casProcessors object returned by the call to cpeDesc is Null, but I don’t understand why. The cpeDesc lists a number of fields as having Null values: 
> 
> org.apache.uima.collection.impl.metadata.cpe.CpeDescriptionImpl: 
> casInitializer = NULL
> configParameterSettings = NULL
> configurationParameterSettings = NULL
> import = NULL
> sofaNameMappings = NULL
> configurationParameterSettings = NULL
> cpeCasProcessors = NULL
> outputQueue = NULL
> startAt = NULL
> startingEntityId = NULL
> 
> 
> Unfortunately, I am not too familiar with the inner workings of the UIMA(fit) framework so I am not sure how, why and where these fields were set to Null. 
> Could someone perhaps point me in the right direction where I should dig deeper to identify the cause for this problem? 
> 
> Thanks a lot. 
> 
> Cheers, 
> 
> Martin