NullPointerException when record producer code trying to load import set
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hello I am trying to implement a record producer based on sys_data_source that will allow the automatic loading of an attached CSV file.
I have seen a number of other posts and web resources that suggested that the following record producer server script should be successful in doing this:
on submit this code should initialise a record in the sys_data_source table with appropriate values to allow import of a CSV file attached to the record, then populate the import set and apply the transform map.
I see that the record is created in the sys_data_source table and it has the CSV file attached (as expected).
However the loading of the import set is not succeeding. In the log file I see the following NullPointerException error when trying to call ImportSetLoader().loadImportSetTable function:
Stack trace: at sc_cat_item_producer.3a4b061f937a43d094bb70aefaba103e.script ➚:11 at sys_ws_operation.4b9f0a8967101200d22b794717415a30.operation_script ➚:60 (process) at sys_ws_operation.4b9f0a8967101200d22b794717415a30.operation_script ➚:73 Root cause of JavaScriptException: java.lang.NullPointerException : java.lang.NullPointerException: Cannot invoke "com.glide.db.impex.datasource.DataSource.getLoader()" because "dataSource" is null: com.glide.system_import_set.ImportSetLoader.loadImportSetTable(ImportSetLoader.java:51) com.glide.system_import_set.ImportSetLoader.loadImportSetTable(ImportSetLoader.java:45) java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) java.base/java.lang.reflect.Method.invoke(Method.java:580) org.mozilla.javascript.MemberBox.invoke(MemberBox.java:268) org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:300) org.mozilla.javascript.ScriptRuntime.doCall(ScriptRuntime.java:3570)
Note this is with Australia release. Is the code I have been using no longer compatible?
Has anyone else successfully implemented a similar solution?
Any hints how to resolve the exception error?