On Oct 15, 2007, at 5:32 PM, Gregor B. Rosenauer wrote:
On Sunday 14 October 2007 23:37:49 Timothy Wall wrote:
You're using an old version of the jna library, you might consider
rebuilding from SVN sources
Thanks, I did that but still got a crash on startup.
Turned out to be a problem with using a static reference to the
library, which
ServiceMix did not seem to like (and it seems not "right" anyway).
Rewrote to use a normal reference and moved it into the Endpoint's
start()-method as opposed to the LifeCycle's start() and now I have
not got
any crashes so far.
Also closing the library outside of the normal shutdown-procedure
(accidentially in a Handler's processMessage-method...) seems to have
contributed to this issue.
In systems that do a lot of application load/unloads, you probably
want to avoid static references in general. The "INSTANCE" pattern
is mostly just a convenience for normal applications. The JNA unit
tests avoid it because they need to examine load/unload behavior,
which gets rather tricky with static references.
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?