Adam Lally wrote:
I think there may be a problem with the JCas classes if your adapter
uses a different ClassLoader for the AnalysisEngine in the PEAR than
the ClassLoader that's being used by the calling
aggregate/application.
When a CAS is created it has to be told what ClassLoader it will use
to locate JCas classes. If the PEAR ClassLoader is known only inside
the PearAnalysisEngineWrapper, this will not be available to the CAS
and the classes can't be loaded.
This could be addressed using CAS serialization. So the
PearAnalysisEngineWrapper would create its own CAS with the correct
ClassLoader. When it's process method was called it would need to
serialize the input CAS and deserialize it into its "private" CAS
before calling the wrapped AE. It would have to serialize on the way
back as well.
So there's a performance penalty, but it's still better than nothing.
I really like the fact that this would allow existing UIMA tools like
DocumentAnalyzer to execute PEARs.
So, with the current implementation I tested some different ways to do
the CAS serialization/deserialization.
The fastest one seems to be the blob serialization using a byte array.
But it seems that this serialization/deserialization either has a bug
or I do something wrong.
Adam or Eddie, can you please look at the code in
PearAnalysisEngineWrapper.java if the serialization/deserialization is
correct?
If I use the fastest serialization and run an installed pear using CVD I
see after the processing of the pear file a view that is called:
"_InitialView" and another one that is called " _InitialVie". Also the
document language is not correct after the processing it is " n" instead
of "en".
If I use the other serialization all works fine!
-- Michael