On 1/16/07, Lev Kozakov <[EMAIL PROTECTED]> wrote:
The PEAR validation code uses UIMA ResourceManager mechanism to add several
JARs to the classpath, but it does not override the default class loader.
Therefore, the 'extension' classes, which are specified in the component
classpath, are searched in the extended classpath, but still are loaded by
the default class loader - the same class loader that loads UIMA framework
classes.

I'm not sure what you mean.  The UIMA ResourceManager doesn't provide
any ability to do this.  The only way you can use the UIMA
ResourceManager to add JARs to the classpath is to set the "extension
class path" which results in the creation of a new ClassLoader.

I believe, the problem of including UIMA JARs in PEAR packages is,
most likely, related to possible mixture of different versions of the UIMA
code. In any case, PEAR packages should not include UIMA framework code.


I don't think just having two different versions of UIMA on the
classpath could result in the report "Not an Annotator" exception.
The only way I see that could happen is if the framework had loaded a
different Annotator interface than the component, which can only
happen if the extension class loader is in use.

My general opinion is - warn developers on possible conflicts, but let them
go their own way.
1) I believe, PEAR Packager may post a warning that adding UIMA JARs to
a PEAR package may lead to conflicts, but it should not prevent developers
from doing this, because we cannot predict all possible uses of PEAR
packages.

I believe we can make some decisions about what PEAR files can and
can't be used for.  The intention of the PEAR is to be able to deploy
the component into a UIMA runtime container of some kind.  This WILL
(not may) lead to conflicts if the PEAR contains UIMA framework jars.
So I think it's worthwhile to prevent the user from going wrong in
this way.

2) The buildComponentClassPath() method may also warn that the CLASSPATH
contains duplicated entries, but it should not ignore them. The
buildComponentClassPath() method does not control the names of the JARs
added to the CLASSPATH, so I don't believe, it could discover UIMA JARs in
the component CLASSPATH, because developers are free to use any names for
their JARs.

You're right that checking jar file names is not the right thing to
do.  However, instead it may be possible to attempt to load UIMA
framework classes (such as
org.apache.uima.analysis_component.AnalysisComponent) from the
classpath that the user has specified for their PEAR.  If the class is
able to be loaded, you will know that the PEAR is not valid.

-Adam

Reply via email to