You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@uima.apache.org by Aaron Kaplan <Aa...@xrce.xerox.com> on 2008/06/09 14:32:22 UTC
Problem with PEAR classpath
I have two annotators that share a type system. Each is packaged in a
separate pear with its own copy of the type system descriptor and the
associated JCas classes. When I build an aggregate annotator using the
two pear descriptors and run it in the CVD, I get a run-time exception
in the process() method of the second annotator saying that it can't
find one of the cover classes. I have verified that the .class file for
this class is present in the bin/ subdirectory of the annotator's pear
installation directory, so it seems like the classpath must not be
getting set properly.
The following works fine: load the first annotator's pear descriptor in
the CVD, run the annotator on an input text file, save the result in an
XMI CAS file; load the second annotator's pear descriptor in the CVD,
load the XMI CAS file, run the annotator on that. It's when I combine
the two annotators into an aggregate and try to run it in one go that I
have a problem.
Does it sound like I'm doing something wrong? How can I debug this?
Thanks
-Aaron
Re: Problem with PEAR classpath
Posted by Thilo Goetz <tw...@gmx.de>.
I tried to reproduce your problem by running the
POS tagger more than once in the same aggregate.
No luck. Do you think you could create a simple
test case for us? You should be able to remove
most of your analysis logic and still get it to
crash.
--Thilo
Aaron Kaplan wrote:
> Marshall Schor wrote:
>
>> Can you verify that the JCas cover classes are either in a Jar file
>> that is in the Pear's lib directory, or that you have added a
>> environment variable setting action for the Pear specifying the
>> CLASSPATH environmental variable and having it point to where the JCas
>> classes are in the Pear structure?
>
> Yes, the JCas classes are in $main_root/bin, which install.xml does put
> on the CLASSPATH. Sorry I didn't mention that, I'd forgotten it wasn't
> automatic.
>
> Note that the annotator's implementation class is in $main_root/bin as
> well, and the system has no trouble finding that. It's only the JCas
> classes that it can't find.
>
> -Aaron
Re: Problem with PEAR classpath
Posted by Aaron Kaplan <Aa...@xrce.xerox.com>.
Michael Baessler wrote:
> I think you are using the latest Apache UIMA version 2.2.2-incubating, right?
This was the problem. Though I had installed the latest version, one of
my test scripts was setting UIMA_HOME to point to version 2.2.0. With
that fixed, it works fine.
Thanks for your help
-Aaron
Re: Problem with PEAR classpath
Posted by Michael Baessler <mb...@michael-baessler.de>.
Aaron Kaplan wrote:
> Marshall Schor wrote:
>
>> Can you verify that the JCas cover classes are either in a Jar file
>> that is in the Pear's lib directory, or that you have added a
>> environment variable setting action for the Pear specifying the
>> CLASSPATH environmental variable and having it point to where the JCas
>> classes are in the Pear structure?
>
> Yes, the JCas classes are in $main_root/bin, which install.xml does put
> on the CLASSPATH. Sorry I didn't mention that, I'd forgotten it wasn't
> automatic.
>
> Note that the annotator's implementation class is in $main_root/bin as
> well, and the system has no trouble finding that. It's only the JCas
> classes that it can't find.
>
> -Aaron
I think you are using the latest Apache UIMA version 2.2.2-incubating, right?
Can you provide us the exception stack trace?
-- Michael
Re: Problem with PEAR classpath
Posted by Aaron Kaplan <Aa...@xrce.xerox.com>.
Marshall Schor wrote:
> Can you verify that the JCas cover classes are either in a Jar file that
> is in the Pear's lib directory, or that you have added a environment
> variable setting action for the Pear specifying the CLASSPATH
> environmental variable and having it point to where the JCas classes are
> in the Pear structure?
Yes, the JCas classes are in $main_root/bin, which install.xml does put
on the CLASSPATH. Sorry I didn't mention that, I'd forgotten it wasn't
automatic.
Note that the annotator's implementation class is in $main_root/bin as
well, and the system has no trouble finding that. It's only the JCas
classes that it can't find.
-Aaron
Re: Problem with PEAR classpath
Posted by Marshall Schor <ms...@schor.com>.
Hi Aaron -
When running Pears contained in an aggregate, the Java classpath used to
load the JCas (and other) classes is switched to be what the Pear specifies.
The classpath used by the PEAR is built using the jars in the "lib"
directory, plus any additional paths that are specified in the PEAR
installation descriptor's "set_env_variable" action, done by specifying
the "CLASSPATH" environmental variable. (see
http://incubator.apache.org/uima/downloads/releaseDocs/2.2.2-incubating/docs/html/references/references.html#ugr.ref.pear.installation_descriptor
and scroll down to the section 6.1.4.5 )
Can you verify that the JCas cover classes are either in a Jar file that
is in the Pear's lib directory, or that you have added a environment
variable setting action for the Pear specifying the CLASSPATH
environmental variable and having it point to where the JCas classes are
in the Pear structure?
Thanks. -Marshall
Aaron Kaplan wrote:
> I have two annotators that share a type system. Each is packaged in a
> separate pear with its own copy of the type system descriptor and the
> associated JCas classes. When I build an aggregate annotator using
> the two pear descriptors and run it in the CVD, I get a run-time
> exception in the process() method of the second annotator saying that
> it can't find one of the cover classes. I have verified that the
> .class file for this class is present in the bin/ subdirectory of the
> annotator's pear installation directory, so it seems like the
> classpath must not be getting set properly.
>
> The following works fine: load the first annotator's pear descriptor
> in the CVD, run the annotator on an input text file, save the result
> in an XMI CAS file; load the second annotator's pear descriptor in the
> CVD, load the XMI CAS file, run the annotator on that. It's when I
> combine the two annotators into an aggregate and try to run it in one
> go that I have a problem.
>
> Does it sound like I'm doing something wrong? How can I debug this?
> Thanks
> -Aaron
>
>