BookmarkSubscribeRSS Feed

SAS Enterprise Miner 15.3 Java Score Generation returns ERROR: TScore Java code generation failed

Started ‎02-16-2023 by
Modified ‎02-16-2023 by
Views 501

Beginning in SAS Enterprise Miner 15.3, an underlying change occurred that affects the generation of the Java Score Code from the Score node. In SAS 9.4M8 (TS1M8), which is the underlying SAS version for SAS Enterprise Miner 15.3, the private Java Runtime Environment (JRE) that is shipped is Java 11. In previous versions, the SAS private JRE is Java 8. This update affects the Java Score Code generation because the required Java Runtime JAR file (rt.jar) does not exist anymore.   

Let's assume your project has a standard flow within a diagram as seen below:

 

CraigDeVault_0-1676485476437.png

 

If the JAR file is not updated, the results do not return two of the four expected Java score files even though the node indicates that it ran successfully:

 

CraigDeVault_1-1676485577584.png

 

In the log file, these error messages occur:

 

TScore NOTE: Start Java code generation ........

PATHJSCORECODE.sas 1: Could not load class java/lang/Object.

PATHJSCORECODE.sas 1: Could not load class java/lang/Object.

PATHJSCORECODE.sas 1: Could not load superclass java/lang/Object.

WARNING: Beginning in SAS Enterprise Miner 15.3, the Java score code generation utility requires that a jar file be manually installed. Please see documentation for instructions.

ERROR: TScore Java code generation failed.

*------------------------------------------------------------*

* Warning: A problem was encountered while generating the Java score code.

*------------------------------------------------------------*

 

To be able to generate Java Score code, you must create a new Java JAR file and modify a SAS Runtime environment variable (DTJ_CLASSPATH), which is defined in the SAS configuration file. 

 

Note: Before completing these steps to address the problem, back up the SAS configuration file (sasv9.cfg).

 

 Instructions for Microsoft Windows (x64)

 

To create the Java JAR file javabase.jar on a Windows x64 machine, complete these steps:

 

  1. Download the JDK 11 package from jdk.java.net.
  2. Unzip the file to your C: drive. For example, the unzipped file can be C:\jdk-11.
  3. Open a DOS command prompt and set the JAVA_HOME environment variable with this command: set JAVA_HOME=C:\jdk-11
  4. Update the path with this command: path=%JAVA_HOME%\bin;%path%
  5. Create the temporary directory, C:\tempjar, and change directory to C:\tempjar.
  6. Extract the Java base classes with this command: jmod.exe extract %JAVA_HOME%\jmods\java.base.jmod --dir C:\tempjar
  7. Change directory to extracted classes with this command: cd C:\tempjar\classes
  8. Create the Java JAR file javabase.jar with this command: jar.exe -cf javabase.jar *

 

To add the Java javabase.jar file to your SAS directory and update the SAS configuration file on a Windows system, complete these steps:

 

  1. Copy the Java JAR file javabase.jar from C:\tempjar\classes to this directory: C:\Program Files\SASHome\SASFoundation\9.4\dmine\sasmisc
  2. Locate the SAS configuration file: C:\Program Files\SASHome\SASFoundation\9.4\nls\en\sasv9.cfg
  3. In the sasv9.cfg file, find the variable DTJ_CLASSPATH and append the javabase.jar file to it. For example, the modified line will be as follows:

 

-SET DTJ_CLASSPATH "C:\Program Files\SASHome\SASFoundation\9.4\dmine\sasmisc\dtj.jar;C:\Program Files\SASHome\SASFoundation\9.4\dmine\sasmisc\javabase.jar"

 

Instructions for Linux (x64)

 

To create the Java javabase.jar file on a Linux x64 machine, complete these steps:

 

  1. Download the JDK 11 package from jdk.java.net.
  2. In an Xterm, create the temporary directory /tmp/jdk with this command: mkdir /tmp/jdk
  3. Move the downloaded openjdk-11+28_linux-x64_bin.tar.gz file to the /tmp/jdk directory. 
  4. Change directory to /tmp/jdk with this command: cd /tmp/jdk
  5. Uncompress the file with this command: gunzip openjdk-11+28_linux-x64_bin.tar.gz
  6. Extract the JDK files with this command: tar -xf openjdk-11+28_linux-x64_bin.tar
  7. Set the JDK path with this command: export PATH=/tmp/jdk/jdk-11/bin:$PATH
  8. Extract the Java base classes with this command: jmod extract /tmp/jdk/jdk-11/jmods/java.base.jmod --dir /tmp/jdk
  9. Change directory to /tmp/jdk/classes with this command: cd /tmp/jdk/classes
  10. Create the Java javabase.jar file with this command: jar -cf javabase.jar *

 

To add the Java javabase.jar file to the SAS directory and update the SAS configuration file on a Linux system, complete these steps:

 

  1. Find the SASHome location and set the SASHome environment variable: export SASHome=/usr/local/SAS
  2. Copy the Java javabase.jar file to the $SASHome/SASFoundation/9.4/misc/dmine directory.
  3. Edit the SAS $SASHome/SASFoundation/9.4/sasv9.cfg configuration file by appending $SASHome/SASFoundation/9.4/misc/dmine/javabase.jar file to the variable DTJ_CLASSPATH. For example, the modified line that contains DTJ_CLASSPATH will be as follows: -SET DTJ_CLASSPATH "/usr/local/SAS/SASFoundation/9.4/misc/dmine/dtj.jar:/usr/local/SAS/SASFoundation/9.4/misc/dmine/javabase.jar"

 

Restart SAS Enterprise Miner and rerun the flow.  If you encounter any issues, contact SAS Technical Support.

Version history
Last update:
‎02-16-2023 12:58 PM
Updated by:
Contributors

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

Free course: Data Literacy Essentials

Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning  and boost your career prospects.

Get Started

Article Tags