javafx ,bean NullPointerException problem ze wstrzyknięciem klasy

0

Witam ,
Jak w temacie mam problem ze wstrzyknięciem klasy do kontenera, cały czas sypie mi błędem :
Exception in thread "JavaFX Application Thread" java.lang.NullPointerException: Children: child node is null: parent = VBox@69a44e74

mam klasy :

w JavaController (klasa która jest @configuration)

@Bean
 public SqlWindow getSqlWindow(){
        SqlWindow sqlWindow = new SqlWindow();
        return sqlWindow;
    }

SqlWindow :

@Controller
public class SqlWindow extends StackPane {
    public SqlWindow(){
        setMinSize(520, 220);
        setStyle("-fx-background-color: YELLOW;");
    };
}

GeneralWindow:

@Component
public class GeneralWindow{

@Autowired
SqlWindow sqlWindow;

private VBox vboxInCenter;

public build(){
 vBoxInCenter.getChildren().add(sqlWindow);
}

Klasy zmniejszyłem jak tylko potrafiłem (bo oryginalnie są strasznie duże). Próbując wstrzyknąć klasę SqlWindow cały czas sypie mi exception NullPointerException. Co może być przyczyną ? złe wiązanie ?

0
PM org.springframework.context.annotation.AnnotationConfigApplicationContext prepareRefresh
INFO: Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@68f7aae2: startup date [Mon Mar 27 22:36:23 CEST 2017]; root of context hierarchy
java.lang.NullPointerException: Children: child node is null: parent = VBox@6956a8d3
	at javafx.scene.Parent$2.onProposedChange(Parent.java:435)
	at com.sun.javafx.collections.VetoableListDecorator.add(VetoableListDecorator.java:206)
	at com.pl.spring.view.generaWindow.GeneralWindow.loadCenterPane(GeneralWindow.java:167)
	at com.pl.spring.view.generaWindow.GeneralWindow.build(GeneralWindow.java:77)
	at com.pl.spring.windowControllers.GeneralWindowController.show(GeneralWindowController.java:36)
	at com.pl.spring.windowControllers.LoginWindowController.nextStage(LoginWindowController.java:50)
	at com.pl.spring.connection.Connect.initialized(Connect.java:54)
	at com.pl.spring.windowControllers.LoginWindowController.checkLogin(LoginWindowController.java:44)
	at com.pl.spring.view.loginWindow.LoginWindow.lambda$buildScene$0(LoginWindow.java:78)
	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:8413)
	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:3757)
	at javafx.scene.Scene$MouseHandler.access$1500(Scene.java:3485)
	at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1762)
	at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2494)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:381)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:295)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$354(GlassViewEventHandler.java:417)
	at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:389)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:416)
	at com.sun.glass.ui.View.handleMouseEvent(View.java:555)
	at com.sun.glass.ui.View.notifyMouse(View.java:937)
	at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
	at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
	at java.lang.Thread.run(Thread.java:745)

0

Chyba trochę za mało kodu żeby zgadnąć na szybko. Ale po co Ci tam wstrzykiwanie czegokolwiek?
Przecież jak to pisał Oliver Gierke - field injection to modlitwa o NullPointerException - no i proszę wybłagałeś.

1 użytkowników online, w tym zalogowanych: 0, gości: 1