Issue using couchbase lite java on Windows XP

Hi all !

I am using couchbase lite for java (couchbase-lite-java-1.3.1) for my JavaFX application.
My code is working well on Mac OS X, Windows 7/10.
Now I am trying to make it work on Windows XP but I am getting the following error:

Executing C:\Documents and Settings\Administrator\Desktop\Testy\Testy\dist\run618830020\Testy.jar using platform C:\Documents and Settings\Administrator\Desktop\NetBeans_JavaSE_7.4_Portable\App\jdk\jre/bin/java
Exception in Application constructor
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:389)
at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)
Caused by: java.lang.RuntimeException: Unable to construct Application instance: class org.company.business.testy.Main
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:907)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$155(LauncherImpl.java:182)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$161(LauncherImpl.java:819)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$175(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
… 1 more
Caused by: java.lang.UnsatisfiedLinkError: C:\Documents and Settings\Administrator\Local Settings\Temp\NetBeans_JavaSE_7.4_PortableTemp\CouchbaseLiteJavaForestDB.dll: The specified procedure could not be found
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824)
at java.lang.Runtime.load0(Runtime.java:809)
at java.lang.System.load(System.java:1086)
at com.couchbase.lite.util.NativeLibUtils.loadLibrary(NativeLibUtils.java:45)
at com.couchbase.lite.store.ForestDBStore.(ForestDBStore.java:75)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at com.couchbase.lite.Database.createStoreInstance(Database.java:1156)
at com.couchbase.lite.Database.open(Database.java:1221)
at com.couchbase.lite.Manager.openDatabase(Manager.java:335)
at com.couchbase.lite.Manager.getDatabase(Manager.java:299)
at org.company.business.testy.dbms.DBMS.initDatabase(DBMS.java:38)
at org.company.business.testy.dbms.DBMS.(DBMS.java:23)
at org.company.business.testy.dbms.DAO.(DAO.java:28)
at org.company.business.testy.Main.(Main.java:91)
… 13 more
Exception running application org.company.business.testy.Main

I use the same Netbeans project for Mac OS X, Windows 7 and for Windows XP.
Do you have some info about this problem? It is trying to use a procedure in CouchbaseLiteJavaForestDB.dll…

Thank you.

@aissa,

I believe native library loading method can not find the DLL in the jar file.

As I don’t have Windows XP environment, can you debug by yourself little further?

libraryResourcePath variable value could be different from our expectation with Windows XP.

Thanks!

@hideki,

Thank you for your help.
I’m debugging, here is the value of libraryResourcePath = /native/windows/x86/CouchbaseLiteJavaForestDB.dll

Is it normal?
Thanks.

Thank you for additional information. It looks fine. DLL for Windows x86 exists.

From following error message, I believe DLL couchbase provides does not meet the requirements to run CBL on Windows x86. I am not sure what are missing from this log message.

I believe Windows XP is not officially supported by CBL Java. Can you build couchbase-lite-java-forestdb for Windows XP by yourself?

Thanks!

Hi @hideki,

OK sure. So I have to compile the lib on XP using CMake or something equivalent?
Can you guide me through this task? Do you have some documentation?

Thanks!

“Not supported” means that we do not have documentation or guides for it. You’re on your own, unfortunately. (I’m sure you must have some legitimate reason to be developing for XP, but it’s an ancient OS.)

Hi @aissa,

You could follow the instruction in README of couchbase-lite-java. We have never built it with Win XP. If you have build issue, please post here. We might be able to help you.

Hi @hideki,

I cloned the Github repository “couchbase-lite-java” and read readme instructions.
I see that Visual Studio 2013 is required to build. I can’t install VS2013 on Windows XP because it is not supported.
The last supported version on XP is Visual Studio 2010. Can I use it?

Thanks.

Hi @aissa,

We have not tried VS2010 to build. And also we are using VS2015 now. I believe VS2013 might have an issue. Sorry for not updating README promptly.

I am not sure if Gradle support VS2010. You might encounter some difficulty.

I see that Visual Studio 2013 is required to build. I can’t install VS2013 on Windows XP because it is not supported.

There’s no reason you have to build on XP. Build it on an up to date Windows system and then deploy it on XP.

The caveat to that is if there is any c++ involved you must install the proper redistributable package that includes the runtime library.

@borrrden
Couchbase provided DLL, which was built with VC2015 on Windows 7, does not work on Windows XP. Do you know how we can figure out the requirements (redistributable package)?

– updated –
Does installing Visual C++ Redistributable for Visual Studio 2015 sufficinet?
https://www.microsoft.com/en-us/download/details.aspx?id=48145

Guys, XP is not supported. Period.

Hi @jens,

The software we develop is used in developing countries in health domain (Tuberculosis). Half of the diagnostic computers financed by WHO are on Windows XP. The reason we chose Couchbase Mobile is that it meets well all our requirements. Sorry, but I don’t see where Windows XP is marked as not supported.

Given that Microsoft support for Windows XP itself formally ended nearly three years ago I’d think that it would be in the “better ask to make sure” category and not the “safe unless marked otherwise category,” but regardless I don’t think there is anywhere that claims support for it (although we could do better with our support statement for mobile) and support is generally in the explicit category (i.e. we support X) as opposed to the implicit category (i.e. we don’t support X).

@hideki, it’s trying to load the CouchbaseLiteJavaForestDB DLL. That shouldn’t be required unless the database is trying to use ForestDB, right?

It is correct. @aissa can try to use SQLite as a storage engine.

1 Like

@jens, @hideki,

Yes I’ll use SQLite mode for the moment (I just tested and it’s working on Windows XP :heart_eyes:) and see later if I can build ForestDB for XP.

Thank you guys.

1 Like

ForestDB will improve performance, but if your app is fast enough with SQLite you may not need to go through the pain of trying to build ForestDB :slight_smile:

(Just remember to use transactions around multiple writes. Without a transaction, making lots of writes is slow.)

1 Like