Markus Weimer wrote:
Hi,
I am building an application that requires to use AnalysisEngines
without a CPE surrounding it. However, using a reader that imports a
type system by name instead of by value raises the following
Exception:
CASRuntimeException: JCas type TYPE used in Java code, but was not
declared in the XML type descriptor.
Is there any special magic involved in making import by name working
inside an Application?
Thanks in advance,
Markus
Are you using any fancy class loading in your application? The JCas
requires that the JCas type classes be loaded with the same class loader
that the UIMA framework is loaded with. Alternatively, you can use the
UIMA extension class loader, which should also work. See
http://incubator.apache.org/uima/apidocs/org/apache/uima/resource/ResourceManager.html#setExtensionClassPath(java.lang.String,%20boolean)
and
http://incubator.apache.org/uima/apidocs/org/apache/uima/UIMAFramework.html#newDefaultResourceManager()
Hope this helps.
--Thilo