You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@uima.apache.org by Sylvain Surcin <su...@kwaga.com> on 2012/02/20 17:54:36 UTC

UIMACpp - how to check annotator's dlopen

Hello,

Is there a way to get more info, or to trace the processes involved when
initializing a C++ annotator?

I have this message dumped when launching an aggregator containing some
Java annotators and one C++:

annotator:creating JNILogger

20/02/12 17:38:13 - 11:
org.apache.uima.uimacpp.UimacppAnalysisComponent.log(393): GRAVE:
org.apache.uima.cpp: 0
Error number  : 2001
Recoverable   : Yes
Error         : Error loading annotator 'UnitexAnnotatorCpp'.
'dlopen(UnitexAnnotatorCpp.dylib, 10): image not found'

20/02/12 17:38:13 - 11:
org.apache.uima.uimacpp.UimacppAnalysisComponent.log(393): GRAVE:
org.apache.uima.cpp: 0 ResourceManager::requestAnnotatorFile() failed to
find UnitexAnnotatorCpp

Nevertheless the annotator's UnitexAnnotatorCpp.dylib is well available
through the $DYLD_LIBRARY_PATH environment variable, and also through the
-Djava.library.path when launching the aggregate. I even checked with a
small C program, using dlopen that it is possible to load the library.

What could I do next?

Thanks for any advice.
Sylvain

-- 
Sylvain SURCIN, Ph.D.
*KWAGA*
Senior Software Architect
15, rue Jean-Baptiste Berlier
75013 Paris
France
Tél.: +33 (0)6.32.78.83.31

Re: UIMACpp - how to check annotator's dlopen

Posted by Sylvain Surcin <su...@kwaga.com>.
Hi Eddie,

No, in fact, as I told Bhavani in a separate message, the problem is
specific to Mac Os X.
This has to do with the "install name" embedded in the libuima.dylib during
construction by the Makefile, which is /install/lib/libuima.dylib.
As well, the makefile generating the C++ annotator states a dependency to
/install/lib/libuima.dylib inside the annotator's dylib.

The problem is solved by:
1) changing the install name in libuima, to neutralize it:

install_name_tool -id libuima.dylib $UIMACPP_HOME/install/lib/libuima.dylib

2) changing the dependency path in the annotator:

install_name_tool -change "/install/lib/libuima.dylib"
"/absolute_path_to_uimacpp_home/install/lib/libuima.dylib" MyAnnotator.dylib

So far, I do it manually.
We still have to find a way to do that nicely in the makefiles.

Sylvain


On Tue, Feb 21, 2012 at 3:36 PM, Eddie Epstein <ea...@gmail.com> wrote:

> This error is coming from libuima, which was successfully loaded by
> the JVM, given -Djava.library.path. You're sure that the [appropriate]
> LD_LIBRARY_PATH is set correctly for libuima? As a test put the
> annotator library in some standard place, like /usr/lib. There's no
> issue with 32 vs 64 bit libraries?
>
> Eddie
>
> On Mon, Feb 20, 2012 at 11:54 AM, Sylvain Surcin <su...@kwaga.com> wrote:
> > Hello,
> >
> > Is there a way to get more info, or to trace the processes involved when
> > initializing a C++ annotator?
> >
> > I have this message dumped when launching an aggregator containing some
> > Java annotators and one C++:
> >
> > annotator:creating JNILogger
> >
> > 20/02/12 17:38:13 - 11:
> > org.apache.uima.uimacpp.UimacppAnalysisComponent.log(393): GRAVE:
> > org.apache.uima.cpp: 0
> > Error number  : 2001
> > Recoverable   : Yes
> > Error         : Error loading annotator 'UnitexAnnotatorCpp'.
> > 'dlopen(UnitexAnnotatorCpp.dylib, 10): image not found'
> >
> > 20/02/12 17:38:13 - 11:
> > org.apache.uima.uimacpp.UimacppAnalysisComponent.log(393): GRAVE:
> > org.apache.uima.cpp: 0 ResourceManager::requestAnnotatorFile() failed to
> > find UnitexAnnotatorCpp
> >
> > Nevertheless the annotator's UnitexAnnotatorCpp.dylib is well available
> > through the $DYLD_LIBRARY_PATH environment variable, and also through the
> > -Djava.library.path when launching the aggregate. I even checked with a
> > small C program, using dlopen that it is possible to load the library.
> >
> > What could I do next?
> >
> > Thanks for any advice.
> > Sylvain
> >
> > --
> > Sylvain SURCIN, Ph.D.
> > *KWAGA*
> > Senior Software Architect
> > 15, rue Jean-Baptiste Berlier
> > 75013 Paris
> > France
> > Tél.: +33 (0)6.32.78.83.31
>



