I am trying to throw a custom exception from one .so to another .so but the exception object is not getting caught in the receiving .so
For example,

in a.h i have the necessary declarations like:

a::takeit(boolean,boolean);
catch_me_if_u_can;

in a.cpp:
a::takeit(decaprio,spielberg)
{

if(decaprio && spielberg)
throw new catch_me_if_u_can ;
}

in b.cpp:
# include "a.h"
haveit()
{
try{
takeit(true,true);
}catch(catch_me_if_u_can)
{
logerror("caught you!!!");
}
}

Both a.cpp and b.cpp are part of a.so and b.so respectively.

Here, haveit() of b.so is called from java via a jni call like :
Java_ask_for_it_and_haveit();
where the java call is in the class 'it.class' in the package 'ask.for.it'.

When the java class is executed, i get a jvm crash which denotes that the exception 'catch_me_if_u_can' is never caught.
Now, when i introduce another catch like this,

try{
takeit(true,true);
}catch(catch_me_if_u_can& so_did_i)
{
logerror(so_did_i);
}catch(...)
{
logerror("went for lilly but caught something silly!!!");
}

then the generic catch block is catching some other (generic) exception and so the crash is taken care of.
But there is no proper error message which i would have stored in 'catch_me_if_u_can' object.

Does anyone have a solution for this?

Thanks in advance,
srmohan