How to start a JavaFX 2 application using Weld SE?
marc.walter Apr 20, 2012 6:21 PMI would like to use Weld in order to get all those nice CDI features.
As you know JavaFX 2 applications are started using the static Java main method:
public static void main(final String[] args) { launch(args); // launches JavaFX }
Now Weld SE uses a different main method for bootstrapping:
public void main(@Observes ContainerInitialized event) { launch(); // is this right? }
I hoped placing the launch() method into the Weld bootstrapper is all to get things moving.
Next I executed the commend line mvn exec:java -Dexec.mainClass="org.jboss.weld.environment.se.StartMain" in my project root in order to start my application but all I got was this:
45 [org.jboss.weld.environment.se.StartMain.main()] INFO org.jboss.weld.Version - WELD-000900 1.1.6 (Final)
160 [org.jboss.weld.environment.se.StartMain.main()] INFO org.jboss.weld.Bootstrap - WELD-000101 Transactional services not available. Injection of @Inject UserTransaction not available. Transactional observers will be invoked synchronously.
424 [org.jboss.weld.environment.se.StartMain.main()] INFO org.jboss.weld.ClassLoading - WELD-000119 Not generating any bean definitions from gui.controller.LeagueController$1 because of underlying class loading error
426 [org.jboss.weld.environment.se.StartMain.main()] INFO org.jboss.weld.ClassLoading - WELD-000119 Not generating any bean definitions from gui.controller.LeagueController$2 because of underlying class loading error
427 [org.jboss.weld.environment.se.StartMain.main()] INFO org.jboss.weld.ClassLoading - WELD-000119 Not generating any bean definitions from gui.controller.LeagueController$3 because of underlying class loading error
429 [org.jboss.weld.environment.se.StartMain.main()] INFO org.jboss.weld.ClassLoading - WELD-000119 Not generating any bean definitions from gui.controller.LeagueController because of underlying class loading error
430 [org.jboss.weld.environment.se.StartMain.main()] INFO org.jboss.weld.ClassLoading - WELD-000119 Not generating any bean definitions from gui.controller.MainController because of underlying class loading error
432 [org.jboss.weld.environment.se.StartMain.main()] INFO org.jboss.weld.ClassLoading - WELD-000119 Not generating any bean definitions from gui.controller.TeamController$1 because of underlying class loading error
433 [org.jboss.weld.environment.se.StartMain.main()] INFO org.jboss.weld.ClassLoading - WELD-000119 Not generating any bean definitions from gui.controller.TeamController$2 because of underlying class loading error
436 [org.jboss.weld.environment.se.StartMain.main()] INFO org.jboss.weld.ClassLoading - WELD-000119 Not generating any bean definitions from gui.controller.TeamController$3 because of underlying class loading error
437 [org.jboss.weld.environment.se.StartMain.main()] INFO org.jboss.weld.ClassLoading - WELD-000119 Not generating any bean definitions from gui.controller.TeamController$4 because of underlying class loading error
438 [org.jboss.weld.environment.se.StartMain.main()] INFO org.jboss.weld.ClassLoading - WELD-000119 Not generating any bean definitions from gui.controller.TeamController$5 because of underlying class loading error
439 [org.jboss.weld.environment.se.StartMain.main()] INFO org.jboss.weld.ClassLoading - WELD-000119 Not generating any bean definitions from gui.controller.TeamController$6 because of underlying class loading error
441 [org.jboss.weld.environment.se.StartMain.main()] INFO org.jboss.weld.ClassLoading - WELD-000119 Not generating any bean definitions from gui.controller.TeamController$7 because of underlying class loading error
443 [org.jboss.weld.environment.se.StartMain.main()] INFO org.jboss.weld.ClassLoading - WELD-000119 Not generating any bean definitions from gui.controller.TeamController because of underlying class loading error
444 [org.jboss.weld.environment.se.StartMain.main()] INFO org.jboss.weld.ClassLoading - WELD-000119 Not generating any bean definitions from gui.CountryValueFlagCell because of underlying class loading error
445 [org.jboss.weld.environment.se.StartMain.main()] INFO org.jboss.weld.ClassLoading - WELD-000119 Not generating any bean definitions from gui.Application because of underlying class loading error
447 [org.jboss.weld.environment.se.StartMain.main()] INFO org.jboss.weld.ClassLoading - WELD-000119 Not generating any bean definitions from gui.PlayerContentProvider because of underlying class loading error
457 [org.jboss.weld.environment.se.StartMain.main()] INFO org.jboss.weld.ClassLoading - WELD-000119 Not generating any bean definitions from gui.SkillValueColorCell because of underlying class loading error
543 [org.jboss.weld.environment.se.StartMain.main()] WARN org.jboss.weld.interceptor.util.InterceptionTypeRegistry - Class 'javax.ejb.PostActivate' not found, interception based on it is not enabled
544 [org.jboss.weld.environment.se.StartMain.main()] WARN org.jboss.weld.interceptor.util.InterceptionTypeRegistry - Class 'javax.ejb.PrePassivate' not found, interception based on it is not enabled
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.132s
[INFO] Finished at: Sat Apr 21 00:00:24 CEST 2012
[INFO] Final Memory: 12M/216M
[INFO] ------------------------------------------------------------------------
So what am I doing wrong? Did I miss something? Why do I get underlying class loading errors?
Thank you for your help!