Exception attempting to read file path from file upload

Using the latest 2025.90.4102
I did not have this issue before updating to this new 2025.9.0 version.
Error caught in a try-catch block:

Import T2202 CSV exception: java.lang.NullPointerException: Cannot invoke "java.nio.file.Path.toFile()" because the return value of "org.apache.commons.fileupload2.core.DiskFileItem.getPath()" is null
	at K:\Flying_Club\FlyingClubTuition\forms\t2202_csv_import.js:80 (callback_function_file_selected)


Here is the code- in the callback function of plugins.file.showFileUpload. Note that in the dialog the correct file name is displayed. But not in the file array passed into the callback function.

function callback_function_file_selected(files) {
	if(!files){
		msg = "no file selected";
		scopes.ui_converters.output_progress(msg, LOGGINGLEVEL.ERROR);
		return;
	}
	try {
	csv_file = files[0];
	var original_exists = csv_file.exists();
	} catch (e) {
		application.output('Import T2202 CSV exception: ' + e.message,LOGGINGLEVEL.FATAL);
		
	}
	
So is this a Rhino (debugger) version problem or a Jakarta problem or has the plugin changed?
Feedback appreciated.

this has nothing todo with Rhino or scripting
But we ask for something on the uploaded file but that whole uploaded file is not there.
Do you have a full stack trace in the log? how can you reproduce this?

The stack is as follows:

ERROR com.servoy.j2db.util.Debug - Failed to execute the method of context t2202_csv_import and name callback_function_file_selected on the solution FlyingClubTuition
	at K:\Flying_Club\FlyingClubTuition\forms\t2202_csv_import.js:78 (callback_function_file_selected)
org.mozilla.javascript.WrappedException: Wrapped java.lang.NullPointerException: Cannot invoke "java.nio.file.Path.toFile()" because the return value of "org.apache.commons.fileupload2.core.DiskFileItem.getPath()" is null (K:\Flying_Club\FlyingClubTuition\forms\t2202_csv_import.js#78)
	at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1937)
	at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:273)
	at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:283)
	at org.mozilla.javascript.Interpreter.doCallByteCode(Interpreter.java:3026)
	at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1980)
	at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:1159)
	at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:87)
	at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:347)
	at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:4565)
	at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:85)
	at com.servoy.j2db.scripting.ScriptEngine.executeFunction(ScriptEngine.java:749)
	at com.servoy.j2db.debug.RemoteDebugScriptEngine.executeFunction(RemoteDebugScriptEngine.java:386)
	at com.servoy.j2db.BasicFormController.executeFunction(BasicFormController.java:1190)
	at com.servoy.j2db.BasicFormController.executeFunction(BasicFormController.java:1067)
	at com.servoy.j2db.plugins.ClientPluginAccessProvider$MethodExecutor.run(ClientPluginAccessProvider.java:607)
	at com.servoy.j2db.server.ngclient.NGClient.invokeAndWait(NGClient.java:758)
	at com.servoy.j2db.server.ngclient.NGClient.invokeAndWait(NGClient.java:746)
	at com.servoy.j2db.plugins.ClientPluginAccessProvider.executeMethod(ClientPluginAccessProvider.java:450)
	at com.servoy.j2db.plugins.ClientPluginAccessProvider.executeMethod(ClientPluginAccessProvider.java:417)
	at com.servoy.j2db.scripting.FunctionDefinition.exec(FunctionDefinition.java:343)
	at com.servoy.j2db.scripting.FunctionDefinition.executeSync(FunctionDefinition.java:298)
	at com.servoy.extensions.plugins.file.FileProvider$1.uploadComplete(FileProvider.java:611)
	at com.servoy.j2db.server.ngclient.MediaResourcesServlet$2.run(MediaResourcesServlet.java:469)
	at org.sablo.eventthread.Event$1.run(Event.java:97)
	at org.sablo.websocket.CurrentWindow.runForWindow(CurrentWindow.java:80)
	at org.sablo.eventthread.Event.execute(Event.java:87)
	at org.sablo.eventthread.EventDispatcher.dispatch(EventDispatcher.java:144)
	at org.sablo.eventthread.EventDispatcher.run(EventDispatcher.java:90)
	at com.servoy.j2db.server.ngclient.eventthread.NGEventDispatcher.run(NGEventDispatcher.java:60)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException: Cannot invoke "java.nio.file.Path.toFile()" because the return value of "org.apache.commons.fileupload2.core.DiskFileItem.getPath()" is null
	at com.servoy.j2db.server.ngclient.MediaResourcesServlet$FileUploadData.getFile(MediaResourcesServlet.java:696)
	at com.servoy.extensions.plugins.file.UploadData.getFile(UploadData.java:49)
	at com.servoy.extensions.plugins.file.AbstractFile.exists(AbstractFile.java:109)
	at com.servoy.extensions.plugins.file.JSFile.js_exists(JSFile.java:226)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:252)
	... 28 more

Here is screen shot of the file upload dialog

How do I attach a test solution showing the exception?

There is something odd with the callbacks after selecting files. We can no longer upload a data import in Servoy 2025.06.2. We are working around by users copying and pasting data into a text field. I already reported this a while ago.

It is Ok in developer but not on Servoy cloud.

It is working ok in Servoy 2025.03.2.4044

It is working in Servoy 2025.06.1.4083

Perhaps I need to do a new download rather than use the upgrade from previous?

New download of Servoy.09.0.4102 to a new folder shows the failure.
So something broke between 6 and 9 with java.nio.file.Path.toFile() ?
I am assuming the npm issue about file upload is not a problem with this fresh download.

yes i fixed that by this commit:
null pointer check · Servoy/servoy-client@c9b1564

you can download the update.zip of the release branch (09) https://build.servoy.com/latest/servoy_release/servoy_update.zip
and drop/unzip that over your 09 install, that should fix this issue

This fix works.
Great job.
Any idea how it got “changed”?

yes because of the refactor for jakarta api a check was not done anymore