We are planning to develop remote desktop sharing feature in out web application (written in Java) where one user will be able to connect other users desktop with full access.
I don't want to use applications like team-viewer. It has to be some kind of web browser plug-in or feature.
I found following couple of solutions like Adobe Connect & Java.awt.Robot class.
Can anyone please let me know best option available?
It will be great if there is any open source project which can satisfy these requirements.
Try RealVNC out of the box, it has a built in Java web-client that allows full control. Most of the standard flavors of Linux run it, this, of course, totally depends on your user base and what you're trying to do but for an internal tool it is perfect.
http://www.realvnc.com/products/free/4.1/man/vncserver.html
The above link is the documentation for VNC server. It can be configured to one-session per port, it is just a matter of making sure the ports are correct. It sounds like you're reinventing the wheel on this one. There's a horde of good free products out there to handle this. For an infinite user-base this probably wouldn't be the best solution. For an internal tool it works wonders.
Related
I need some advice. I'm new to Java EE technologies. Anyway, I would like to make my first JAVA EE project.
Imagine 2 client applications and server application.
1) Server. I picked up Google App Enginge technology to create server application. I would like to connect it to some easy database.
2) Client applications. I would like them to be desktop applications (or applications launched from the desktop) and these 2 apps also have to be connected to the same database as sever.
There was no problem to create this in Java SE environment - I had two clients applications with sockets staff and server application with socket staff. All worked locally.
But now I want to have server and database on the Internet and I want to make it in more professional way.
My problems are:
How to create free database from GAE? Is datastore the best option or something else? What's important - the client desktop application will also use this database. I'm looking for the easiest solution.
Maybe the solution is to create web client application instead of the desktop one - but make it look like it was desktop app (I would like to avoid using browser). I have no idea how to do this and if this is even possible.
Any help will be really appreciated. I'm stuck because my knowledge is too little to start. I have ma GAE app and I don't know what should I choose next.
Thank you in advance.
If you want make desktop application, you need to build backend application first.
check this out. You can use same concept with that. Build back end, and then create API to connect to your backend, and use that API in your desktop application.
Datastore is easiest way to store data. Check this out. Datastore have some limitation (such as didnt support join, many to many relationship, etc). Please consider wisely. Otherwise you can use Google Cloud SQL for your option, but AFAIK its not free.
Background
On the project I work on we have GUI applications running on several different servers. Due to their user interface similarities I am investigating combining their OMIs into a single unified interface. Currently these applications are all remotely viewable via VNC. I plan to take advantage of this by having the master display run several VNC viewers under the covers and wrap an interface around these VNC sessions to make them appear like native applications.
Problem
I am looking for pointers for architecting a single sign-on solution. I want to eliminate each application's individual login and instead have users login to the unified display only. When they do that they would then be automatically logged in to each of the individual apps.
Constraints
The applications are all Swing-based Java apps running on Linux.
Authentication is performed by a Windows 2003 Server machine with Active Directory.
I'd strongly prefer an off-the-shelf solution to a custom-built one.
Ideas
My investigation has pointed me towards Kerberos and GSSAPI. Kerberos's ticket-based mechanism seems well-suited to the task.
One tricky bit is that these applications are always running. I need the unified display to somehow "tell" them when the user has logged in. It's not like normal Kerberized programs where they will perform a Kerberos login at startup.
If I use Kerberos I'm not sure how to transfer tickets to the various application servers. Is there a standard way to transfer them? Do I just use "scp" or something? Or do I develop my own socket-based network protocol and have the Java programs connect to each other and transfer tickets that way?
I don't want to get too bogged down in the details, though. I'd appreciate even general ideas like "have you considered Technology X?" or "try XYZ instead of VNC, it does this for you."
Updates
I'll edit in answers and clarifications here...
Have you considered that some authentication must take place anyway and that VNC only exports the view to a running program, so a VNC session cannot transport tickets?
Yes, indeed. Java + VNC is what we have right now. I could change out VNC for something else if there's a better way to remotely view the apps. Without rewriting them, that is. The ideal solution would be to separate them into distinct client and server pieces and put all the GUI code into the client, but that's 5-star difficulty and I need 1- or 2-star.
Have you considered the case when two users log in the same time? Will they see the same app? Or will this be forbidden?
Yeah, I've considered that. They will either see the same app or it will be forbidden. Either solution is okay as far as this particular system goes, so this isn't a big deal.
Have you considered just using an X Server on your local host and export the clients applications windows?
Yeah, this would be great. Can this be done with already-running apps? I have to connect to these apps after they've already started. I can't start them on demand when somebody fires up the central viewer.
RealVNC Enterprise Edition supports AD authentication (~$50 per exported desktop). Perhaps you can simply let people auth into the apps that way. FreeNX supports PAM authentication so you could perhaps hack something together with winbind, especially if your linux dist makes AD setup easy.
One last thing is running your apps in VirtualBox which can run in a headless mode via RDP. You can authenticate against PAM and thus winbind. This also has the advantage of being windows friendly on the client side via Remote Desktop which is pre-installed or readily available for windows.
Okey, I will try and start this list. Have you considered...
JAAS? Should include the GSS API, but was very cumbersome the last time I tried it.
that some authentication must take place anyway and that VNC only exports the view to a running program, so a VNC session cannot transport tickets?
a browser based solution with an embedded Java VNC client? At least the IE is able to carry out kerberos authentication, I don't know about the other browsers, or HOW the IE does that.
the case when two users log in the same time? Will they see the same app? Or will this be forbidden?
just using an X Server on your local host and export the clients applications windows?
EDIT: More considerations:
When using the X Server variant, use Xmove to move the programs to the X Server.
You can use SSH authentication with private/secret keys and let the user enter one passphrase to connect all your servers. SSH agent is the keyword.
With the existing SSH connections, start XMove on all the machines, collect all GUIs and send them to the client. You could even write a little MainWindow, with Buttons for each app, and when clicked, export only one of the apps, so it seems like they have been started from the main GUI.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 months ago.
Improve this question
I would like to create a desktop application in Java & web technologies. The main reason for selecting Java is that it is free, open source, and hence our investment would be minimal and we would save lots of investment with respect to licensing costs, etc. Also, the main reason for selecting web technologies is because our current programmers are well versed with web technologies like HTMl, css, Ajax, and we have good experience in creating amazing UI in web technologies.
I will give you some idea about the software that we would like to create. It would be a desktop based software, namely something like an ERP software.
The key requirements are that there should be a great UI and it should be fast and not very resource intensive.
I have heard that implementing a great GUI is possible, but difficult in Java. It can be done but is complex, whereas it is pretty simple to do the same in Visual Studio, Microsoft products.
I have also checked Adobe Air, Nokia QT, etc but they all are pretty expensive for us and we are looking for front-end browser UI and backend embedded server/database using java technologies.
Is it possible to create a desktop software in which the UI is created using the web technologies and there is an embedded server (like jetty or tomcat) and database and the backend programming would be in Java. How does JavaFX fit into this?
So basically, the desktop application would have an embedded browser (mozilla or some java browser which can packaged with the software), but the end user should never realize this.
I look forward to getting feedback about the same. Can you please provide some examples of software created in a similar combination of java + web technologies.
I did study some softwares like PulpTunes & Zimbra which were along similar lines, but they seem to be connecting to internet to display data. Our software would be totally an offline desktop application.
First of all, it is possible. If you are looking for example, check http://wiki.eclipse.org/Hudson-ci/Meet_Hudson.
You can get basic architecture if you dig into their code. It does not use any embedded db.
You are saying your application will always be offline, in that case I suggest you to go for pure desktop application using technologies like Eclipse plugin development.
If you already made up your mind, here are some points that can help you based on my experience with similar application,
Although your application is offline(I assume, your application need not connect to any server for any use case but the user machine can access internet ), you need to deliver changes(for example, change in html or jsp page )/bug fixes transparently to end user. JNLP/Java web start is a good fit for this.
If you are going for JNLP way of installing, you launcher should take care of embedded db installation and ports at the end user machine(this is big problem than it appears).
Also if you are launching server(in my case, Jetty) through JNLP, you will come across Class loading errors due to permission issues. Be prepared to dig through server code. I have done it long time ago and I do not have code now to point exact issues.
Show progress bars during installation process and during your application startup. Your war deployment takes some time and user needs some of knowing that application is startup is in progress. You will end up writing some swing UI.
Launch URL of the application automatically in default browser of the user system, after application startup. You do not need embedded browser.Check http://java.sun.com/developer/technicalArticles/J2SE/Desktop/javase6/desktop_api/.
I used MySql as embedded data base. Check Embedding mysql in java desktop application. It worked for me, I did not come across any problems.
Yes, it is possible. See https://github.com/jreznot/electron-java-app demo. There you will find an easy way to build Electron based application on Java, without compilation to JS, just Java application inside of embedded Jetty instance with Vaadin UI.
You are truly right, java is great if you are developing a project by self.
Server side coding can be done using Spring (For MVC, Database etc...Very rich and ligthweight framework, easy to learn and understand) with hibernate(ORM framework for Database handling, provides dialects for any Database server).
For UI, you can use Spring MVC OR JSF OR GWT OR javaFX. JavaFX provides JNLP download, which runs on java and without browser. check the link for more JavaFX samples. http://javafx.com/samples/
So its on you, what you want to use for UI side. If you prefer web UI (Not javaFX i mean) then you can have many options.
For Ajax, you will have libraries which support easy ajax. like DWR (Easy Ajax, JS to JAVA) and many other JS libraries like yahoo, jQuery etc.. can be used.
hope this helps.
IMHO the whole idea of running a web-server just to create a desktop app with js and ajax and stuff is horrible... I heard about Apple-creator Titanium which is allows to create crossplatform apps using web techniques. There are couple other similar programs as well.
I think you'll end up better buying a good wyswing Swing design tool for java ui which will cost you couple hundred bucks but will save you lots and lots development trouble. It is very hard to believe that laying out a nice desktop app is more complicated than laying out a web page.
I didn't get the embedded jetty/tomcat part. You want the desktop app to run an embedded server that talks to the database? So each desktop app would open a DB connection?
Why not have a Java desktop app that sends HTTP requests to a JavaEE server that connects to the DB and processes the requests? So basically, a Java client (which could be as rich as your developers can make it) replacing a browser. This gives you a lot more scalability, etc.
We have a similar (albeit much more complex) product developed using
- Swing + Apache Commons HttpClient on the desktop. This makes an HTTP POST request with serialized binary data to the server.
- A dispatcher servlet running in a web container that recreates the Java object on the server and executes the request.
I will probably get stoned for this, but I suggest JavaFX for this. We have successfully implemented a JavaFX-application for internal use in a larger company. The advantages are that the software is "controlled" on the server side (thus, nobody will have an "old" version). Installation effort is minimal (Java Web Start fixes this for you, it will even trigger a minimal JRE-installation if none exist) and last but not least, JavaFX can be run in the browser and as a pure desktop application alike without having to change the code.
Adobe FLEX is another contender, but it lacks the "Web Start" bit and is not quite as flexible when it comes to easy migration between browser and desktop.
Anyway, JavaFX is not quite feature complete as FLEX but version 1.3 can be considered battle-ready and you can create neat stuff with the free JavaFX plugins for Adobe Creative Suite (if your app will contain any graphics, that is).
I am used to develop web applications in Java (Struts, Spring, JSP...). But now I want to develop a desktop one. I never liked to design windows in Java (AWT, Swing, SWT): too much work for an ugly interface. So I think it could be a good idea if could take advantage of my web-app skills. One option is to modify the SWT Browser and make calls to a Java function instead of HTTP requests. A very good add-on would be use of JSP. Finally, I thought that probably there is some framework or tool for this.
Do you think that what I propose is a good idea?
There is available some framework for this?
I need this for light applications. So I think that embedding an Tomcat server and using it with HTTP requests is not a good idea.
Edit: One example application could be a folder comparer: you specify two folders and the app shows you which folders and files are different. In this case, I think opening an external browser is ugly. Bloated application (with its server, MVC, etc) wouldn't be the best choice.
If you have used the JavaScript library - ExtJs - then you can use it with Adobe AIR to build good looking desktop based web app.
Building app's in Adobe AIR is also simple and elegant with the flex builder ide.
If your option goes to embed a light server, check winstone is not fully J2EE compliant but should be enough for what you need.
About the browser, I am not a big fan of swt myself, it complicates a lot cross-platform deployment, so probably worth to keep an eye on jwebpane, not quite ready yet, but probably the solution you'll need.
I wouldn't discount embedding a web server. I've done this before with a web start application embedding Jetty.
The download was pretty fast, the server starts up and you can use BrowserLauncher to immediately drive your browser to the embedded server, and hence your application. Jetty is designed to be modular and have a small footprint, so you can probably cut it down to the bare necessities.
There are several options: You can use the plugin API of Firefox and develop your app in there. You can use HTML, JavaScript, the built-in database, all the browser features and access the OS level.
Or you could try PyQt (Python and Qt) which allows to write simple applications very quickly.
[EDIT] The main problem you're facing is security: For security reasons, JavaScript apps (running in a HTML page) can't access local OS resources. So unless your browser allows you to write plugins in JavaScript (which is only true for FF AFAIK), there is no way to write an application which uses HTML as the "view" without the help of something else.
Moreover, HTML is very limited when it comes to features for applications. HTML is designed to be a "static document view" not an "application". You can do things like GMail but if you compare GMail to any real mail app (Outlook, Thunderbird, Notes), you'll see quickly that real desktop apps offer a lot more features.
I want to write an application that runs entirely locally on one machine - there is no need for connection to the internet or to any external machines.
I was thinking that it would be a good idea to use a web browser as the platform for this application so that I would not have to mess around with lots of UI stuff - I could just knock together the web pages fairly quickly and take advantage of CSS to get consistent styles throughout the application.
However I want to interact with a MYSQL database on the machine in question. With this in mind I was thinking that I could somehow use Java to process the information that the user inputs from the application and communicate it to the database via JDBC.
I know that I could use an applet to do this but the downside to that is that I would like the user to be able to save files to the local machine - and I have read that applets run in a sandbox which prevents them from gaining any access to the local machine.
I also know that I could use PHP but I would like to take advantage of object oriented design which Java is perfect for.
Does anyone have any thoughts, suggestions or links to tutorials/webpages which could help me to decide how best to go about this.
Any thoughts are very much appreciated..
I know you said you don't want to mess around with GUI stuff in java, but have you looked in to java web start? It does almost exactly what you need; a user clicks a link through a web browser and your application is deployed on their machine, it even checks to make sure the right JVM is used. Because it is a full application and not an applet, your app won't be sandboxed, and you don't have any access restrictions in your program (other than the normal java stuff..), and for example, it would be easy to do what you mentioned and talk to a mySQL DB. The only downside, is what I mentioned earlier, is that you would have to design a UI in java.
Web Start Wikipedia Page
Sun FAQ on Web Start
Grails may be a useful starting point. It'll provide you with a web server solution that's standalone, and it'll look after the JDBC requirements and the CRUD (create-read-update-delete) capability via dynamically generated web pages. It should take minimal effort to put together an app providing your database interfacing via web pages.
(fyi. Grails is the Java equivalent of Rails)
If you feel comfortable with Java EE-based web development, you could probably just bundle your application with Tomcat or Jetty.
If you do not want to run standalone servlet container just for one application, you can also embed Jetty into a runnable Java application (see documentation here).
Either way you can leverage existing Java EE frameworks (Spring JDBC, Hibernate, all those web frameworks) for abstracting away technical complexities, although with embedded Jetty, you'd probably need to write some kind of integration layer for the web application framework of your choice.
I think you should give Restlet, a lightweight rest framework a try. The tutorial shows you how to start a local webserver, and by that deliver a "Hello World" through the browser within minutes (no joke!), and there's plenty of extensions for any kind of need.
In combination with Java Web Start by which you can deploy and start the application to the local host this should be what you need.
as someone suggested already you can use embbeded jetty server on your application and just let your user to start it using somekind of shell script or batch script. You only need to make your layour directory complaint with a Java Web Application and your on it. ie:
MyApplication
app/
WEB-INF/
lib/
classes/
web.xml
start.bat |
start.cmd - depends on your client OS
start.sh |
Then you should only need to take care of launching Jetty in your start.[bat|cmd|sh] with your app as your webaplication context and your done!
Using JDBC doesn't mean that you have to write an applet, you can use JDBC in any kind of application: a desktop application, a web application, EJBs, MDBs, etc.
You want to use a browser and Java on the server side? Then go for it and use Servlets / JSPs. Consider maybe using an presentation framework (Wicket, Struts2, Spring MVC,...), Hibernate for data access and Spring for other facilities and wiring. Grails is a good idea too.
BTW, I'm not a PHP specialist but PHP has object-oriented capabilities (introduced in PHP4 , enhanced in PHP5) so you won't sacrifice everything if you choose PHP.
So it really depends of what you want to do. If you want to write some Java (webapp or desktop app): choose Java. If you want to put quickly a few web pages in place and have an apache server, choose PHP. If you look for really high productivity, go for RoR or Grails.
You can try GWT + Google Gears
GWT is a GUI toolkit similar to Swing for the browser. Google Gears is a browser side database. Your app is completely in Javascript in a single HTML file and cross-browser compatible.
GWT app can make Server calls and Gears can sync up with a Server database. So you need not restrict your app data completely to the local desktop.
If you're interested in some experimentation, like new stuff and would like to reuse the plethora of Java libs (including JDBC) then you might be interested in the lift web framework, which is Scala-based.
If you want to do it as an applet you can. Sign the applet and give it permissions to the local network (to connect to the MYSQL server that way)... that should be possible. Here is a tutorial on it.