logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Headless build issue.

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux development
View previous topic :: View next topic  
Author Message
pixelord



Joined: 24 Oct 2011
Posts: 15

PostPosted: Tue Dec 03, 2013 8:00    Post subject: Headless build issue. Reply with quote

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
View user's profile Send private message
elven



Joined: 28 Jul 2006
Posts: 259
Location: Germany

PostPosted: Tue Dec 03, 2013 12:53    Post subject: Reply with quote

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
View user's profile Send private message
pixelord



Joined: 24 Oct 2011
Posts: 15

PostPosted: Tue Dec 03, 2013 13:01    Post subject: Reply with quote

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
View user's profile Send private message
pixelord



Joined: 24 Oct 2011
Posts: 15

PostPosted: Wed Dec 04, 2013 3:30    Post subject: Reply with quote

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
View user's profile Send private message
elven



Joined: 28 Jul 2006
Posts: 259
Location: Germany

PostPosted: Wed Dec 04, 2013 14:17    Post subject: Reply with quote

Glad it's sorted. Have fun!
Back to top
View user's profile Send private message
maliha



Joined: 09 Jan 2014
Posts: 1

PostPosted: Thu Jan 09, 2014 13:21    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux development All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group