Page 1 of 1

Servoy 2022.03 and iT2Be Cryptor

PostPosted: Mon Feb 13, 2023 2:49 am
by SteveInLA
I retired from Servoy development two years ago but still need to be available to support some Smart Client applications. I recently purchased a new Macbook Pro and found that simply copying Servoy Developer 2020.03 over from the old Macbook didn't work. I proceeded to install Servoy 2022.03.4, imported my applications, installed all the plugins and tried to log in to the first application. Immediately I get an error that appears to be a failure in the it2be_cryptor plugin's BLOWFISH decryptor. This is what I get in the Developer console:

Code: Select all
ERROR com.servoy.j2db.util.Debug - Could not verify login via authenticator Dashboard_authenticator java.lang.IllegalAccessError: class com.it2be.cryptor.security.Blowfish (in unnamed module @0x79ea6aec) cannot access class com.sun.crypto.provider.SunJCE (in module java.base) because module java.base does not export com.sun.crypto.provider to unnamed module @0x79ea6aec


I have created a ticket with Servoy Components but have not heard back from them yet. I created a sample solution and found that the plugin's other types of encryption appear to be working but Blowfish does not. In the sample, I do not get any error message, but the method just exits at the point when the decrypt function is called.

Does anyone have any suggestions? I still have the old computer and everything on it still works fine as do the applications currently in deployment. I am inclined to use the old computer to deploy a utility that will decrypt my current data with the working it2be cryptor, then encrypt it using svyUtils.svyCrypto. Are there other recommendations?

Here is all the pertinent current Developer versions:

Code: Select all
Server Information
Servoy version 2022.3.4 -releaseNumber 3746
Port used by RMI Registry: 1099
Repository version 55

Settings file for this server: /Applications/Servoy 2022.03.4 Dakim SC/Servoy.app/Contents/Eclipse/../application_server/servoy.properties

User Information
Logged in as:

JVM Information
java.vm.name=OpenJDK 64-Bit Server VM
java.version=17.0.4
java.vm.info=mixed mode
java.vm.vendor=Eclipse Adoptium

Operating System Information
os.name=Mac OS X
os.version=13.2
os.arch=aarch64


Thanks in advance,
SteveInLA (but now in OR)

Re: Servoy 2022.03 and iT2Be Cryptor

PostPosted: Mon Feb 13, 2023 10:57 am
by mboegem
Hi SteveInOR ;-)

Most likely your recent experiences have to do with incompatible Java versions.

