uima-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Murphy, Sean P." <Murphy.S...@mayo.edu>
Subject [jira] Pear installer classloader losing UIMA ResourceManager extensions classpath
Date Mon, 13 Sep 2010 16:52:43 GMT
I hope this is the correct forum for this type of discussion.  I found
similar issues being covered here, so I thought I'd give it a try.

Background:  I'm trying to get the same behavior from an analysis engine
code whether run from the eclipse environment or via the pear installer
with the CVD verification step.  This will ensure that the user has
correctly set up the environment using the default submitted component
AE.  

The only way to have common code used for both environments is to
leverage the visibility of the uima.datapath via the UimaContext during
the initialize method.  Apparently, the CLASSPATH set in the pear
install.xml for the project isn't available as far as I can tell, so it
is necessary to use the 'aContext.getDatapath' to set the extension
class path used by the ResourceManager (ResMgr) instance
(UIMAFramework.newDefaultResourceManager()).   

Any subsequent AnalysisEngine setup during initialization will use the
ResMgr extension classpath as seen in the following (This works fine for
taeStep1 and taeStep2 below):

        ResMgr.setExtensionClassPath(aContext.getDataPath(), true);

        taeStep1 =
UIMAFramework.produceAnalysisEngine(taeSpecifierStep1, ResMgr, null);
        taeStep2 =
UIMAFramework.produceAnalysisEngine(taeSpecifierStep2, ResMgr, null);
        jcas_local =
CasCreationUtils.createCas(taeStep1.getAnalysisEngineMetaData()).getJCas
();

Problem:  When running the 'process(JCas jcas) from this same class,
neither 'jcas_local' or the ResMgr has access to the classpath provided
in the 'initialize'.  Within the 'process' neither jcas nor jcas_local
apparently is using the extension classpath.  I suspect that 'ResMgr' is
either being reset or somehow lost in the scope when run from the pear
installer, since the classloader is missing resources and classes when
accessed w/in the process method.  As an experiment I ran
ResMgr.getDataPath() w/in a System.out.println from both the Eclipse
launch and the pear installer.  The expected datapath was produced in
Eclipse and 'null' is being returned for the pear installer.


Error: The actual error being thrown is as follows:
        at java.lang.Thread.run(Thread.java:595)
Caused by: org.apache.uima.cas.CASRuntimeException: The JCAS cover class
"edu.mayo.bmi.smoking.i2b2.type.RecordSentence_Type" could not be
loaded.
        at org.apache.uima.jcas.impl.JCasImpl.getType(JCasImpl.java:417)
        at org.apache.uima.jcas.cas.TOP.<init>(TOP.java:92)
        at
org.apache.uima.jcas.cas.AnnotationBase.<init>(AnnotationBase.java:53)
        at
org.apache.uima.jcas.tcas.Annotation.<init>(Annotation.java:54)
        at
edu.mayo.bmi.smoking.i2b2.type.RecordSentence.<init>(RecordSentence.java
:42)
        at
edu.mayo.bmi.smoking.ae.ClassifiableEntries.process(ClassifiableEntries.
java:334)
        ... 13 more


Can anyone tell me how I can get the classloader to use the same version
from the process method?

	Thanks,
		~Sean

Sean Murphy
> Senior Analyst/Programmer
> Department  of Information Technology
> Phone: 507-284-9348
>  
> 
> Mayo Clinic
> 200 First Street SW
> Rochester, MN 55905
> www.mayoclinic.org <http://www.mayoclinic.org/> 
> 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message