訪問linux下部署於AAS的應用Could not initialize class sun.awt.X11GraphicsEnvironment的問題

來源:互聯網
上載者:User

同一個應用,在windows平台下開發,測試階段沒問題,然後部署到linux平台下,使用IE瀏覽器訪問,驗證碼(驗證碼以圖片形式展現),總是顯示不出來。然後,改用Firefox瀏覽器,直接在瀏覽器拋出:

java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironmentat java.lang.Class.forName0(Native Method)at java.lang.Class.forName(Class.java:169)at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:68)at java.awt.image.BufferedImage.createGraphics(BufferedImage.java:1135)at java.awt.image.BufferedImage.getGraphics(BufferedImage.java:1125)

而且,比較詭異的一個現象就是,我在IE下訪問,總是會把我原生Xmanager啟動起來。

搜尋一下此問題,出現這種情況一般就是啟動AAS的使用者無法訪問Xserver,包括Xserver沒有啟動或者沒有許可權訪問。

在AAS的啟動參數中加上了“-Djava.awt.headless=true”,重新啟動AAS,使用IE訪問,正常,也不再會把原生Xmanager起來,在FF下訪問,OK,也正常!

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.