util.zip.ZipException: zip END header not found
exception when try to load javafx fxml view in java-9.
Details
My Application is a Javafx(uses fxml view) which is built and compiled using java-8(jdk-8 64-bit) and accessed as a WebStart with jre-9(64-bit).
Webpages(xhtml) are loaded and rendered in this javafx application.
Also note that
There are already two similar bugs reported (ie. JDK-8170276, JDK-8172872) and
these two bugs mentioned that the issue is not reproducible with latest java-9
but reproducible only with earlier java-9 ea build version.
But in my case, im using latest java-9(9.0.4 version) and
its always reproducible.
Problem
When i try to load fxml popup after login, get below exceptions.
java.util.zip.ZipException: zip END header not found
at java.base/java.util.zip.ZipFile$Source.zerror(Unknown Source)
at java.base/java.util.zip.ZipFile$Source.findEND(Unknown Source)
at java.base/java.util.zip.ZipFile$Source.initCEN(Unknown Source)
at java.base/java.util.zip.ZipFile$Source.<init>(Unknown Source)
at java.base/java.util.zip.ZipFile$Source.get(Unknown Source)
at java.base/java.util.zip.ZipFile.<init>(Unknown Source)
at java.base/java.util.zip.ZipFile.<init>(Unknown Source)
at java.base/java.util.jar.JarFile.<init>(Unknown Source)
at java.base/sun.net.www.protocol.jar.URLJarFile.<init>(Unknown Source)
at java.base/sun.net.www.protocol.jar.URLJarFile.<init>(Unknown Source)
at java.base/sun.net.www.protocol.jar.URLJarFile$1.run(Unknown Source)
at java.base/sun.net.www.protocol.jar.URLJarFile$1.run(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/sun.net.www.protocol.jar.URLJarFile.retrieve(Unknown Source)
at java.base/sun.net.www.protocol.jar.URLJarFile.getJarFile(Unknown Source)
at java.base/sun.net.www.protocol.jar.JarFileFactory.get(Unknown Source)
at java.base/sun.net.www.protocol.jar.JarURLConnection.connect(Unknown Source)
at jdk.deploy#9.0.1/com.sun.deploy.net.protocol.jar.DeployURLConnection.connect(Unknown Source)
at jdk.deploy#9.0.1/com.sun.deploy.net.protocol.jar.DeployURLConnection.getInputStream(Unknown Source)
at java.base/java.net.URL.openStream(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml/javafx.fxml.FXMLLoader.load(Unknown Source)
at client.FxmlWrapper.initialize(FxmlWrapper.java:57)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$9(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(Unknown Source)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Suppressed: java.nio.file.NoSuchFileException: C:\Users\user\AppData\Local\Temp\jar_cache8046747560626483610.tmp
at java.base/sun.nio.fs.WindowsException.translateToIOException(Unknown Source)
at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
at java.base/sun.nio.fs.WindowsFileSystemProvider.implDelete(Unknown Source)
at java.base/sun.nio.fs.AbstractFileSystemProvider.delete(Unknown Source)
at java.base/java.nio.file.Files.delete(Unknown Source)
... 22 common frames omitted
Request if anyone could help on this issue,would be grateful.
Many Thanks.
Although this is not the full code, but this is the code for showing fxml popup which throws "java.util.zip.ZipException: zip END header not found" exceptions in java-9, but in java-8 works fine.
PopupAction.java
public class PopupAction
{
public PopupAction()
{
super();
}
public void showPopup()
{
CountDownLatch latch = new CountDownLatch(1);
Platform.runLater(
new PopupHandler(latch, "testMsg", "testTitle", "testButtonText"));
try
{
latch.await();
}
catch(InterruptedException localInterruptedException)
{
Thread.currentThread().interrupt();
}
}
}
PopupHandler.java
public class PopupHandler implements Runnable
{
private CountDownLatch latch;
private String message;
private String title;
private String buttonText;
public PopupHandler(CountDownLatch latch,
String message, String title, String buttonText)
{
this.latch = latch;
this.message = message;
this.title = title;
this.buttonText = buttonText;
}
#Override
public void run()
{
try
{
Stage stage = new Stage(StageStyle.UTILITY);
Parent root;
stage.initModality(Modality.APPLICATION_MODAL);
stage.setResizable(false);
FXMLViewLoader fXMLViewLoader = new FXMLViewLoader("/fxmlView/warningPopup.fxml");
root = fXMLViewLoader.getView();
Scene scene = new Scene(root, 400, 110);
scene.setFill(Color.TRANSPARENT);
stage.setScene(scene);
stage.setResizable(false);
stage.setTitle(this.title);
stage.initOwner(Application.getOwnerWindow());
this.localAtomicBoolean.set(true);
stage.setAlwaysOnTop(true);
stage.showAndWait();
}
catch(Exception e)
{
e.printStackTrace();
}
finally
{
this.latch.countDown();
}
}
}
FXMLViewLoader.java
public final class FXMLViewLoader
{
private FXMLLoader loader;
public FXMLViewLoader(String fxmlName)
{
super();
initialize(fxmlName);
}
private void initialize(String fxmlName)
{
final URL resource = getResourceURL(fxmlName);
this.loader = new FXMLLoader(resource);
try
{
this.loader.load();
}
catch(Exception e)
{
e.printStackTrace();
}
}
protected URL getResourceURL(String fxmlName)
{
return this.getClass().getResource(fxmlName);
}
public Parent getView()
{
return this.loader.getRoot();
}
}
Related
Here is the error
Exception in thread "JavaFX Application Thread" java.lang.IllegalArgumentException: Children: duplicate children added: parent = Group#5ea0c6fc
at javafx.graphics/javafx.scene.Parent$3.onProposedChange(Unknown Source)
at javafx.base/com.sun.javafx.collections.VetoableListDecorator.add(Unknown Source)
at project1.Crab.setCrab(Crab.java:45)
at project1.SeaAnimals.addCrab(SeaAnimals.java:65)
at project1.ProjectOne.mouseClick(ProjectOne.java:133)
at javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source)
at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
at javafx.base/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(Unknown Source)
at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
at javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source)
at javafx.base/com.sun.javafx.event.EventUtil.fireEvent(Unknown Source)
at javafx.base/javafx.event.Event.fireEvent(Unknown Source)
at javafx.graphics/javafx.scene.Scene$ClickGenerator.postProcess(Unknown Source)
at javafx.graphics/javafx.scene.Scene$ClickGenerator.access$8300(Unknown Source)
at javafx.graphics/javafx.scene.Scene$MouseHandler.process(Unknown Source)
at javafx.graphics/javafx.scene.Scene$MouseHandler.access$1300(Unknown Source)
at javafx.graphics/javafx.scene.Scene.processMouseEvent(Unknown Source)
at javafx.graphics/javafx.scene.Scene$ScenePeerListener.mouseEvent(Unknown Source)
at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(Unknown Source)
at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(Unknown Source)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(Unknown Source)
at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(Unknown Source)
at javafx.graphics/com.sun.glass.ui.View.handleMouseEvent(Unknown Source)
at javafx.graphics/com.sun.glass.ui.View.notifyMouse(Unknown Source)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Here is the lines of code that have the problem
public class Crab {
private final Image c = new Image("File:crab.gif");
private ArrayList<ImageView> crabList = new ArrayList<ImageView>();
private int _counter;
private Group _crab = new Group();
/** Constructor <br>
* Initializes counter to -1
*/
public Crab() {
_counter = -1;
}
/** Setter <br>
* Adds a crab to the array list
*/
public void addCrab() {
if(_counter < 5) {
crabList.add(new ImageView(c));
_counter++;
}
}
/** Setter <br>
* Deletes a crab from the array list
*/
public void deleteCrab() {
if(_counter > 0) {
crabList.remove(_counter);
_counter--;
}
}
/** Getter <br>
*
* #return returns crab group
*/
public Group setCrab() {
if(_counter >= 0) { //adds the first crab
crabList.get(0).setTranslateX(80);
crabList.get(0).setTranslateY(500);
crabList.get(0).setFitHeight(100);
crabList.get(0).setFitWidth(100);
_crab.getChildren().add(crabList.get(0));
if(_counter >= 1) { //adds the second crab
crabList.get(1).setTranslateX(230);
crabList.get(1).setTranslateY(500);
crabList.get(1).setFitHeight(100);
crabList.get(1).setFitWidth(100);
_crab.getChildren().add(crabList.get(1));
if (_counter >= 2) { // adds the third crab
crabList.get(2).setTranslateX(380);
crabList.get(2).setTranslateY(500);
crabList.get(2).setFitHeight(100);
crabList.get(2).setFitWidth(100);
_crab.getChildren().add(crabList.get(2));
if (_counter >= 3) { //adds the fourth crab
crabList.get(3).setTranslateX(530);
crabList.get(3).setTranslateY(500);
crabList.get(3).setFitHeight(100);
crabList.get(3).setFitWidth(100);
_crab.getChildren().add(crabList.get(3));
if (_counter >= 4) { //adds the fifth crab
crabList.get(4).setTranslateX(680);
crabList.get(4).setTranslateY(500);
crabList.get(4).setFitHeight(100);
crabList.get(4).setFitWidth(100);
_crab.getChildren().add(crabList.get(4));
if (_counter == 5) { //adds the sixth crab
crabList.get(5).setTranslateX(830);
crabList.get(5).setTranslateY(500);
crabList.get(5).setFitHeight(100);
crabList.get(5).setFitWidth(100);
_crab.getChildren().add(crabList.get(5));
}
}
}
}
}
}
return _crab;
}
}
public Group addCrab() {
_crab.addCrab();
_gCrab = _crab.setCrab();
return _gCrab;
}
public Group deleteCrab() {
_crab.deleteCrab();
_gCrab = _crab.setCrab();
return _gCrab;
}
}
public void mouseClick(MouseEvent mouse) {
if(mouse.getClickCount() == 1) {
root.getChildren().remove(gCrab);
gCrab.getChildren().clear();
gCrab.getChildren().add(animals.addCrab());
root.getChildren().add(gCrab);
}
else if(mouse.getClickCount() == 2) {
root.getChildren().remove(gCrab);
gCrab.getChildren().clear();
gCrab.getChildren().add(animals.deleteCrab());
root.getChildren().add(gCrab);
}
}
I do not know how to fix the problem, nor do I know what the problem is. Any help is appreciated.
Your setCrab method attempts to add all the crab images to the Group without removing any of the children. This way if there were crabs in the Group before you're trying to add them again which results in the exception since JavaFX does not allow this.
You also need to make sure never to add the same node twice to the same parent.
Furthermore hiding the setCrab from the user of the Crab class would reduce the complexity of using the class. Why make the user call 2 methods when 1 call would do the same job. You could even write a CrabGroup class that is a node itself and aviod the removing and readding of the Group to it's parent.
E.g.
public class CrabGroup extends HBox {
private static final Image c = new Image("File:crab.gif");
public CrabGroup() {
setSpacing(50);
}
/**
* Adds a crab
*/
public void addCrab() {
if(getChildren().size() < 6) {
ImageView image = new ImageView(c);
image.setFitWidth(100);
image.setFitHeight(100);
crabList.add(image);
}
}
/**
* Deletes a crab
*/
public void deleteCrab() {
if(!getChildren().isEmpty()) {
getChildren().remove(getChildren().size() - 1);
}
}
}
CrabGroup crabGroup = new CrabGroup();
crabGroup.setTranslateX(80);
crabGroup.setTranslateY(500);
crabGroup.addCrab();
...
crabGroup.deleteCrab();
I'm working in IntelliJ and I attempted to rename my Project! After doing so, and renaming everything, which I believe I did correctly, I'm unable to actually start my application.
Error:
org.bukkit.plugin.InvalidPluginException: java.lang.NullPointerException
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:133) ~[spigot-latest.jar:git-Spigot-4df3c0c-03f1e37]
at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:326) ~[spigot-latest.jar:git-Spigot-4df3c0c-03f1e37]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:248) [spigot-latest.jar:git-Spigot-4df3c0c-03f1e37]
at org.bukkit.craftbukkit.v1_12_R1.CraftServer.loadPlugins(CraftServer.java:302) [spigot-latest.jar:git-Spigot-4df3c0c-03f1e37]
at net.minecraft.server.v1_12_R1.DedicatedServer.init(DedicatedServer.java:205) [spigot-latest.jar:git-Spigot-4df3c0c-03f1e37]
at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:544) [spigot-latest.jar:git-Spigot-4df3c0c-03f1e37]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_121]
Caused by: java.lang.NullPointerException
at me.craftblock.MochaMessages.Config.<init>(Config.java:7) ~[?:?]
at me.craftblock.MochaMessages.MochaMessages.<init>(MochaMessages.java:18) ~[?:?]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_121]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_121]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_121]
at java.lang.reflect.Constructor.newInstance(Unknown Source) ~[?:1.8.0_121]
at java.lang.Class.newInstance(Unknown Source) ~[?:1.8.0_121]
at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:76) ~[spigot-latest.jar:git-Spigot-4df3c0c-03f1e37]
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:129) ~[spigot-latest.jar:git-Spigot-4df3c0c-03f1e37]
... 6 more
The error points to my Config class, however I'm not sure why:
public class Config {
private MochaMessages instance = MochaMessages.getInstance();
private FileConfiguration config = instance.getConfig();
public Config() {
}
public String get(String node) {
System.out.println("Fetching: " + node);
return config.getString(node);
}
public void set(String node, String value) {
config.set(node, value);
}
public boolean getBoolean(String node) {
System.out.println("Fetching: " + node);
return config.getBoolean(node);
}
}
Which is being called via my MochaMessages class:
Here's the related method:
private static MochaMessages instance;
private Config config = new Config();
public void onEnable() {
instance = this;
createConfig();
te = getTokenEnchant();
if (!config.getBoolean("database.enabled")) {
disablePlugin("Enable MySQL!");
} else if (config.get("mocha.currency").equalsIgnoreCase("TokenEnchant")) {
if (te == null) {
disablePlugin("Unable to access TokenEnchant. Disabling Plugin!");
}
} else {
Bukkit.getServer().getPluginManager().registerEvents(new MochaListener(), this);
new MochaModel().createTable();
new CommandHandler();
}
}
I believe it's because instance is returning null even though it shouldn't be. This worked perfectly before the rename!
What's going on?
I am trying below code for fetching data from google spreadsheet, but getting error.. can anyone help me with fetching data from google spreadsheet
public class gsheet
{
public static final String GOOGLE_ACCOUNT_USERNAME = "gmail-id";
public static final String GOOGLE_ACCOUNT_PASSWORD = "password";
public static final String SPREADSHEET_URL = "spread-sheet-URL";
public static void main(String[] args) throws IOException, ServiceException
{
SpreadsheetService service = new SpreadsheetService("JAVA");
service.setUserCredentials(GOOGLE_ACCOUNT_USERNAME, GOOGLE_ACCOUNT_PASSWORD);
URL metafeedUrl = new URL(SPREADSHEET_URL);
SpreadsheetEntry spreadsheet = service.getEntry(metafeedUrl, SpreadsheetEntry.class);
URL listFeedUrl = ((WorksheetEntry) spreadsheet.getWorksheets().get(0)).getListFeedUrl();
ListFeed feed = (ListFeed) service.getFeed(listFeedUrl, ListFeed.class);
for(ListEntry entry : feed.getEntries())
{
System.out.println("new row");
for(String tag : entry.getCustomElements().getTags())
{
System.out.println(" "+tag + ": " + entry.getCustomElements().getValue(tag));
}
}
}
}
i am getting below error on running my code
Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/collect/Maps
at com.google.gdata.wireformats.AltRegistry.<init>(AltRegistry.java:118)
at com.google.gdata.wireformats.AltRegistry.<init>(AltRegistry.java:100)
at com.google.gdata.client.Service.<clinit>(Service.java:555)
at googlesheet.gsheet.main(gsheet.java:24)
Caused by: java.lang.ClassNotFoundException: com.google.common.collect.Maps
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 4 more
You have to add google-collections.jar to your classpath.
I have a problem with a method replace( ) for the DocumentFilter class.
this method is slow. I wanted to call this method in a new thread to accelerate the execution ... but I get the following exeception
my code is same that
public void replace(final FilterBypass fb, final int offset, final int length, final String text, final AttributeSet attrs) throws BadLocationException
{
super.replace( fb, offset, length,text, null) ;
while( elem : vectorToken)
new Thread()
{
public void run()
{
super.replace( fb, elem.offset(), elem.length(),elem.text(),elem.new_attrb()) ;
}
}.start();
}
and i obtaint this exception
Exception in thread "Thread-2" javax.swing.text.StateInvariantError: Illegal cast to MutableAttributeSet
at javax.swing.text.AbstractDocument$AbstractElement.checkForIllegalCast(Unknown Source)
at javax.swing.text.AbstractDocument$AbstractElement.addAttributes(Unknown Source)
at javax.swing.text.AbstractDocument$AbstractElement.<init>(Unknown Source)
at javax.swing.text.AbstractDocument$LeafElement.<init>(Unknown Source)
at javax.swing.text.AbstractDocument.createLeafElement(Unknown Source)
at javax.swing.text.DefaultStyledDocument$ElementBuffer.insertFirstContent(Unknown Source)
at javax.swing.text.DefaultStyledDocument$ElementBuffer.insertUpdate(Unknown Source)
at javax.swing.text.DefaultStyledDocument$ElementBuffer.insert(Unknown Source)
at javax.swing.text.DefaultStyledDocument.insertUpdate(Unknown Source)
at javax.swing.text.AbstractDocument.handleInsertString(Unknown Source)
at javax.swing.text.AbstractDocument.access$200(Unknown Source)
at javax.swing.text.AbstractDocument$DefaultFilterBypass.replace(Unknown Source)
at javax.swing.text.DocumentFilter.replace(Unknown Source)
please how can i resolve this problem.
thanks
Using datafx read json from rest script.
Below is the code
#FXML
private void handleButtonAction(ActionEvent event) {
System.out.println("You clicked me!");
label.setText("Hello World!");
JsonConverter jsonConvert = new JsonConverter("jsonCase", CaseTable.class);
RestSource test = RestSourceBuilder.create()
.converter(jsonConvert)
.host("http://devel.com.au")
.path("cgi-bin").path("ssinternalweb-jcgi.sh")
.queryParam("Program", "appfx/CaseTest.p")
.queryParam("ProcName", "FXRequest")
.queryParam("TestParam", "aValue").build();
ListDataProvider<CaseTable> ldp = ListDataProviderBuilder.create()
.dataReader(test)
.build();
Worker<ObservableList<CaseTable>>retrieve = ldp.retrieve();
lvCases.setItems(retrieve.getValue());
}
#Override
public void initialize(URL url, ResourceBundle rb) {
lvCases.setCellFactory(l -> new CaseTableCell());
lvCases.getItems().add(new CaseTable(999, "Loading..."));
}
When worker start processing the results i get the following error message
Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
at org.datafx.provider.PublishingTask$1.run(PublishingTask.java:41)
at com.sun.javafx.application.PlatformImpl.lambda$null$164(PlatformImpl.java:292)
at com.sun.javafx.application.PlatformImpl$$Lambda$47/1175034525.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$165(PlatformImpl.java:291)
at com.sun.javafx.application.PlatformImpl$$Lambda$46/501263526.run(Unknown Source)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$141(WinApplication.java:102)
at com.sun.glass.ui.win.WinApplication$$Lambda$37/96639997.run(Unknown Source)
at java.lang.Thread.run(Thread.java:745)
I have but break point in class i am trying to create at that seems to be receiving the correct values. Only problem not showing on the screen in the listview.
private ListView<CaseTable> lvCases;
As stated in one of my comments should set the result list and will not get this error message. Was different line that's why thought was not related but turns out to be exactly same problem.
Below is update code that now works.
#FXML
private void handleButtonAction(ActionEvent event) {
JsonConverter jsonConvert = new JsonConverter("jsonCase", CaseTable.class);
RestSource test = RestSourceBuilder.create()
.converter(jsonConvert)
.host("http://devel.com.au")
.path("cgi-bin").path("ssinternalweb-jcgi.sh")
.queryParam("Program", "appfx/CaseTest.p")
.queryParam("ProcName", "FXRequest")
.queryParam("TestParam", "aValue").build();
lvCases.getItems().removeAll(lvCases.getItems());
ListDataProvider<CaseTable> ldp = ListDataProviderBuilder.create()
.dataReader(test)
.resultList(lvCases.getItems())
.build();
Worker<ObservableList<CaseTable>>retrieve = ldp.retrieve();
}
#Override
public void initialize(URL url, ResourceBundle rb) {
lvCases.setCellFactory(l -> new CaseTableCell());
lvCases.getItems().add(new CaseTable(999, "Loading..."));
}
Refer to this for more details
https://bitbucket.org/datafx/datafx/issue/9/npe-when-resultlist-not-specified