Closed tobiasdiez closed 11 months ago
This is a refined version of https://github.com/JabRef/jabref/issues/10025.
I am a university student and I would like to work on this issue for my university assignment. Could the maintainers please assign this to me please. I have followed the Contribution guidlines and I have set up the required workspace on my system.
As a general advice for newcomers: check out Contributing for a start. Also, guidelines for setting up a local workspace is worth having a look at.
Feel free to ask here at GitHub, if you have any issue related questions. If you have questions about how to setup your workspace use JabRef's Gitter chat. Try to open a (draft) pull-request early on, so that people can see you are working on the issue and so that they can see the direction the pull request is heading towards. This way, you will likely receive valuable feedback.
Hey. I am working on this issue. When I debug from searchByQueryFindsEntry() unit test in MathSciTest, I get success status code 200 when the query is executed in picture 1 in UrlDownload.Java. In the same picture, line 329, I'm guessing urlConnection.getInputStream() that it doesn't return the right value. The response value is Picture 2. This is causing the exception "internal parser error" when that response is converted to JSONObject. I am not too sure why urlConnection.getInputStream() is returning the HTML page instead of the proper response. Please guide me!
Picture 1:
Picture 2:
Hi, yes the parser error is clear at this point. You are trying to convert html into a json object which obviously isn't possible. Copy the request/url and paste it in your browser. It seems like you are getting back a html page instead of json And as you can see @tobiasdiez wrote in the first post that the URL has changed
I tried to find the exact position from where it is getting changed to an HTML page. I wanted to see what the InputStream I was getting, for that I created an Inner class to deserialize the stream. When the stream was deserialized an IO exception was thrown as "java.io.StreamCorruptedException: invalid stream header: 3C21444F". So I am guessing the output from search from MathSciNet might be wrong.
You should set a breakpoint in the various UriBuilder.toUrl methods so you see which URL is actually built Then paste that in your browser https://github.com/JabRef/jabref/blob/afb9e76cda1f224b41c12ff5ed79dd225263c983/src/main/java/org/jabref/logic/importer/fetcher/MathSciNet.java#L80
Deserializing stream does not work here because HTML cannot be converted to a java object...
Any progress here? Searching Math Sci Net is one of the features I use most often
@Enivex Can you test this version? https://builds.jabref.org/pull/10691/merge
I have no MathScinet subscription, so I could not test it at whole, but at least the query now looks the same as on the website and Adding new entry by mathscinet id works now as well.
JabRef version
Latest development branch build (please note build date below)
Operating system
Windows
Details on version and operating system
No response
Checked with the latest development build (copy version output from About dialog)
Steps to reproduce the behaviour
Search something with the Mathscinet fetcher. Get internal error for say url: https://mathscinet.ams.org/mathscinet/publications-search?pg7=ALLF&s7=query&r=1&extend=1&fmt=bibtex.
Appendix
The new API is as follows.
https://mathscinet.ams.org/mathscinet/api/publications/format?formats=bib&ids=4085669
(with ids being comma separated) yields:and
https://mathscinet.ams.org/mathscinet/api/publications/search?query=test¤tPage=1&pageSize=20&sort=newest
yields(no option for direct bibtex export as far as I can see)