uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Juan Ignacio Velez <velez.juanigna...@gmail.com>
Subject Re: uimaFit Problem.
Date Fri, 28 Mar 2014 13:51:04 GMT
Hi, i find the solution. I have to put the descriptors folder  into the
project root. Then i change the the configuration of the classpath, in the
"includes" field i aggregate the descriptors folder. In the "excludes"
field i put an "*". Then, i can call the descriptors directly from the
server. For example, my descriptor folder call "desc/" and inside the code
i call it like "desc/descriptor.xml".

Thanks!!

Juan.


2014-03-18 18:00 GMT-03:00 Richard Eckart de Castilho <rec@apache.org>:

> I understand that you are saying that
> TypeSystemDescriptionFactory.createTypeSystemDescription() [1]
> returns "null" for you. I cannot imagine how that could happen. This
> method should always
> return a TypeSystemDescription instance - although it could theoretically
> be an empty one.
>
> Your UIMAFactory is maybe not doing what you expect. The first time
> TypeSystemDescriptionFactory.createTypeSystemDescription() is
> called, it caches the type system locations. On future calls, it does not
> scan
> again. If you really want to force uimaFIT to import specific descriptors
> from the classpath by setting this system property, you also should call
> TypeSystemDescriptionFactory.forceTypeDescriptorsScan();
>
> If calling forceTypeDescriptorsScan() does not help, you can try a two
> low-level tests to see if uimaFIT has any chance at all of locating the
> files you are looking for:
>
> 1) new
> PathMatchingResourcePatternResolver().getResources("classpath*:META-INF/edu/isistan/uima/unified/**/*.xml")
> should return a list of Resources pointing at your descriptors
>
> 2)
> TypeSystemDescriptionFactory.class.getResource("/META-INF/edu/isistan/typesystems/IdentifiableTypeDescriptor.xml")
> should produce an URL pointing at one of your descriptors
>
> Do these low-level tests yield the expected results?
>
> Cheers,
>
> -- Richard
>
> [1]
> https://code.google.com/p/uimafit/source/browse/trunk/uimaFIT/src/main/java/org/uimafit/factory/TypeSystemDescriptionFactory.java#144
>
> On 18.03.2014, at 21:41, Juan Ignacio Velez <velez.juanignacio@gmail.com>
> wrote:
>
> > I'm testing yours solution Richard, but nothing happend. Eclipse show
> this
> > error when i try to run a SimplePipeline:
> >
> > Undefined type "edu.isistan.uima.unified.typesystems.srs.Project" in type
> > priority list. (Descriptor: <unknown>)
> >
> > For that reason i try to print the TypeSystemDescription information
> after
> > this code:
> >
> > TypeSystemDescription typeSystemDescription =
> > factory.getTypeSystemDescription();
> >
> > and the result is null. "factory" is a UIMAFactory that do this:
> >
> > public TypeSystemDescription getTypeSystemDescription() throws
> > ResourceInitializationException {
> > System.setProperty("org.uimafit.type.import_pattern",
> > "classpath*:META-INF/edu/isistan/uima/unified/**/*.xml");
> > return TypeSystemDescriptionFactory.createTypeSystemDescription();
> > }
> >
> > Here appears a declaration of the path of the descriptors. That's from
> the
> > other project that i'm trying to move to REST-Web Service.
> >
> > I put the types.txt in the correct place, because my uimaFit version is
> > 1.4.0.
> >
> > Juan.
> >
> >
> > 2014-03-18 9:58 GMT-03:00 Richard Eckart de Castilho <rec@apache.org>:
> >
> >> Hi Juan,
> >>
> >> thank you for the detailed description.
> >>
> >> Check which uimaFIT version you are using. I would recommend you
> >> to use the Apache uimaFIT 2.0.0 version. The types.txt file you
> >> use appears to be for uimafit 1.4.x. The location of the types.txt
> >> file differs depending on the uimaFIT version:
> >>
> >>  META-INF/org.apache.uima.fit/types.txt      (Apache uimaFIT 2.0.0)
> >>  META-INF/org.uimafit/types.txt              (uimaFIT 1.4.x)
> >>
> >> Try changing the content of your types.txt file to:
> >>
> >>  classpath*:META-INF/typeSystemDescriptor.xml
> >>
> >> Mote that I removed the "/" before META-INF. This might already help.
> >>
> >> Additionally, I would suggest you to include all your type systems
> directly
> >> via the types.txt file instead of importing them via an intermediate
> >> descriptor
> >> file. E.g.
> >>
> >>
> >>
> classpath*:META-INF/edu/isistan/typesystems/IdentifiableTypeDescriptor.xml
> >>
>  classpath*:META-INF/edu/isistan/typesystems/srs/ProjectTypeDescriptor.xml
> >>
> >> or even
> >>
> >>  classpath*:META-INF/edu/isistan/typesystems/**/*.xml
> >>
> >> Cheers,
> >>
> >> -- Richard
> >>
> >> On 18.03.2014, at 13:49, Juan Ignacio Velez <
> velez.juanignacio@gmail.com>
> >> wrote:
> >>
> >>> ---------- Forwarded message ----------
> >>> From: Juan Ignacio Velez <velez.juanignacio@gmail.com>
> >>> Date: 2014-03-17 10:53 GMT-03:00
> >>> Subject: uimaFit Problem.
> >>> To: user@uima.apache.org
> >>>
> >>>
> >>> Hi, i'm moving an eclipse plugin that use uimaFit to web service. The
> >> stand
> >>> alone version it's do it correctly, but when i want to move to the web,
> >> the
> >>> project fail. I'm working a lot on this, and the fail occurs in the
> >>> decriptors files auto-detection.
> >>>
> >>> My project work with eclipse+tomcat+jersey(REST-web service).
> >>>
> >>> First, i have a .xml that indicates the imports all of the descriptors
> >> that
> >>> the project needs. This file it's somethind like this:
> >>>
> >>> <?xml version="1.0" encoding="UTF-8"?>
> >>> <typeSystemDescription xmlns="http://uima.apache.org/resourceSpecifier
> ">
> >>> <name>ECoreTypeDescriptor</name>
> >>> <description/>
> >>> <version>1.0</version>
> >>> <vendor></vendor>
> >>> <imports>
> >>>   <import
> >>>
> >>
> location="META-INF/edu/isistan/typesystems/IdentifiableTypeDescriptor.xml"/>
> >>>   <import
> >>>
> >>
> location="META-INF/edu/isistan/typesystems/srs/ProjectTypeDescriptor.xml"/>
> >>>   ...
> >>> </typeSystemDescription>
> >>>
> >>> This file call "TypeSystem.xml" and it's place in the META-INF folder
> >> that
> >>> eclipse provides. The types descriptors it's declarate inside META-INF
> >>> folder in the path
> >>> "/edu/isistan/typesystems/IdentifiableTypeDescriptor.xml".
> >>>
> >>> I try to declarate the "META-INF/org.uimafit/types.text" that indicates
> >> the
> >>> classpath of the descriptors types. In my case, this file contains:
> >>>
> >>> classpath*:/META-INF/typeSystemDescriptor.xml
> >>>
> >>> Because this declaration mode doesn't work, i try to declarate in the
> VM
> >>> Arguments, but the respose it's the same.
> >>>
> >>> Where i have to put the descriptors files?How i declarate the
> descriptors
> >>> path to the correct auto-detection of uimaFit?
> >>>
> >>> Sorrey about my english, i'm waiting for response.
> >>>
> >>> Thanks, Juan
> >>
> >>
>
>

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