This content has been marked as final. Show 11 replies
But can I use JavaFX for JavaEE Client Modules without using webservices?Never tried it - but I don't see why not.
There are numerous ways to connect from a JavaEE Client to a server - what have you tried and why do you want to do it?
There is an old thread on this subject from a year ago:
Re: JavaFX 2.0 and EJB 3.0 injection "JavaFX 2.0 and EJB 3.0 injection"
(the thread discusses using EJB technology in a JavaFX client and some client/server connection options).
Despite the thread being a year old I haven't seen many posts or samples of people using JavaFX or JavaEE client technology together.
I'm working on a small project which works on exactly this basis right now. I have the fundamentals working, so it's definitely possible. I will probably write up a series of blog posts when I have a first version all done; maybe a couple of weeks, depending on my other work commitments. I'll post a link back to this thread when it's up.
JEE is a big thing - a lot of it outside the scope of a JavaFX developer forum.
To get further assistance, it is probably a good idea to describe your intended solution in detail, listing the technology used in the client and how the client is packaged and deployed.
It may be best to break your questions out into manageable chunks, each one addressing specific technology which you are using and having issues with.
For example does the client use JDBC/JPA?
Is it packaged in an EAR?
Do you use Jersey Client or do you use RMI to communicate with the server?
Do you use CDI in the client?
Is the client browser embedded or a self-contained application?
I don't see why not... FX was originally meant for the web and an "RIA..." So I don't see why there would be an issue using it with EE? I am new to EE, and learning now, so I am interested in any issues of compatibility... I don't see why not, especially since it will be part of the JDK and all that when 8 is released :).
EDIT: I just started messing with FX8 and JDK 8 and sure enough in the FX8 Samples there is something called "DataApp" that uses a Glassfish server, so I believe we will see much more integration in 8 :D.
Edited by: KonradZuse on Feb 18, 2013 2:12 PM
The client is standalone. Right now I only have it running in development mode, via Eclipse or simply by launching from the command line. I will likely keep the standalone structure (but properly packaged) but might try the ear-archive based client. I'm probably a few weeks away from trying that, if indeed I go that route.
I have an ejb deployed to glassfish, and retrieved by the client via a JNDI lookup. The ejb represents a simple service that wraps a JPA-driven data access object. It's all working pretty well so far.
Edited by: James_D on Feb 18, 2013 6:41 PM
I was thinking about this a bit while I was sleeping, apparently...
If what you're aiming to do is have a JavaFX client application bundled up in an ear file, and have the app server automatically create the jnlp file and so on, that might be difficult. The issue is that to get a properly packaged javafx application, you really need to use the packaging tools to create the jar file and, if you're launching via web start, the jnlp file. These will invoke a default main class (com.javafx.main.Main) for you, which checks on versions and then invokes your start(...) method, using a fallback if the runtime is not correctly configured. On the other hand, (and I have far less experience of this) a jee client app is deployed by the app server, which generates the jnlp for you, presumably bundling up some enterprise application jar files, and somehow specifying an annotation processor.
So to create a JavaFX client app, deployed in an .ear file on the server, you kind of need two pieces of functionality which are typically automatically created for you, and those deployment processes are going to clash. You'll likely have to do create some of the deployment infrastructure by hand. There may be some nice tricks to doing this; I don't use Maven but there are a few articles around on Maven and JavaFX and those may provide a way forward.
As I said, I might try to make this work, but it's not top of my list....
I use Spring's HTTP invoker in my JavaFX project + WebStart !
My experience is very good. As a good side effect I can use all the Spring Features ! And...I use iBatis within the Spring Container to access the database.
(But using a RESTful or an other technology has a similar effect in combination with a JPA approach...often it depends to the background/experience of a developer what they use)