Thanks a lot for your help. I downloaded the UUTUC library and tried to use it and realized that I have a problem. Since I am using a PEAR descriptor, I could not directly use its path as argument to the AnalysisEngineFactory.createAnalysisEngineFromPath method.
So I digged a little and got the path to the main component descriptor for the PEAR. I used its path as input to AnalysisEngineFactory.createAnalysisEngineFromPath and it would have worked great except that I ran into resource loading issues for one of the AEs. It could not find a required resource present in the resources directory. (which it had not problem finding when I created the AE using UIMAFramework) I am guessing this is because when I use the UIMA Framework to produce an AE using a PEAR descriptor, it does some additional classpath setup based on the PEAR installer.xml. (This stuff happens in the PearAnalysisEngineWrapper.initialize method). I could replicate that code but I was wondering if that's the way to go and I'd rather get some confirmation from an expert. Could suggest anything else I could do. _______________ Girish Chavan, MSIS Department of Biomedical Informatics (DBMI) University of Pittsburgh -----Original Message----- From: Philip Ogren [mailto:[email protected]] Sent: Monday, July 27, 2009 1:43 PM To: [email protected] Subject: Re: Problem reconfiguring after setting a config parameter value Girish, It occurs to me that you might benefit from the factory methods provided by UUTUC. The code you were trying to use below is useful when you need to change configuration parameters between subsequent calls to the same analysis engine. However, if your real goal is to simply dynamically change the AnalysisEngineDescription before creating an AnalysisEngine out of it, then that is exactly the sort of thing UUTUC factory methods are good for. There are a number of factory methods, but you could accomplish what you need with something like: AnalysisEngineFactory.createAnalysisEngine("the.name.of.your.descriptor","ChunkCreaterClass", "Something") Philip Chavan, Girish wrote: > Hi All, > > I am still stuck here. My backup option is to alter the descriptor xml before > building an analysis engine with it, but it is kinda hacky, so was hoping for > a cleaner solution. Can any of the developers chime in? > > Thanks, > _______________ > Girish Chavan, MSIS > Department of Biomedical Informatics (DBMI) > University of Pittsburgh > > > > -----Original Message----- > From: Chavan, Girish [mailto:[email protected]] > Sent: Friday, July 24, 2009 11:01 AM > To: [email protected] > Subject: Problem reconfiguring after setting a config parameter value > > Hi All, > > I am using the following code to set the value for the 'ChunkCreaterClass' > parameter. I had to add line (2) because without it I was getting a > UIMA_IllegalStateException due to the session being null. I am not quite sure > if that is the way you set a new session. In any case I stopped getting that > error. But now I get a nullpointerexception error ( trace shown below the > code). > I had a breakpoint set in the > ConfigurationManagerImplBase.validateConfigurationParameterSettings method to > see what was happening. It entered the method multiple times to validate each > AEs params. The first set of calls was triggered after line (1). And it went > through smoothly. The next set was triggered after line (4) which threw an > exception immediately for the "/" context. Within the implementation of the > validateConfigurationParameterSettings method. I see that > ConfigurationParameterDeclarations comes up null for the "/" context. > > Not quite sure what I am doing wrong. Any ideas?? > > CODE: > (1)AnalysisEngine ae = UIMAFramework.produceAnalysisEngine(specifier); > (2)ae.getUimaContextAdmin().setSession(new Session_impl()); > (3)ae.setConfigParameterValue("ChunkCreaterClass", "Something"); > (4)ae.reconfigure(); > > Exception: > java.lang.NullPointerException > at > org.apache.uima.resource.impl.ConfigurationManagerImplBase.validateConfigurationParameterSettings(ConfigurationManagerImplBase.java:488) > at > org.apache.uima.resource.impl.ConfigurationManagerImplBase.reconfigure(ConfigurationManagerImplBase.java:235) > at > org.apache.uima.resource.ConfigurableResource_ImplBase.reconfigure(ConfigurableResource_ImplBase.java:70) > > > > Thanks. > _______________ > Girish Chavan, MSIS > Department of Biomedical Informatics (DBMI) > University of Pittsburgh > UPMC Cancer Pavilion, 302D > 5150 Centre Avenue > Pittsburgh, PA 15232 > Office: 412-623-4084 > Email: [email protected] > > ------------------------------------------------------------------------ > > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 8.5.392 / Virus Database: 270.13.27/2258 - Release Date: 07/24/09 > 05:58:00 > >
