Marshall Schor <msa@...> writes:

> 
> Hi Peter,
> 
> Thanks for pointing this out.  I checked, and did see it there (in
> analysis_engine/primitive/DictTerm.xml)
> 
> So, to make this work, you have to change the spot where this is referenced,
> from trying to reference:
> 
>   "org/apache/uima/conceptMapper/DictTerm.xml" (won't be found in the jar at
> that spot) to
>   "analysis_engine/primitive/DictTerm.xml"  (where it is in the Jar)
> 
> if you want to reference that embedded copy. 
> 
> I'm not sure that's the proper way to do this, though... 
> I hope the documentation (
>
http://uima.apache.org/d/uima-addons-current/ConceptMapper/ConceptMapperAnnotatorUserGuide.html
> ) for this can be of help.
> 
> -Marshall
> 
> On 2/11/2014 1:52 AM, Peter Litsegård wrote:
> > Hi Marshall!
> >
> > Hmmm, the DictTerm.xml file is present and I've tried to put it in a number
> > of places with no avail. I thought that the error might be a typo in the
> > exception handling of a class-loader exception. I know very farfecthed...:)
> >
> > Nevertheless DictTerm.xml exists in the "uima-an-conceptMapper.jar" file
> > under "analysis_engine.primitive" folder. Do you know what I need to do in
> > order for the DictTerm.xml file to be found?
> >
> >
> 
> 

Hi Marshall!

Thanks for trying to help me out here. The more I look into this the
trickier it gets...:(

Just to give you some additional background I've done the following:

1. downloaded the uima-core
2. downloaded the ConceptMapper.jar
3. referenced both of the above from my project

In my code I do the following:
                        XMLInputSource in = new
XMLInputSource("bin/descriptors/analysis_engine/
ConceptMapperOffsetTokenizer.xml");
                        ResourceSpecifier specifier =
UIMAFramework.getXMLParser().parseResourceSpecifier(in);
                        AnalysisEngine ae = UIMAFramework.
produceAnalysisEngine(specifier);

When I try to invoke the 'produceAnalysisEngine(...)' 
method above I get the following error:

"...Caused by: org.apache.uima.util.InvalidXMLException: 
An import could not be resolved.  No file with name 
"org/apache/uima/conceptMapper/DictTerm.xml"
was found in the class path or data path. (Descriptor:
file:/C:/.../ConceptMapperOffsetTokenizer.xml)
        at
org.apache.uima.resource.metadata.impl.Import_impl.findAbsoluteUrl
(Import_impl.java:115)
        at
org.apache.uima.resource.metadata.impl.TypeSystemDescription_impl
.resolveImports(TypeSystemDescription_impl.java:220)
        at
org.apache.uima.resource.metadata.impl.TypeSystemDescription_impl
.resolveImports(TypeSystemDescription_impl.java:202)
        at
org.apache.uima.analysis_engine.metadata.impl.
AnalysisEngineMetaData_impl.
resolveImports(AnalysisEngineMetaData_impl.java:87)
        at
org.apache.uima.resource.Resource_ImplBase.
initialize(Resource_ImplBase.java:129)"

I simply can't understand why I get these errors as I'm relying on the
defaults for the ConceptMapper and all the type systems are in place in the
jars. I'm far from an expert on UIMA BUT I would have thought this should be
pretty forward but no:( I thought the DictTerm.xml and TokenAnnotation.xml
etc were "simple" type system declarations and nothing else. Why would the
ConceptMapper want to use these as the types declared on those xmls have
already been "Cas generated" and their .class files are present in the CM-jar?

Sorry for the lengthy post but I want to be clear:)



Reply via email to