View previous topic :: View next topic |
Author |
Message |
pixelord
Joined: 24 Oct 2011 Posts: 15
|
Posted: Tue Dec 03, 2013 8:00 Post subject: Headless build issue. |
|
|
Hi,
I am trying to integrate a simple Jframe UI in my jvm plugin for my research work.
The idea is to add some data visualization with the plugin.
I tried to initialize a JFrame in the setup function of my initListener class.
However, it is throwing an exception related to headless java:
Code: |
NWNX2lib: Init
NWNX2lib: org SetString() at 81f41b4, new SetString() at b772b43a
NWNX2lib: org GetObj() at 81f40bc, new GetObj() at b772b462
* Parsing configuration...
NWN Extender v2.8-dev
(c) 2004 by the APS/NWNX Linux Conversion Group
(c) 2007-2010 by virusman and Acaos
Based on the Win32 version (c) 2003 by Ingmar Stieger (Papillon)
and Jeroen Broekhuizen
visit us at http://www.avlis.org
* Searching for signatures...
* Loading modules...
Exception in thread "main" java.awt.HeadlessException
at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:173)
at java.awt.Window.<init>(Window.java:546)
at java.awt.Frame.<init>(Frame.java:419)
at javax.swing.JFrame.<init>(JFrame.java:218)
at nwn.gm.story.StoryNet.createJFarme(Unknown Source)
at nwn.gm.InitGMAgent.setup(Unknown Source)
FATAL ERROR in native method: while executing native code CallStaticVoidMethod(this->cls_initListener, this->jmethodJavaSetup)
Aborted (core dumped)
|
Is there any way to get around this issue? _________________ Pixelord |
|
Back to top |
|
|
elven
Joined: 28 Jul 2006 Posts: 259 Location: Germany
|
Posted: Tue Dec 03, 2013 12:53 Post subject: |
|
|
Phew. Good question.
Make sure you have a full JDK installed and not just jre-headless.
But I don't think that's it - there's probably some kind of init code you need to run in order to support UI stuff in embedded JVMs. I have no clue as to what that is though, sorry.
Just a thought - maybe it's simpler to expose some kind of JMX interface and connect to that with a external UI app? Might make development simpler too.
Edit: try passing -Djava.awt.headless=false in nwnx2.ini? |
|
Back to top |
|
|
pixelord
Joined: 24 Oct 2011 Posts: 15
|
Posted: Tue Dec 03, 2013 13:01 Post subject: |
|
|
No my Jre is not headless, as I could create the Jframe from a UnitTest class, which contain a main function. Issues arises, when try to initiate the JFrame from setup method (the plugin hooked to server and running), throw the headless exception.
I'll try your parameter idea though. Thanks. _________________ Pixelord |
|
Back to top |
|
|
pixelord
Joined: 24 Oct 2011 Posts: 15
|
Posted: Wed Dec 04, 2013 3:30 Post subject: |
|
|
I found the issue. Even though I was using oracle JDK 1.6, the default jre-headless was still installed. my console class was refering to openJDK headless library.
As soon as I passed the "-Djava.awt.headless=false" vmOption, i realized it was refering to wrong java library. I removed the jre-headless, and now it is working.
Thanks. _________________ Pixelord |
|
Back to top |
|
|
elven
Joined: 28 Jul 2006 Posts: 259 Location: Germany
|
Posted: Wed Dec 04, 2013 14:17 Post subject: |
|
|
Glad it's sorted. Have fun! |
|
Back to top |
|
|
maliha
Joined: 09 Jan 2014 Posts: 1
|
Posted: Thu Jan 09, 2014 13:21 Post subject: |
|
|
Ah, just noticed the documentation has been updated with the git clone stuff.
I will give that a go _________________ Pass pass4-sure crack exam fast to explore the better job opportunities. Join today for complete set of Isilon dumps |
|
Back to top |
|
|
|