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

JabRef no longer pushes citations to TeXstudio #4041

Closed
jimboz opened this issue May 21, 2018 · 5 comments
Closed

JabRef no longer pushes citations to TeXstudio #4041

jimboz opened this issue May 21, 2018 · 5 comments
Assignees
Labels
bug Confirmed bugs or reports that are very likely to be bugs os: macOS

Comments

@jimboz
Copy link

jimboz commented May 21, 2018

Hi,

JabRef version 4.2
MacOS High Sierra
Java 1.8.0_112 (also tested on 10.0.1)

Steps to reproduce:

  1. Launch JabRef and TeXstudio
  2. Select a bibliographic item
  3. Click push to TeXstudio
  4. Nothing happens

In settings 'External Programs' path to TeXstudio: /Applications/texstudio.app/Contents/MacOS/texstudio

Previously worked very well until latest upgrade JabRef to 4.2.

Thanks in advance,

@Siedlerchr
Copy link
Member

Do you get any error in the log? Help-> View Event log?
On Windows 10 this works as expected.

@jimboz
Copy link
Author

jimboz commented May 22, 2018

Hi thanks for the prompt reply,

Yes, the error logged:

Error: Could not call executable '/Applications/texstudio.app/Contents/MacOS/texstudio'.
java.io.IOException: Cannot run program "open -a /Applications/texstudio.app/Contents/MacOS/texstudio -n --args --insert-cite \cite{2016Arita}": error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at org.jabref.gui.push.AbstractPushToApplication.pushEntries(AbstractPushToApplication.java:75)
at org.jabref.gui.push.PushToApplicationAction.run(PushToApplicationAction.java:72)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.(UNIXProcess.java:247)
at java.lang.ProcessImpl.start(ProcessImpl.java:134)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
... 5 more

When I actually run in a terminal the command:
"open -a /Applications/texstudio.app/Contents/MacOS/texstudio -n --args --insert-cite \cite{2016Arita}", I get the following inserted into the text of TeXstudio: "\cite{cite{2016Arita}}"

So the TeXstudio application is found when the command line is used and works as expected, but not through JabRef? The path to TeXstudio appears to be correct.

@halirutan
Copy link
Collaborator

halirutan commented May 25, 2018

I believe this is a valid issue. I could reproduce it with the current master and what happens is highly non-trivial to me. I'm almost certain that the bug is not JabRef's fault but it has its cause much deeper in java.lang.UNIXProcess. Initially, I thought it might be problematic that we give the command as one string as opposed to a list of arguments, but that seems not the case. I could track it down to

return new UNIXProcess      
    (toCString(cmdarray[0]),
     argBlock, args.length, 
     envBlock, envc[0],     
     toCString(dir),        
         std_fds,           
     redirectErrorStream);  
}

inside java.lang.ProcessImpl but at the moment, I have no clue what happens there. As @jimboz already observed, running the command from the terminal does the correct thing. Maybe I have time on the weekend to have a closer look.

@halirutan halirutan added the bug Confirmed bugs or reports that are very likely to be bugs label May 25, 2018
halirutan pushed a commit that referenced this issue May 25, 2018
For unknown reasons, it seems no longer possible to give the command
as one single string. I created a test class and not even simple commands
can be executed. I'm not sure when this changed but giving the command
as list of each argument works as expected.
@halirutan halirutan self-assigned this May 25, 2018
@halirutan
Copy link
Collaborator

I have to revise my analysis. My initial guess was correct and the reason for the bug seems to be that we provide the command as one long string. @jimboz can you test this JabRef version?

https://builds.jabref.org/bug_4041_pushToTSfails/

Siedlerchr added a commit that referenced this issue May 27, 2018
…leType

* upstream/master: (33 commits)
  Import inspection uses now same font size setttings as maintable (#4062)
  Add date checker (#4007)
  Enable tests
  macOs push to application fix
  Fix #4041 to make Push to Application work again on OSX. (#4057)
  Add NormalizeEnDashesFormatter (#4045)
  Package private for tests
  Shutdown duplicate code
  Move migrations to PreferencesMigrations
  Structure startup
  Extract migrations
  A first solution for the cli problem #4038 (#4047)
  New translations JabRef_en.properties (French) (#4052)
  Update CHANGELOG.md
  Fix checkstyle
  Make test more informative in the failing case
  New translations JabRef_en.properties (French) (#4051)
  New translations JabRef_en.properties (Vietnamese) (#4050)
  Make Formatter an abstract class (and remove AbstractFormatter)
  New Crowdin translations (#4048)
  ...

# Conflicts:
#	CHANGELOG.md
@jimboz
Copy link
Author

jimboz commented May 28, 2018

Thank you guys! I can confirm the JabRef_macos_4_3-dev--snapshot-2018-05-27--master--XXX.dmg version now pushes citations to TeXstudio.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed bugs or reports that are very likely to be bugs os: macOS
Projects
None yet
Development

No branches or pull requests

3 participants