Just for the record (and the archive;):
My JBI/ServiceMix-related problem with unexpected crashes was solved by taming
the external C-library I was using: the error messages below definitely
originated from that libary, which was simply exit()ing in case of an error
(!), so no ServiceMix- or JNA-related problems, only the library crashed.
I solved the problem in several steps:
* configure the library not to exit on errors (doh!)
* initialize the library not in JBI's BootStrap or LifeCycle, but in a
separate singleton-class that cleanly limits access to the library over a
single interface (the lib seems not to be multithreading-friendly) and lazily
initializes the lib on first use (which is in the BindingComponent's
processIn()-method)
Maybe this is of use to someone, I am now a true fan of JNA:)
Gregor
Seems also to have to do with ServiceMix's classloader, as I get
some errors
when initializing the API in multiple BindingComponent-instances in
the same
ServiceAssembly at once:
-E- CDI: <Line:1> (cin) already declared in this scope
-E- CDI: <Line:1> (cout) already declared in this scope
-E- CDI: <Line:1> (cerr) already declared in this scope
-E- CDI: <Line:1> (S_ISUID) already declared in this scope
Do you know what portion(s) of code are defining these symbols?
NativeLibrary and Function are set up to use a static map to avoid
multiple loads of the same library. Does ServiceMix use a
classloader per context, or a single classloader that loads and
unloads classes?