Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception when trying to change a linked file's path (being an URL) #11020

Open
2 tasks done
ror3d opened this issue Mar 13, 2024 · 5 comments
Open
2 tasks done

Exception when trying to change a linked file's path (being an URL) #11020

ror3d opened this issue Mar 13, 2024 · 5 comments

Comments

@ror3d
Copy link
Contributor

ror3d commented Mar 13, 2024

JabRef version

Latest development branch build (please note build date below)

Operating system

Windows

Details on version and operating system

Windows 11

Checked with the latest development build (copy version output from About dialog)

  • I made a backup of my libraries before testing the latest development version.
  • I have tested the latest development version and the problem persists

Steps to reproduce the behaviour

  1. Use the jabref extension to download any article (for example https://arxiv.org/abs/2304.04088 )
  2. Have the checkbox "Download linked online files" unchecked
  3. Go to the General tab for the entry
  4. Right-click one of the file entries and select Edit
  5. Click on the folder icon next to the Link entry "Browse"
  6. Notice an exception is thrown when the online url is attempted to be opened as a directory

Expected result
Clicking on the folder icon to browse for a new file when the existing text is an online URL should open the file browser in the library's default data directory.

Appendix

@TechReport{Belhe.Xu.eaImportanceSamplingBRDF2023,
author = {Belhe, Yash and Xu, Bing and Bangaru, Sai Praveen and Ramamoorthi, Ravi and Li, Tzu-Mao},
title = {Importance {Sampling} {BRDF} {Derivatives}},
year = {2023},
month = apr,
note = {arXiv:2304.04088 [cs] type: article},
abstract = {We propose a set of techniques to efficiently importance sample the derivatives of several BRDF models. In differentiable rendering, BRDFs are replaced by their differential BRDF counterparts which are real-valued and can have negative values. This leads to a new source of variance arising from their change in sign. Real-valued functions cannot be perfectly importance sampled by a positive-valued PDF and the direct application of BRDF sampling leads to high variance. Previous attempts at antithetic sampling only addressed the derivative with the roughness parameter of isotropic microfacet BRDFs. Our work generalizes BRDF derivative sampling to anisotropic microfacet models, mixture BRDFs, Oren-Nayar, Hanrahan-Krueger, among other analytic BRDFs. Our method first decomposes the real-valued differential BRDF into a sum of single-signed functions, eliminating variance from a change in sign. Next, we importance sample each of the resulting single-signed functions separately. The first decomposition, positivization, partitions the real-valued function based on its sign, and is effective at variance reduction when applicable. However, it requires analytic knowledge of the roots of the differential BRDF, and for it to be analytically integrable too. Our key insight is that the single-signed functions can have overlapping support, which significantly broadens the ways we can decompose a real-valued function. Our product and mixture decompositions exploit this property, and they allow us to support several BRDF derivatives that positivization could not handle. For a wide variety of BRDF derivatives, our method significantly reduces the variance (up to 58x in some cases) at equal computation cost and enables better recovery of spatially varying textures through gradient-descent-based inverse rendering.},
creationdate = {2024-03-13T16:54:08},
doi = {10.48550/arXiv.2304.04088},
file = {arXiv Fulltext PDF:https://arxiv.org/pdf/2304.04088.pdf:application/pdf;arXiv.org Snapshot:http://arxiv.org/abs/2304.04088:text/html},
keywords = {Computer Science - Graphics},
modificationdate = {2024-03-13T16:54:08},
owner = {Roc},
school = {arXiv},
url = {http://arxiv.org/abs/2304.04088},
urldate = {2024-03-13},
}

@Siedlerchr
Copy link
Member

In the latest dev version I don't get any exception https://builds.jabref.org/main/
Opening the folder works fine and I can replae it with a local file.

@Siedlerchr Siedlerchr added the status: waiting-for-feedback The submitter or other users need to provide more information about the issue label Mar 13, 2024
@ror3d
Copy link
Contributor Author

ror3d commented Mar 13, 2024

I'm using the version open from intellij as downloaded from the main branch a couple hours ago.

image
image
image
image

These are the exeption details:

java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at [email protected]/javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1858)
	at [email protected]/javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(FXMLLoader.java:1726)
	at [email protected]/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
	at [email protected]/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:232)
	at [email protected]/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:189)
	at [email protected]/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
	at [email protected]/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
	at [email protected]/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at [email protected]/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at [email protected]/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at [email protected]/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at [email protected]/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at [email protected]/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
	at [email protected]/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
	at [email protected]/javafx.event.Event.fireEvent(Event.java:198)
	at [email protected]/javafx.scene.Node.fireEvent(Node.java:8875)
	at [email protected]/javafx.scene.control.Button.fire(Button.java:203)
	at [email protected]/com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(ButtonBehavior.java:207)
	at [email protected]/com.sun.javafx.scene.control.inputmap.InputMap.handle(InputMap.java:274)
	at [email protected]/com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:247)
	at [email protected]/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
	at [email protected]/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:232)
	at [email protected]/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:189)
	at [email protected]/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
	at [email protected]/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
	at [email protected]/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at [email protected]/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at [email protected]/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at [email protected]/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at [email protected]/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at [email protected]/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
	at [email protected]/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
	at [email protected]/javafx.event.Event.fireEvent(Event.java:198)
	at [email protected]/javafx.scene.Scene$MouseHandler.process(Scene.java:3984)
	at [email protected]/javafx.scene.Scene.processMouseEvent(Scene.java:1890)
	at [email protected]/javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2708)
	at [email protected]/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:411)
	at [email protected]/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:301)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
	at [email protected]/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(GlassViewEventHandler.java:450)
	at [email protected]/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:424)
	at [email protected]/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:449)
	at [email protected]/com.sun.glass.ui.View.handleMouseEvent(View.java:551)
	at [email protected]/com.sun.glass.ui.View.notifyMouse(View.java:937)
	at [email protected]/com.sun.glass.ui.win.WinApplication._enterNestedEventLoopImpl(Native Method)
	at [email protected]/com.sun.glass.ui.win.WinApplication._enterNestedEventLoop(WinApplication.java:212)
	at [email protected]/com.sun.glass.ui.Application.enterNestedEventLoop(Application.java:515)
	at [email protected]/com.sun.glass.ui.EventLoop.enter(EventLoop.java:107)
	at [email protected]/com.sun.javafx.tk.quantum.QuantumToolkit.enterNestedEventLoop(QuantumToolkit.java:650)
	at [email protected]/javafx.stage.Stage.showAndWait(Stage.java:469)
	at [email protected]/javafx.scene.control.HeavyweightDialog.showAndWait(HeavyweightDialog.java:162)
	at [email protected]/javafx.scene.control.Dialog.showAndWait(Dialog.java:346)
	at [email protected]/org.jabref.gui.JabRefDialogService.showCustomDialogAndWait(JabRefDialogService.java:289)
	at [email protected]/org.jabref.gui.fieldeditors.LinkedFileViewModel.edit(LinkedFileViewModel.java:378)
	at [email protected]/org.jabref.gui.fieldeditors.LinkedFilesEditor$ContextAction.execute(LinkedFilesEditor.java:376)
	at [email protected]/org.jabref.gui.actions.JabRefAction.lambda$new$3(JabRefAction.java:40)
	at [email protected]/org.controlsfx.control.action.Action.handle(Action.java:423)
	at [email protected]/org.controlsfx.control.action.Action.handle(Action.java:64)
	at [email protected]/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
	at [email protected]/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:232)
	at [email protected]/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:189)
	at [email protected]/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
	at [email protected]/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at [email protected]/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
	at [email protected]/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
	at [email protected]/javafx.event.Event.fireEvent(Event.java:198)
	at [email protected]/javafx.scene.control.MenuItem.fire(MenuItem.java:459)
	at [email protected]/com.sun.javafx.scene.control.ContextMenuContent$MenuItemContainer.doSelect(ContextMenuContent.java:1415)
	at [email protected]/com.sun.javafx.scene.control.ContextMenuContent$MenuItemContainer.lambda$createChildren$12(ContextMenuContent.java:1368)
	at [email protected]/com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:247)
	at [email protected]/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
	at [email protected]/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:232)
	at [email protected]/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:189)
	at [email protected]/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
	at [email protected]/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
	at [email protected]/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at [email protected]/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at [email protected]/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at [email protected]/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at [email protected]/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at [email protected]/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at [email protected]/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at [email protected]/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
	at [email protected]/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
	at [email protected]/javafx.event.Event.fireEvent(Event.java:198)
	at [email protected]/javafx.scene.Scene$MouseHandler.process(Scene.java:3984)
	at [email protected]/javafx.scene.Scene.processMouseEvent(Scene.java:1890)
	at [email protected]/javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2708)
	at [email protected]/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:411)
	at [email protected]/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:301)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
	at [email protected]/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(GlassViewEventHandler.java:450)
	at [email protected]/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:424)
	at [email protected]/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:449)
	at [email protected]/com.sun.glass.ui.View.handleMouseEvent(View.java:551)
	at [email protected]/com.sun.glass.ui.View.notifyMouse(View.java:937)
	at [email protected]/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
	at [email protected]/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:185)
	at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:118)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at com.sun.javafx.reflect.Trampoline.invoke(MethodUtil.java:72)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at [email protected]/com.sun.javafx.reflect.MethodUtil.invoke(MethodUtil.java:270)
	at [email protected]/com.sun.javafx.fxml.MethodHelper.invoke(MethodHelper.java:84)
	at [email protected]/javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1853)
	... 98 more
