Version 0.61.0 fails to save on network share (SMB)

Bildschirmfoto 2023-02-22 um 05.42.39

!ENTRY name.abuchen.portfolio 1 0 2023-02-22 05:40:13.483
!MESSAGE Saving portfolio.xml with [XML]

!ENTRY name.abuchen.portfolio.ui 4 0 2023-02-22 05:40:13.493
!MESSAGE Operation not supported
!STACK 0
java.io.IOException: Operation not supported
	at java.base/sun.nio.ch.FileDispatcherImpl.lock0(Native Method)
	at java.base/sun.nio.ch.FileDispatcherImpl.lock(Unknown Source)
	at java.base/sun.nio.ch.FileChannelImpl.tryLock(Unknown Source)
	at java.base/java.nio.channels.FileChannel.tryLock(Unknown Source)
	at name.abuchen.portfolio.model.ClientFactory.writeFile(ClientFactory.java:621)
	at name.abuchen.portfolio.model.ClientFactory.saveAs(ClientFactory.java:592)
	at name.abuchen.portfolio.ui.editor.ClientInput.lambda$4(ClientInput.java:253)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:74)
	at name.abuchen.portfolio.ui.editor.ClientInput.doSaveAs(ClientInput.java:250)
	at name.abuchen.portfolio.ui.editor.PortfolioPart.doSaveAs(PortfolioPart.java:424)
	at name.abuchen.portfolio.ui.handlers.SaveAsFileHandler.execute(SaveAsFileHandler.java:116)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:317)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:251)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:173)
	at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:156)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:488)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:485)
	at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:213)
	at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.executeItem(HandledContributionItem.java:438)
	at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.handleWidgetSelection(AbstractContributionItem.java:449)
	at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.lambda$2(AbstractContributionItem.java:475)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4646)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1524)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1547)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1532)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1325)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4413)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3989)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1155)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1046)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
	at org.eclipse.e4.ui.internal.workbench.swt.E4Application.start(E4Application.java:168)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:402)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1467)

smbfs mount on macOS Monterey.

https://bugs.openjdk.org/browse/JDK-8167023

The reason seems to be that the JRE uses the call fcntl to try to lock files on these network shares. On OS X fcntl does not support locking files on AFP or SMB (I believe NFS works alright, but am not certain). A possible alternative is perhaps the call flock for AFP and SMB.

So - OSX Version of PP is brocken as of now.

Thanks for the research. I tested on macOS but not an AFP or SMB share. Not sure if I can detect this, but I can disable locking on macOS for now

1 Like

I have published a new version that removes the file lock on macOS. For now, it is only available via online update - will update the rest this evening. Thanks for your post and the link to the JDK bug tracker

1 Like

You are welcome. And thanks for the fast fix.
Works again.