DataFx with JPA and CrudListProperty.reload() method not work.

200 views
Skip to first unread message

Raul Carlos Rodrigo Sierra Hernandez

unread,
Mar 16, 2015, 2:04:15 PM3/16/15
to dataf...@googlegroups.com
 I have my controller below.

@ViewController(value = "/fxml/employee/viewEmployeeList.fxml", title = "SysPOS - Empleados")
public class EmployeeListFxController {

    @ViewNode
    private TableView<EmployeeEntity> tblList;

    @ViewNode
    private TextField searchString;

    @ViewNode
    @ActionTrigger("create")
    private Button btnCreate;

    @ViewNode
    private Button btnDelete;

    @ViewNode
    private Button btnUpdate;

    @ViewNode
    @ActionTrigger("realoadAction")
    private Button btnReload;

    @Inject
    private EmployeeServiceImpl employeeService;
    private CrudListProperty<EmployeeEntity, String> data;

    private PopOver popOver = null;

    @PostConstruct
    public void init() {
        data = new CrudListProperty<EmployeeEntity, String>(employeeService);
        tblList.getColumns().setAll(TableColumnFactory.createColumns(EmployeeEntity.class));
        tblList.setItems(data.getImmutableEntityList());

        AwesomeDude.setIcon(btnCreate, AwesomeIcon.USER_PLUS, "15");
        AwesomeDude.setIcon(btnDelete, AwesomeIcon.TRASH, "15");
        AwesomeDude.setIcon(btnUpdate, AwesomeIcon.EDIT, "15");
        AwesomeDude.setIcon(btnReload, AwesomeIcon.REFRESH, "15");
    }

    @ActionMethod("realoadAction")
    public void reloadAction() {
        ConcurrentUtils.then(data.reload(), (e) -> {});
    }
}

But when I want to load the results of the DB does not load, it seems the error is when you want to instantiate the object of the CallableBasedDataFxTask class on line 36, I followed the example of JPA for my CRUD and really makes this great, I do not understand because it sends me the following error, I think it is a lambda expression in the CrudListProperty class on line 133, I hope you can help me, thanks.

CallableBasedDataFxTask class

public CallableBasedDataFxTask(Callable<V> callable) {
this.callable = callable;
if (this.callable instanceof DataFxCallable) {
((DataFxCallable<V>) this.callable).injectStateHandler(this);
}
}


CrudListProperty class

private Worker<List<CrudObjectProperty<S, T>>> innerReload(Callable<List<S>> supplier) {
return ConcurrentUtils.executeService(executor, ConcurrentUtils.createService(() -> {

try {
List<CrudObjectProperty<S, T>> newProperties = FXCollections.observableArrayList();
List<S> dataList = supplier.call();
for (S data : dataList) {
newProperties.add(new CrudObjectProperty<S, T>(data, CrudListProperty.this, crudService, executor));
}
ConcurrentUtils.runAndWait(() -> setAll(newProperties));
return newProperties;
} catch (Exception e) {
throw new RuntimeException("TODO", e);
}
}))
;
}

 My stack errors.

mar 16, 2015 2:35:21 AM io.datafx.core.ExceptionHandler lambda$getLoggerListener$0
SEVERE: DataFX Exception Handler
io.datafx.controller.flow.FlowException: java.lang.IllegalStateException: Cannot call Method: public void com.syspos.controller.EmployeeListFxController.reloadAction()
at io.datafx.controller.flow.action.FlowMethodAction.handle(FlowMethodAction.java:69)
at io.datafx.controller.flow.FlowHandler.handle(FlowHandler.java:237)
at io.datafx.controller.flow.FlowHandler.handle(FlowHandler.java:169)
at io.datafx.controller.flow.FlowHandler.handleActionWithExceptionHandler(FlowHandler.java:318)
at io.datafx.controller.flow.FlowHandler.lambda$attachEventHandler$5(FlowHandler.java:301)
at io.datafx.controller.flow.FlowHandler$$Lambda$84/289495806.run(Unknown Source)
at io.datafx.controller.util.ActionUtil.lambda$defineNodeAction$21(ActionUtil.java:23)
at io.datafx.controller.util.ActionUtil$$Lambda$85/682791286.handle(Unknown Source)
at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
at javafx.event.Event.fireEvent(Event.java:198)
at javafx.scene.Node.fireEvent(Node.java:8390)
at javafx.scene.control.Button.fire(Button.java:185)
at com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(ButtonBehavior.java:182)
at com.sun.javafx.scene.control.skin.BehaviorSkinBase$1.handle(BehaviorSkinBase.java:96)
at com.sun.javafx.scene.control.skin.BehaviorSkinBase$1.handle(BehaviorSkinBase.java:89)
at com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:218)
at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
at javafx.event.Event.fireEvent(Event.java:198)
at javafx.scene.Scene$MouseHandler.process(Scene.java:3758)
at javafx.scene.Scene$MouseHandler.access$1500(Scene.java:3486)
at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1762)
at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2495)
at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:350)
at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:275)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$350(GlassViewEventHandler.java:385)
at com.sun.javafx.tk.quantum.GlassViewEventHandler$$Lambda$240/780255636.get(Unknown Source)
at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:404)
at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:384)
at com.sun.glass.ui.View.handleMouseEvent(View.java:555)
at com.sun.glass.ui.View.notifyMouse(View.java:927)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$145(WinApplication.java:101)
at com.sun.glass.ui.win.WinApplication$$Lambda$36/644460953.run(Unknown Source)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalStateException: Cannot call Method: public void com.syspos.controller.EmployeeListFxController.reloadAction()
at io.datafx.core.DataFXUtils$3.run(DataFXUtils.java:100)
at java.security.AccessController.doPrivileged(Native Method)
at io.datafx.core.DataFXUtils.callPrivileged(DataFXUtils.java:92)
at io.datafx.controller.flow.action.FlowMethodAction.handle(FlowMethodAction.java:66)
... 56 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at io.datafx.core.DataFXUtils$3.run(DataFXUtils.java:98)
... 59 more
Caused by: java.lang.ClassFormatError: Method injectStateHandler in class io/datafx/core/concurrent/TaskWithStateHandler has illegal modifiers: 0x1
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at io.datafx.core.concurrent.CallableBasedDataFxTask.<init>(CallableBasedDataFxTask.java:36)
at io.datafx.core.concurrent.ConcurrentUtils.createService(ConcurrentUtils.java:98)
at io.datafx.crud.CrudListProperty.innerReload(CrudListProperty.java:133)
at io.datafx.crud.CrudListProperty.reload(CrudListProperty.java:125)
at com.syspos.controller.EmployeeListFxController.reloadAction(EmployeeListFxController.java:70)
... 64 more




nazm

unread,
Feb 22, 2016, 7:07:31 AM2/22/16
to DataFX
did you find any solution to this problem ? please reply . thanks
Reply all
Reply to author
Forward
0 new messages