Discussion
Pegasystems Inc.
JP
Last activity: 16 Aug 2021 19:48 EDT
How to suppress "Invalid reference to non-public interface" exception
Hi,
Customer reported that when Connect-File is used, exception "Invalid reference to non-public interface" is observed in the PegaRULES log file. This happens only once after system restarts (from the second time it won't happen). In this post, I am sharing how to suppress this exception.
1. Steps to reproduce
Create an activity that calls Connect-File method.
Run the activity. If this activity is called for the fist time after system restart, you should see below two WARN messages in the PegaRULES log.
2021-08-17 12:16:45,651 [http-nio-8080-exec-4] [ STANDARD] [ ] [ MyApp:01.01.01] (il.classloader.PRClassLoaderDB) WARN localhost| Proprietary information hidden kensho.tsuchihashi - Invalid reference to non-public interface from class "com.pegarules.generated.activity.ra_action_invoke_bb167f0f0ebadca59c933b9babbc26ea" to "com.pega.pegarules.storage.fs.resadaptor.OutputStreamWrapper" 2021-08-17 12:16:45,712 [http-nio-8080-exec-4] [ STANDARD] [ ] [ MyApp:01.01.01] (il.classloader.PRClassLoaderDB) WARN localhost| Proprietary information hidden| Proprietary information hidden kensho.tsuchihashi - Invalid reference to non-public interface from class "com.pegarules.generated.activity.ra_action_invoke_bb167f0f0ebadca59c933b9babbc26ea" to "com.pega.pegarules.storage.fs.resadaptor.RAFile"
2. Root cause
The error message originates from a loadClass method in PRClassLoaderDB class. When the package name does not match the public API packages, the error is shown in the log. However, the class loads correctly and there is no functional impact on the application behavior.
3. Resolution
Although we know this is a warning message, not an error message, system shouldn't throw an exception for no reason. Connect-File is properly used. If you want to suppress this warning, you can create two Dynamic System Settings below.
3-1. publicinterfacepackages
Owning Ruleset: Pega-Engine
Setting Purpose: prconfig/classloader/publicinterfacepackages/default
Value: com.pega.pegarules.storage
3-2. allowpublicinterfaceonly
Owning Ruleset: Pega-Engine
Setting Purpose: prconfig/classloader/allowpublicinterfaceonly/default
Value: false
This solution is safe and it shouldn't make any impact on your custom application. It is confirmed by SME.
* Please see below article for your reference. This is the same exception but originates from different operation (This one is already fixed).
Thanks,