QuantLib SWIG Java: Undefined symbol sessionId()

I have successfully compiled QuantLib 1.12 on Ubuntu with --enable-sessions and --enable-thread-safe-observer-pattern flags. I also compiled java Swig bindings. When I try to run Bonds example in java, I get an undefined symbol error on sessionId().

java -cp ./QuantLib.jar:. -Djava.library.path=/usr/local/lib examples.Bond

java:symbol lookup error:/usr/local/lib/libQuantLibJNI.so:undefined 

Any idea how to resolve this error? I saw some references to implementing sessionId() function externally and linking to QuantLib. I am not sure how to do that exactly. Can I add "mysessions.cpp" file under ql/ folder and build QuantLib as usual? The file mysessions.cpp will have following content:

#include <thread>
int QuantLib::sessionId(void)
     return std::this_thread::get_id().hash();

Thanks for your help.