Caused by: java.nio.file.InvalidPathException: Illegal char <:> at index 5: https://arxiv.org/pdf/2304.04088.pdf
	at java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:204)
	at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:175)
	at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
	at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
	at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:231)
	at java.base/java.nio.file.Path.of(Path.java:148)
	at [email protected]/org.jabref.gui.linkedfile.LinkedFilesEditDialogViewModel.openBrowseDialog(LinkedFilesEditDialogViewModel.java:79)
	at [email protected]/org.jabref.gui.linkedfile.LinkedFileEditDialogView.openBrowseDialog(LinkedFileEditDialogView.java:74)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	... 105 more

@Siedlerchr
Copy link
Member

Ah Okay seems odd and a windows issue... Tested on mac

@Siedlerchr Siedlerchr added [outdated] type: bug Confirmed bugs or reports that are very likely to be bugs platform: windows and removed status: waiting-for-feedback The submitter or other users need to provide more information about the issue labels Mar 13, 2024
@koppor
Copy link
Member

koppor commented Mar 14, 2024

The most important element of the stack trace is

Caused by: java.nio.file.InvalidPathException: Illegal char <:> at index 5: https://arxiv.org/pdf/2304.04088.pdf

There is an if missing. If the link is an online link, do NOT rename on the file system, just rename the field value.

@Siedlerchr Did you really use https://arxiv.org/pdf/2304.04088.pdf as file name for testing?

@koppor koppor changed the title Exception when trying to change a linked file's path Exception when trying to change a linked file's path (being an URL) Mar 14, 2024
@koppor
Copy link
Member

koppor commented Mar 14, 2024

Note that this confusion comes, because we also store URLs in the file field - and not only references to local files.

Generally, this refs #98.

Example issues and fixes: #8514

@github-project-automation github-project-automation bot moved this to Normal priority in Prioritization Mar 14, 2024
@koppor koppor moved this from Normal priority to Low priority in Prioritization Mar 14, 2024
@calixtus calixtus removed the [outdated] type: bug Confirmed bugs or reports that are very likely to be bugs label Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Low priority
Development

No branches or pull requests

4 participants