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

Problem with taxasim in headless mode #8

Open
iimog opened this issue Mar 3, 2015 · 1 comment
Open

Problem with taxasim in headless mode #8

iimog opened this issue Mar 3, 2015 · 1 comment

Comments

@iimog
Copy link

iimog commented Mar 3, 2015

When running the subcommand taxasim in an environment without a X11 server an Exception is thrown at the end of execution:

java -jar classifier.jar taxa-sim rdp.tax rdp.fa rdp.fa taxasim 8 rankFile sab
100
200
300
... [truncated]
Exception in thread "main" java.lang.InternalError: Can't connect to X11 window server using 'localhost:12.0' as the value of the DISPLAY variable.
        at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
        at sun.awt.X11GraphicsEnvironment.access$200(X11GraphicsEnvironment.java:62)
        at sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:178)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:142)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:190)
        at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:82)
        at sun.swing.SwingUtilities2.isLocalDisplay(SwingUtilities2.java:1406)
        at javax.swing.plaf.metal.MetalLookAndFeel.initComponentDefaults(MetalLookAndFeel.java:1563)
        at javax.swing.plaf.basic.BasicLookAndFeel.getDefaults(BasicLookAndFeel.java:147)
        at javax.swing.plaf.metal.MetalLookAndFeel.getDefaults(MetalLookAndFeel.java:1599)
        at javax.swing.UIManager.setLookAndFeel(UIManager.java:530)
        at javax.swing.UIManager.setLookAndFeel(UIManager.java:570)
        at javax.swing.UIManager.initializeDefaultLAF(UIManager.java:1320)
        at javax.swing.UIManager.initialize(UIManager.java:1407)
        at javax.swing.UIManager.maybeInitialize(UIManager.java:1395)
        at javax.swing.UIManager.getDefaults(UIManager.java:644)
        at javax.swing.UIManager.getColor(UIManager.java:686)
        at org.jfree.chart.JFreeChart.<clinit>(JFreeChart.java:261)
        at org.jfree.chart.ChartFactory.createXYLineChart(ChartFactory.java:1748)
        at edu.msu.cme.rdp.classifier.train.validation.distance.TaxaSimilarityMain.createPlot(TaxaSimilarityMain.java:324)
        at edu.msu.cme.rdp.classifier.train.validation.distance.TaxaSimilarityMain.main(TaxaSimilarityMain.java:385)
        at edu.msu.cme.rdp.classifier.cli.ClassifierMain.main(ClassifierMain.java:79)

The plot is not generated and the txt output is incomplete. This error can be avoided by invocing the classifier in headless mode:

java -Djava.awt.headless=true -jar classifier.jar taxa-sim rdp.tax rdp.fa rdp.fa taxasim 8 rankFile sab

This workaround should be documented or else the problem can be fixed in code by adding

System.setProperty("java.awt.headless", "true");

before any graphics code (e.g. in a static {} block)
See this post on Stack Overflow.

Cheers, Markus Ankenbrand

@wangqion
Copy link
Contributor

wangqion commented Apr 9, 2015

Thanks a lot for your feedback and suggestions. We will update our document and the source code.

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

No branches or pull requests

2 participants