File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JavaFX and the fly likes Deadlock in Java/JavaFX: Application hangs because of a deadlock when loading plugins Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » JavaFX
Bookmark "Deadlock in Java/JavaFX: Application hangs because of a deadlock when loading plugins" Watch "Deadlock in Java/JavaFX: Application hangs because of a deadlock when loading plugins" New topic
Author

Deadlock in Java/JavaFX: Application hangs because of a deadlock when loading plugins

Ed Saiz
Greenhorn

Joined: Feb 08, 2011
Posts: 1
I am currently working on a desktop application developed in Java (core) and JavaFX (GUI) that requires loading plugins from independent JAR files, which are also developed in Java/JavaFX, dinamically.

The main project defines a GUI where the user can choose what plugin he wants to run. The process of loading that plugin works as follows:
1st. The User selects the plugin throughout the main application GUI.
2nd.The GUI processes the request and sends it to the Java Core.
3rd. The Java Core launches a new thread (so that the GUI does not freeze, by working asynchronously)
4th. Then the JAR is loaded in that thread and then it's executed

Here comes the point: We need the plugin to draw some JavaFX nodes in a certain area (a Panel previously defined for that purpose in the GUI), that's to say, we need to embed the plugin GUI into the main GUI in order to have ONLY ONE stage. This is important, we do not want to substitute one stage with another, but really EMBED one into the main one.

We have managed to represent some nodes in the main GUI such as labels or buttons, but the application hangs randomly due to a deadlock. The stacktrace generated by that deadlock is the following:



Is there any way to solve this problem?
Thanks in advance.

E. Saiz
NQaS Researh Group
 
wood burning stoves
 
subject: Deadlock in Java/JavaFX: Application hangs because of a deadlock when loading plugins