Question
· Jun 20

QR code generation

Hello,

I have a problem generating QR code in Caché now.

After executing the code

set Status=##Class(%SYS.QRCode).GenerateImage(P0,,.DataURI)

(variable P0 contains data for QR code)

an error is displayed now:

"<NOTOPEN>zGenerate+27^%SYS.QRCode.1",,,,,,,,

("$^zGenerate+27^%SYS.QRCode.1 +1","$^zGenerateImage+4^%SYS.QRCode.1 +1"

This error occurs only on two servers, on the others the code works fine.

When calling the method, I do not specify any external file that should be opened.

Thank you for the answers.

Product version: Caché 2018.1
$ZV: 2018.1.8.766.0
Discussion (1)2
Log in or sign up to continue

The problem you are experiencing with generating QR codes using ##class(%SYS.QRCode).GenerateImage may be related to Java configuration or folder permissions on your servers. The %SYS.QRCode class depends on Java, and missing or misconfigured Java installation could lead to such errors:

  1. Check Java Installation: Ensure that Java is installed and properly set up on the two problematic servers. The %SYS.QRCode implementation requires Java. The Java executable must be accessible, and its path is determined:

    • By the configuration parameter JavaHome in the [SQL] section of the .cpf configuration file.
    • By the JAVA_HOME environment variable.
    • Or through your system's PATH variables.
      Make sure the Java version is at least 1.7 [1][2].
  2. Verify Folder Permissions: Sometimes, such errors are caused by insufficient permissions on required directories where temporary files are created or accessed. Confirm that your application has the necessary permissions to write or read from the relevant folders [1][2].

  3. Alternative Versions: If upgrading is an option, InterSystems IRIS 2023.1 provides updates to QR code generation that do not rely on Java. This could simplify your setup by eliminating Java dependencies entirely [1][2].

If these steps don’t resolve the issue, additional debugging might be required to pinpoint the exact cause related to the specific setup of your problematic servers. [1][2]

Sources: