I have defined two typemaps:

%typemap(jni)       ublas::vector<double>,                          ublas::vector<double>&                          "jobjectArray*"
%typemap(jni)       const ublas::vector<double>,                    const ublas::vector<double>&                    "jobjectArray"

On my C++ function void test(const ublas::vector<double>&, ublas::vector<double>) a JNI function with

SWIG__test(JNIEnv *jenv, jclass jcls, jobjectArray, jobjectarray* )

is created, and works fine.

If I have got a function that has got a return paramter like

ublas::vector<double> test2();

The return type is set to 

jobjectArray* SWIG__TEST2(JNIEnv *jenv, jclass jcls)

Which typemap must I use that all returnin type are not a pointer type. So in my case the typemaps
should be return a jobjectArray for the const and non-const type.