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

Make logger instances vars in linux #9909

Merged
merged 3 commits into from
May 16, 2023
Merged

Make logger instances vars in linux #9909

merged 3 commits into from
May 16, 2023

Conversation

Siedlerchr
Copy link
Member

Fixes #9908

Compulsory checks

Preview Give feedback

@github-actions
Copy link
Contributor

Your code currently does not meet JabRef's code guidelines. The tool reviewdog already placed comments on GitHub to indicate the places. See the tab "Files" in you PR. Please carefully follow the setup guide for the codestyle. Afterwards, please run checkstyle locally and fix the issues.

More information on code quality in JabRef is available at https://devdocs.jabref.org/getting-into-the-code/development-strategy.html.

@HoussemNasri
Copy link
Member

Runs flawlessly on OpenSUSE Leap 15, however, I got this exception, don't know if it's relevant.

2023-05-16 19:33:29 [JavaFX Application Thread] org.jabref.preferences.JabRefPreferences.getUser()
ERROR: Hostname not found. Please go to https://docs.jabref.org/ to find possible problem resolution: java.net.UnknownHostException: localhost.localdomain: localhost.localdomain: Name or service not known
	at java.base/java.net.InetAddress.getLocalHost(InetAddress.java:1781)
	at [email protected]/org.jabref.preferences.JabRefPreferences.getUser(JabRefPreferences.java:2023)
	at [email protected]/org.jabref.preferences.JabRefPreferences.getInternalPreferences(JabRefPreferences.java:1995)
	at [email protected]/org.jabref.preferences.JabRefPreferences.getFilePreferences(JabRefPreferences.java:2116)
	at [email protected]/org.jabref.preferences.JabRefPreferences.getLayoutFormatterPreferences(JabRefPreferences.java:1124)
	at [email protected]/org.jabref.preferences.JabRefPreferences.lambda$getPreviewLayouts$118(JabRefPreferences.java:2353)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
	at [email protected]/org.jabref.preferences.JabRefPreferences.getPreviewLayouts(JabRefPreferences.java:2357)
	at [email protected]/org.jabref.preferences.JabRefPreferences.getPreviewPreferences(JabRefPreferences.java:2313)
Hostname not found. Please go to https://docs.jabref.org/ to find possible problem resolution: java.net.UnknownHostException: localhost.localdomain: localhost.localdomain: Name or service not known

	at [email protected]/org.jabref.gui.JabRefFrame.createMenu(JabRefFrame.java:814)
	at [email protected]/org.jabref.gui.JabRefFrame.initLayout(JabRefFrame.java:502)
	at [email protected]/org.jabref.gui.JabRefFrame.init(JabRefFrame.java:648)
	at [email protected]/org.jabref.gui.JabRefGUI.openWindow(JabRefGUI.java:79)
	at [email protected]/org.jabref.gui.JabRefGUI.<init>(JabRefGUI.java:59)
	at [email protected]/org.jabref.gui.MainApplication.start(MainApplication.java:31)
	at javafx.graphics@20/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:839)
	at javafx.graphics@20/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:483)
	at javafx.graphics@20/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:456)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at javafx.graphics@20/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:455)
	at javafx.graphics@20/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
	at javafx.graphics@20/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
	at javafx.graphics@20/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(GtkApplication.java:316)
	at java.base/java.lang.Thread.run(Thread.java:1589)
Caused by: java.net.UnknownHostException: localhost.localdomain: Name or service not known
	at java.base/java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
	at java.base/java.net.Inet6AddressImpl.lookupAllHostAddr(Inet6AddressImpl.java:52)
	at java.base/java.net.InetAddress$PlatformResolver.lookupByName(InetAddress.java:1059)
	at java.base/java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1673)
	at java.base/java.net.InetAddress$NameServiceAddresses.get(InetAddress.java:1003)
	at java.base/java.net.InetAddress.getAllByName0(InetAddress.java:1663)
	at java.base/java.net.InetAddress.getLocalHost(InetAddress.java:1776)
	... 29 more
Caused by: java.net.UnknownHostException: localhost.localdomain: Name or service not known
` ` ` 

HoussemNasri
HoussemNasri previously approved these changes May 16, 2023
Copy link
Member

@HoussemNasri HoussemNasri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@Siedlerchr
Copy link
Member Author

Thanks for testing. The other exceptions comes from
userName = get(DEFAULT_OWNER) + '-' + InetAddress.getLocalHost().getHostName();

and indeed it seems to be not that an easy option to get the hostname.
One could add a check InetAddress.getLocalHost().isLoopbackAddress() or in case of the exception try again with
and then do a fallback to call the hostname command
https://stackoverflow.com/questions/7348711/recommended-way-to-get-hostname-in-java

@Siedlerchr Siedlerchr merged commit 0247913 into main May 16, 2023
@Siedlerchr Siedlerchr deleted the fixLogger branch May 16, 2023 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Development branch: Linux portable version does not start
2 participants