View unanswered posts | View active topics It is currently Thu Mar 30, 2017 3:51 am



Reply to topic  [ 7 posts ] 
 Problem getting miglayout to run 
Author Message

Joined: Tue Dec 06, 2011 8:17 pm
Posts: 4
Post Problem getting miglayout to run
I'm using Eclipse on Linux. I've added the miglayout-4-swing jar to my build path but when I try to run my code I get the following errors:

Quote:
Exception in thread "main" java.lang.ExceptionInInitializerError
at net.miginfocom.layout.UnitValue.<init>(Unknown Source)
at net.miginfocom.layout.UnitValue.<clinit>(Unknown Source)
at net.miginfocom.layout.PlatformDefaults.<clinit>(Unknown Source)
at net.miginfocom.swing.MigLayout.<init>(Unknown Source)
at net.miginfocom.swing.MigLayout.<init>(Unknown Source)
at TestMain.gox(TestMain.java:27)
at TestMain.main(TestMain.java:23)
Caused by: java.lang.NullPointerException
at net.miginfocom.layout.LayoutUtil.hasBeans(Unknown Source)
at net.miginfocom.layout.LayoutUtil.<clinit>(Unknown Source)
... 7 more


I've tried google, I've played around with code and I have no idea what's going wrong.

Any suggestions?

Thanks


Tue Dec 06, 2011 8:19 pm
Profile
Site Admin

Joined: Mon Dec 06, 2004 4:24 pm
Posts: 2485
Location: Sweden
Post Re: Problem getting miglayout to run
Hello,

Strange. I'll look into it.

Thanks,
Mikael


Tue Dec 06, 2011 9:09 pm
Profile WWW

Joined: Tue Dec 06, 2011 8:17 pm
Posts: 4
Post Re: Problem getting miglayout to run
If you need any more information let me know. What I can think of is:

Linux Kubuntu 11.10 (KDE)
Java 6 and 7 somewhere on the system, Eclipse is using 6 for all I know
Eclipse 3.7.0


Tue Dec 06, 2011 10:32 pm
Profile
Site Admin

Joined: Mon Dec 06, 2004 4:24 pm
Posts: 2485
Location: Sweden
Post Re: Problem getting miglayout to run
There is basically only one line in that method that throws the NPE:

Code:
LayoutUtil.class.getClassLoader().loadClass("java.beans.Beans");


That means that there doesn't seem to be a classloader, which is strange.

For the next version I have guarded that line with a try/catch.

Cheers,
Mikael


Wed Dec 07, 2011 12:25 am
Profile WWW

Joined: Tue Dec 06, 2011 8:17 pm
Posts: 4
Post Re: Problem getting miglayout to run
Do you have a file for me to test? I'm a complete Java noob and miglayout seems to be my best bet at getting a GUI going so I'm keen. The feedback might help clarify what's going wrong, I'm hoping.

Cheers


Wed Dec 07, 2011 1:35 am
Profile
Site Admin

Joined: Mon Dec 06, 2004 4:24 pm
Posts: 2485
Location: Sweden
Post Re: Problem getting miglayout to run
Sorry, we have just converted to Maven and don't even know if that works yet.

Check the site and Maven Central Repo for updates. It should be soon now.

Btw, I have never heard of this error before and there are many many thousands of MigLayout users so it might be something strange on your end as well. :)

Cheers,
Mikael


Wed Dec 07, 2011 1:37 am
Profile WWW

Joined: Tue Dec 06, 2011 8:17 pm
Posts: 4
Post Re: Problem getting miglayout to run
Sure. I haven't really settled on a Linux version so this is yet another reason to play around with it.


Wed Dec 07, 2011 2:17 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 7 posts ] 

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 post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.