sdk
sdk copied to clipboard
Nifty GUI editor crashes on launch
Nifty GUI editor crashes on launch. Apparently it is missing some dependencies:
java.lang.IllegalStateException: Cannot instantiate com.jme3.gde.gui.view.NiftyGuiVisualElement at org.netbeans.core.spi.multiview.MultiViewFactory$MapMVD.createElement(MultiViewFactory.java:464) at org.netbeans.core.multiview.MultiViewModel.getElementForDescription(MultiViewModel.java:222) at org.netbeans.core.multiview.MultiViewModel.getActiveElement(MultiViewModel.java:132) at org.netbeans.core.multiview.MultiViewModel.getActiveElement(MultiViewModel.java:128) at org.netbeans.core.multiview.MultiViewPeer.showCurrentElement(MultiViewPeer.java:470) at org.netbeans.core.multiview.MultiViewPeer.showCurrentElement(MultiViewPeer.java:462) at org.netbeans.core.multiview.MultiViewPeer$SelectionListener.selectionChanged(MultiViewPeer.java:929) at org.netbeans.core.multiview.MultiViewModel.fireSelectionChanged(MultiViewModel.java:259) at org.netbeans.core.multiview.MultiViewModel.setActiveDescription(MultiViewModel.java:120) at org.netbeans.core.multiview.MultiViewModel$BtnGroup.setSelected(MultiViewModel.java:322) at javax.swing.JToggleButton$ToggleButtonModel.setSelected(JToggleButton.java:254) at javax.swing.ButtonGroup.setSelected(ButtonGroup.java:165) at org.netbeans.core.multiview.MultiViewModel$BtnGroup.setSelected(MultiViewModel.java:318) at org.netbeans.core.multiview.TabsComponent$ButtonMouseListener.mousePressed(TabsComponent.java:907) at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:280) at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:279) at java.awt.Component.processMouseEvent(Component.java:6536) at javax.swing.JComponent.processMouseEvent(JComponent.java:3324) at java.awt.Component.processEvent(Component.java:6304) at java.awt.Container.processEvent(Container.java:2239) at java.awt.Component.dispatchEventImpl(Component.java:4889) at java.awt.Container.dispatchEventImpl(Container.java:2297) at java.awt.Component.dispatchEvent(Component.java:4711) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4904) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4532) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4476) at java.awt.Container.dispatchEventImpl(Container.java:2283) at java.awt.Window.dispatchEventImpl(Window.java:2746) at java.awt.Component.dispatchEvent(Component.java:4711) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760) at java.awt.EventQueue.access$500(EventQueue.java:97) at java.awt.EventQueue$3.run(EventQueue.java:709) at java.awt.EventQueue$3.run(EventQueue.java:703) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84) at java.awt.EventQueue$4.run(EventQueue.java:733) at java.awt.EventQueue$4.run(EventQueue.java:731) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74) at java.awt.EventQueue.dispatchEvent(EventQueue.java:730) at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:159) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) at java.awt.EventDispatchThread.run(EventDispatchThread.java:82) Caused by: java.lang.NoSuchMethodException: com.jme3.gde.gui.view.NiftyGuiVisualElement.() at java.lang.Class.getConstructor0(Class.java:3082) at java.lang.Class.getConstructor(Class.java:1825) at org.netbeans.core.spi.multiview.MultiViewFactory$MapMVD.createElement(MultiViewFactory.java:450) … 47 more Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at org.netbeans.core.spi.multiview.MultiViewFactory$MapMVD.createElement(MultiViewFactory.java:447) … 47 more Caused by: java.lang.NoSuchMethodError: de.lessvoid.nifty.builder.PopupBuilder.childLayoutAbsolute()V at jada.ngeditor.model.utils.NiftyDDManager.(NiftyDDManager.java:32) at jada.ngeditor.guiviews.J2DNiftyView.init(J2DNiftyView.java:154) at com.jme3.gde.gui.view.NiftyGuiVisualElement.(NiftyGuiVisualElement.java:123) … 52 more
Here is the forum post about it: https://hub.jmonkeyengine.org/t/sdk-vehicle-editing-direct-flash-back-problem/43258/4
The newest Nifty that works with the editor is Nifty 1.4.1 (some rendering code changed after that), current version uses some preview version of Nifty. Also one problem is that our plugin seems to be actually some fork of the official editor (https://github.com/relu91/niftyeditor). And this fork I suspect is only on @normen 's computer somewhere. If that were to be found, we could update it to the latest editor version and Nifty 1.4.1. Host that code somewhere and have the integration work as it used to.
Other way is probably just to try to find out the missing library. Shouldn't also be that hard. I'm talking about the update to latest editor since there are some problems with the editor (source: numerous forum posts), maybe an update would help...?
The newest Nifty that works with the editor is Nifty 1.4.1 (some rendering code changed after that), current version uses some preview version of Nifty. Also one problem is that our plugin seems to be actually some fork of the official editor. And this fork I suspect is only on @normen 's computer somewhere. If that were to be found, we could update it to the latest editor version and Nifty 1.4.1. Host that code somewhere and have the integration work as it used to. Actually the nifty editor developer uploaded it to our repo himself :)
Thanks for the input @normen , I appreciate it!
@relu91 care to comment on this? Care to take responsibility and glory? Or provide some helpful tips? :)
Commenting is easy, solving it might be quite harder 😄. I actually do not actively develop nifty-editor, neither nifty-gui... What I remember is that to make nifty be really real-time editable I made some changes, but I think those changes were merged in the main nifty-gui branch too.
If I understand correctly the sdk is now using a different Nifty-gui version, is it correct? So nifty-editor might require only some alignment work to make it usable with the new version.
Your changes were included yes. But also later some of them were maybe removed or another thing changed. It seems to work with Nifty 1.4.1, but not any newer than that. Although I did not do very extensive testing. You used 1.4.0 snapshot. That part is now easier at least, can use the official versions. Whatever version too, 1.4.0 is an option too.
The SDK doesn't use Nifty at all. It includes the jME engine binaries which, yes, refer to Nifty as well. But all that is separate. Your Nifty editor is some custom version which in J2DNiftyView.init() takes the ResourceLocation. This I can't find anywhere, otherwise it would be really easy I recon. The modified version is the problem. Maybe that is something that we should separately host in our Github tms.?
The SDK doesn't use Nifty at all. It includes the jME engine binaries which, yes, refer to Nifty as well. But all that is separate.
Ok
Your changes were included yes. But also later some of them were maybe removed or another thing changed. It seems to work with Nifty 1.4.1, but not any newer than that. Although I did not do very extensive testing. You used 1.4.0 snapshot. That part is now easier at least, can use the official versions. Whatever version too, 1.4.0 is an option too.
So if using Nifty 1.4.1 everything works and if the Nifty-gui version used by the JME engine can be different, why upgrading to a new nifty-gui version?
No need to upgrade. I just fiddled with it. Mainly because of the snapshot version it was using.
Sorry, I might not follow.. so downgrading to 1.4.1 has solved this issue?
No no, for this issue, the supplied Nifty version is just fine! That is not an issue. Just a remark.
My side quests were:
- Use Gradle (there are so many dependencies so it is way easier to manage with Gradle/Maven)
- Use official release of Nifty
- Upgrade to newer version of your editor
So all this nonsense about Nifty version is not related to the original issue.
The original issue is just in the stack trace. It is nothing more than a missing library in your library or our bundle of it.
I'm just branching here a bit. Because currently this is unmanageable for us. It is just some library (your library) bundled with the SDK. I think it is fine to be an external library like that but it is some customized version which we have no access to or no way to manage it.
So what is the problem here? Can we solve that for 3.3? Sounds like some dependency/jar we have is incorrect?
Yes, it is a dependency problem. Nifty 1.4.1 should be used for this one (or then the snapshot release it comes with by default). But it gets confused with the jME's Nifty dependency. Tries to use it, 1.4.3, and fails.
Do we rely on any jme3-nifty code and does the editor pull in the exact dependency?
In regular gradle projects we could work with exclude {}, but I am not sure whether that works here.
And the issue only affects the editor not stuff created with it as well? I'll try to see if I can ship 1.4.1 with the SDK.
And the issue only affects the editor not stuff created with it as well?
Yeah, it should be fine. It just creates XML. And my project has gone through 1.3.x -> 1.4.3, the XML as I recall didn't cause any problems throughout this journey.
Small update: Today I was able to convert the nifty-editor project to a Gradle project. At least now it looks more 2021 and less "look just another university project that I didn't finish". It needs a little bit more polishing but maybe people would be more willing to contribute back to it if they can at least build it and run locally 😄

I'll push the changes soon.
@relu91 Have you pushed your change? I think I need this tools ^^