-- 
Sylvain SURCIN, Ph.D.
*KWAGA*
Senior Software Architect
15, rue Jean-Baptiste Berlier
75013 Paris
France
Tél.: +33 (0)6.32.78.83.31

Re: UIMACpp - how to check annotator's dlopen

Posted by Eddie Epstein <ea...@gmail.com>.
This error is coming from libuima, which was successfully loaded by
the JVM, given -Djava.library.path. You're sure that the [appropriate]
LD_LIBRARY_PATH is set correctly for libuima? As a test put the
annotator library in some standard place, like /usr/lib. There's no
issue with 32 vs 64 bit libraries?

Eddie

On Mon, Feb 20, 2012 at 11:54 AM, Sylvain Surcin <su...@kwaga.com> wrote:
> Hello,
>
> Is there a way to get more info, or to trace the processes involved when
> initializing a C++ annotator?
>
> I have this message dumped when launching an aggregator containing some
> Java annotators and one C++:
>
> annotator:creating JNILogger
>
> 20/02/12 17:38:13 - 11:
> org.apache.uima.uimacpp.UimacppAnalysisComponent.log(393): GRAVE:
> org.apache.uima.cpp: 0
> Error number  : 2001
> Recoverable   : Yes
> Error         : Error loading annotator 'UnitexAnnotatorCpp'.
> 'dlopen(UnitexAnnotatorCpp.dylib, 10): image not found'
>
> 20/02/12 17:38:13 - 11:
> org.apache.uima.uimacpp.UimacppAnalysisComponent.log(393): GRAVE:
> org.apache.uima.cpp: 0 ResourceManager::requestAnnotatorFile() failed to
> find UnitexAnnotatorCpp
>
> Nevertheless the annotator's UnitexAnnotatorCpp.dylib is well available
> through the $DYLD_LIBRARY_PATH environment variable, and also through the
> -Djava.library.path when launching the aggregate. I even checked with a
> small C program, using dlopen that it is possible to load the library.
>
> What could I do next?
>
> Thanks for any advice.
> Sylvain
>
> --
> Sylvain SURCIN, Ph.D.
> *KWAGA*
> Senior Software Architect
> 15, rue Jean-Baptiste Berlier
> 75013 Paris
> France
> Tél.: +33 (0)6.32.78.83.31

Re: UIMACpp - how to check annotator's dlopen

Posted by Marshall Schor <ms...@schor.com>.
I'm not really qualified to diagnose this, but I wonder if perhaps the problem 
is described in the error message.

Is the "image" that should be found supposed to be equal to 
"dlopen(UnitexAnnotatorCpp.dylib, 10) "
or should it be something like "UnitexAnnotatorCpp.dylib"?  (without the 
surrounding dlopen(...)) ?

-Marshall


On 2/20/2012 11:54 AM, Sylvain Surcin wrote:
> Hello,
>
> Is there a way to get more info, or to trace the processes involved when
> initializing a C++ annotator?
>
> I have this message dumped when launching an aggregator containing some
> Java annotators and one C++:
>
> annotator:creating JNILogger
>
> 20/02/12 17:38:13 - 11:
> org.apache.uima.uimacpp.UimacppAnalysisComponent.log(393): GRAVE:
> org.apache.uima.cpp: 0
> Error number  : 2001
> Recoverable   : Yes
> Error         : Error loading annotator 'UnitexAnnotatorCpp'.
> 'dlopen(UnitexAnnotatorCpp.dylib, 10): image not found'
>
> 20/02/12 17:38:13 - 11:
> org.apache.uima.uimacpp.UimacppAnalysisComponent.log(393): GRAVE:
> org.apache.uima.cpp: 0 ResourceManager::requestAnnotatorFile() failed to
> find UnitexAnnotatorCpp
>
> Nevertheless the annotator's UnitexAnnotatorCpp.dylib is well available
> through the $DYLD_LIBRARY_PATH environment variable, and also through the
> -Djava.library.path when launching the aggregate. I even checked with a
> small C program, using dlopen that it is possible to load the library.
>
> What could I do next?
>
> Thanks for any advice.
> Sylvain
>