Troubleshooting: ORA-29541 log error when running a report, DirectStreamReader could not be resolved
When you attempt to run a report in your Pega Platform™ application that is configured to query an unoptimized property (also known as an unexposed property), the report returns no results, and the following Oracle error message appears in the Pega log file.
Error
There was a problem getting a list: code: 29541 SQLState: 99999 Message: ORA-29541: class <schema name>.com/pega/pegarules/data/udf/directstreamreader/DirectStreamReader could not be resolved
Oracle's description of ORA-29541
Error Description:
Class string.string could not be resolved.
Error Cause:
An attempt was made to execute a method in a Java class that had not been previously and cannot now be compiled or resolved successfully.
Action:
Adjust the call or make the class resolvable.
Explanation
This error can occur for different reasons. In this particular case, the Oracle schema was replicated by importing an Oracle dump that was exported from a source schema that had a different name. As a result, the imported Pega out-of-the-box User Defined Functions (UDF) Java classes were still referring to the old schema name.
Suggested approach
Follow the instructions below to resolve all of the invalid Java classes, except for the class names ending with *DB2LUW and *DB2ZOS, which are for DB2 for Linux, UNIX and Windows (DB2 LUW) and DB2 for z/OS.
Step 1: Run DDL statements to resolve invalid Java classes
Using a database tool, such as Oracle SQL Developer, log in as the new schema user and run the following DDL statements.
ALTER JAVA CLASS " com/pega/pegarules/data/internal/clipboard/directstream/ByteArrayUtil"
RESOLVER ((*V62SP2)(* public))
RESOLVE;
ALTER JAVA CLASS " com/pega/pegarules/data/internal/clipboard/directstream/BadReferenceException"
RESOLVER ((*V62SP2)(* public))
RESOLVE;
ALTER JAVA CLASS "com/pega/pegarules/data/internal/clipboard/directstream/BadStreamDataException"
RESOLVER ((*V62SP2)(* public))
RESOLVE;
ALTER JAVA CLASS " com/pega/pegarules/data/internal/clipboard/directstream/DirectStream"
RESOLVER ((*V62SP2)(* public))
RESOLVE;
ALTER JAVA CLASS " com/pega/pegarules/data/internal/clipboard/directstream/DirectStreamEnvironmentAdapter"
RESOLVER ((*V62SP2)(* public))
RESOLVE;
ALTER JAVA CLASS " com/pega/pegarules/data/internal/clipboard/directstream/InflaterV7"
RESOLVER ((*V62SP2)(* public))
RESOLVE;
ALTER JAVA CLASS " com/pega/pegarules/data/internal/clipboard/directstream/PropertyReferenceUtilities"
RESOLVER ((*V62SP2)(* public))
RESOLVE;
ALTER JAVA CLASS " com/pega/pegarules/data/udf/directstreamreader/BasicEnvironmentAdapter"
RESOLVER ((*V62SP2)(* public))
RESOLVE;
ALTER JAVA CLASS " com/pega/pegarules/data/udf/directstreamreader/CachedDirectStream"
RESOLVER ((*V62SP2)(* public))
RESOLVE;
ALTER JAVA CLASS " com/pega/pegarules/data/udf/directstreamreader/DirectStreamReaderBase"
RESOLVER ((*V62SP2)(* public))
RESOLVE;
ALTER JAVA CLASS " com/pega/pegarules/data/udf/directstreamreader/DirectStreamReader"
RESOLVER ((*V62SP2)(* public))
RESOLVE;
ALTER JAVA CLASS " com/pega/pegarules/data/udf/directstreamreader/FixedCacheMap"
RESOLVER ((*V62SP2)(* public))
RESOLVE;
ALTER JAVA CLASS " com/pega/pegarules/data/udf/directstreamreader/UnsupportedFeatureException"
RESOLVER ((*V62SP2)(* public))
RESOLVE;
The following additional DDL statements apply to only Pega 7 Platform:
ALTER JAVA CLASS "com/pega/pegarules/data/internal/clipboard/directstream/DirectStreamV7"
RESOLVER ((*V62SP2)(* public))
RESOLVE;
ALTER JAVA CLASS "com/pega/pegarules/data/udf/directstreamreader/DirectStreamReaderBase$Version7"
RESOLVER ((*V62SP2)(* public))
RESOLVE;
ALTER JAVA CLASS "com/pega/pegarules/data/udf/directstreamreader/DirectStreamReaderBase"
RESOLVER ((*V62SP2)(* public))
RESOLVE;
Step 2: Check for and resolve any remaining invalid Java classes
After running the DDLs listed above, run the following Select query to check for any remaining invalid Java classes.
Select Dbms_Java.Longname(Object_Name) From User_Objects Where Status!='VALID'
AND object_type LIKE 'JAVA%';
If the output of the Select query shows invalid Java classes similar to those in the example below, you can safely ignore them because they are not specific to Oracle.
com/pega/pegarules/data/udf/directstreamreader/DirectStreamReaderPostgreSQL (this entry exists only in 7.x)
com/pega/pegarules/data/udf/directstreamreader/DirectStreamReaderDB2ZOS
com/pega/pegarules/data/udf/directstreamreader/DirectStreamReaderDB2LUW
If the output of the Select query returns other invalid Java classes, run the specific “ALTER JAVA CLASS…” statements again for those invalid Java classes. Repeat this process until only invalid Java classes for non-Oracle database platforms are listed. The issue is resolved when all of the Java classes show a valid state.
Step 3: Test the UDF functionality
You can test the UDF functionality by running the following query, which should now return rows without any errors.
SELECT pr_read_from_stream('pzInsKey', pzInsKey, pzPVStream) as "StringValue",
pr_read_int_from_stream('pzRuleSetVersionMajor', pzInsKey, pzPVStream) as "IntegerValue",
pr_read_decimal_from_stream('pzRuleSetVersionMinor', pzInsKey, pzPVStream) as "DecimalValue"
from pr4_rule where pxInsID like 'CANNOT%'