First of all, the reason why 2020.03 wouldn't run could be as simple as not having the correct Java version installed.
You are running Apple Silicon, where 2020.03 isn't suitable to run on this processor. In order to run it, download the correct Java version from Oracle and install it.
Rosetta 2 will enable you to run this Java x64 version.
To make Servoy use this, you will need to add the correct path to this java version by changing the servoy.ini file (if you've installed Servoy as an Mac application bundle: right click the bundle, choose 'Show Package contents' and then look for this file in the folder structure)
Add (or replace current lines) something like this:
Code: Select all
-vm
/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/jli/libjli.dylib

Of course the path can be slightly different depending on the version you install.

I you have the choice of running the application on 2022.03 you will be even happier, as it will run as a native ARM application. As you've probably experienced launching and running Eclipse is much faster than it used to be.
Installing 2022.03 will automatically install OpenJDK v17 and this is where things probably go wrong as your version of the Cryptor plugin requires some 'sun' library which is no longer available in OpenJDK.
In case there's a more recent version of the Cryptor plugin that doesn't have this dependency on sun-libraries, you will need to install this and go from there.

However I think you will need to stick to 2020.03 and install an old JDK 8 version on your machine.
Reason for this is that you are mentioning this is a Smart Client version of Servoy.
Running Smart Client requires Java Webstart which is not available in Java 11 and up.
Personally I haven't succeeded in running Servoy developer on Java 8, beyond version 2020.03.

Although most Java libraries can run perfectly fine on both OpenJDK 11 and Oracle Java, this might not be the case for the Cryptor plugin, hence my advice to stick to 2020.03 and run developer on Oracle JDK8

The only other option is - like you mentioned - to decrypt current data and encrypt it again using svyCrypto.
Still, you will need to realise that when Servoy Developer is running on for instance OpenJDK11 and your clients (due to the Java Webstart constraints) need to be running Java 8, you could experience different behaviour between your developer and the deployed application.

Hope this makes sense.

Re: Servoy 2022.03 and iT2Be Cryptor

PostPosted: Mon Feb 13, 2023 8:19 pm
by SteveInLA
Thanks Marc. I have never been 100% clear on Java JDK, Java JRE and all the ins and outs of how the different versions affect Servoy. What I do know is that my Apple Silicon Mac says it is running Java Version 8 Update 361 (build 1.8.0_361-b09) and when I launch the Smart Client apps that are currently served via a server running Servoy 2019.12.12 and Java 8 Update 241 on my Apple Silicon Mac, everything, including it2be Cryptor runs just like it always has. Where things stop working is when I try to serve the app using the 2022.03.4 Developer. I'll keep at it, though.

Servoy Components' response was that Cryptor is free and open source and does not receive any commercial support. They suggest using VirtualBox on the Mac and running Servoy under Windows 10 instead. My experience with VirtualBox under Silicon has not been great either so I would like to avoid it if possible.

Re: Servoy 2022.03 and iT2Be Cryptor

PostPosted: Tue Feb 14, 2023 11:34 am
by mboegem
Hi Steve,

Using VirtualBox is an advice which doesn't make sense at all, because even after installing this and running 2022.3.3 out of the box will not help you, as the Java version will still be OpenJDK 17.

So pls check if you installed Oracle Java 8 JDK
Then install Servoy 2020.3 (or even 2019.12.12 as this currently in production), but DO make sure you change the servoy.ini file with the -vm change in my first post.
If you launch Servoy Developer and then look at the admin page of developer, it should tell you it's running the Java version you've pointed to in the servoy.ini file.
If not, Eclipse didn't pick up that change and you need to look closely what is wrong with the change.

Hope this helps

Re: Servoy 2022.03 and iT2Be Cryptor

PostPosted: Tue Feb 14, 2023 12:01 pm
by jcompagner
just as a quick reminder, because these kind of errors popup (especially when using stuff that are using internal things)

Code: Select all
ERROR com.servoy.j2db.util.Debug - Could not verify login via authenticator Dashboard_authenticator java.lang.IllegalAccessError: class com.it2be.cryptor.security.Blowfish (in unnamed module @0x79ea6aec) cannot access class com.sun.crypto.provider.SunJCE (in module java.base) because module java.base does not export com.sun.crypto.provider to unnamed module @0x79ea6aec


Very likely this will still work but you need to to export it to to unnamed module (exactly what the error here says)
for this to work (as long as oracle really didn't remove it fully), you need to start java with an vm argument:


--add-exports java.base/com.sun.crypto.provider=ALL-UNNAMED

or this works even better most of the times:

-add-opens java.base/com.sun.crypto.provider=ALL-UNNAMED

some extra info

https://nipafx.dev/five-command-line-op ... -add-opens

Re: Servoy 2022.03 and iT2Be Cryptor

PostPosted: Tue Feb 14, 2023 7:42 pm
by SteveInLA
Neither of those worked, at least not for me.

Can someone explain why this is broken in 2022.03.4 Developer but is working when I run the Smart Client apps on the same Mac from the current Servoy server running 2019.12? The client side is using the same Java so I assume that this is a failure on the server side and not the client's, right?

I am going to give up on making this work and use my currently working version to replace my encryption methods. Thanks for the assistance. Something tells me this is the first but not the last issue I'll encounter.

Re: Servoy 2022.03 and iT2Be Cryptor

PostPosted: Wed Feb 15, 2023 12:05 pm
by mboegem
SteveInLA wrote:Can someone explain why this is broken in 2022.03.4 Developer but is working when I run the Smart Client apps on the same Mac from the current Servoy server running 2019.12?

Most likely: Java version. So: did you actually make the change to the servoy.ini file and checked localhost:8080/servoy-admin which Java version was reported there?

SteveInLA wrote:The client side is using the same Java so I assume that this is a failure on the server side and not the client's, right?

Definitely not, this plugin is running client side, this is why it make perfect sense if it doesn't work in developer when developer is being launched with the wrong java version.