Problem: I have a Java program running on a Raspberry Pi accessing the camera that I would like to put in an HTML5 format instead of needing client software to communicate with the server, which is the current solution. The camera program needs to run regardless of whether someone is accessing the server or not.
Setup:
The method of choice to send data between the host and client is Websockets using a Payara JavaEE server. Eventually, Payara Micro will be used on the R Pi.
Camera program is debugged and works great
ServerEndpoint java program works and can be debugged / deployed
Camera and ServerEndpoint programs are in the same WAR file and deployed, however only the ServerEndpoint debuggable when deployed and accessed via a browser.
Question:
How the heck do I run the camera program and the server program and have the 2 communicate? None of the examples show how to run a class with a Main function and a ServerEndpoint.
Is there a better way to do this than how things are setup now?
Gripe: there are so many web frameworks and project names and lingo in the Java server space, is there succinct summary of it all? Servlets vs. websockets vs. HttpRequest oh my!
Well, after a few days I finally found the answer. Basically, one needs to create an EAR file that is composed of the WAR project and an Enterprise Java Bean project (EJB).
The EAR project is an Enterprise Application project. All of this falls under Java EE.
This tutorial seemed the most comprehensive:
https://www.tutorialspoint.com/ejb/index.htm
Related
I am trying to figure out how to deploy my WebService project to my running Jboss server. This seems to be a lot harder than it sounds. I can not find any tutorials or guides on how to do this.
I have tried to deploy the whole Web Service Application project as a .rar file via the administrator console but it gives an "unknown error". I am able to run the WebService on the developer webserver.
Is there any best practice or other lean way to deploy my webservice directly in Visual Studio?
I've also tried to publish the project through Visual Studio but the wizard says that localhost:8080 which is where my Jboss application server is running on, but it says that it doesnt exists.
Any suggestions on how to do this?
JBoss can only run applications that are compiled to JVM bytecode. A .NET application is using the CLR runtime, not the JVM.
I know for a Java Program to run on another Computer it needs JRE(Java Runtime Environment). But for a J2EE application (Serlvet-JSP) or Struts2 framework application or Hibernate framework application or any Framework application of Java what are need to Run it Successfully on another computer where it is not developed....
I know JRE is required for both type of Application. and JDK is for developing an application.
I also know that for Mobile application to run on device it needs an Emulator that supports the particular OS (Android, iOS, etc). Just like an Standalone Java Application.
But for running J2EE application is there any other requirements than JRE??
For Example:- I have made a site called SocialMash.com I want to have a working prototype to deliver to user (User meaning like we all use Stackoverflow and other sites). What will I require to configure the site.
I know I will require a server like Tomcat/JBOSS/GlassFish but that all will be on my side (server side/ development side) but Do the Users to use the site will require anything among JDK, JRE, Server, or anything to use SocialMash.com or just URL will be enough?????
You need to have a JavaEE application server. It runs on top of JRE. You can check this open-source reference implementation (full-profile, my favourite):
https://glassfish.java.net/
or if you want to have only web-profile:
http://tomcat.apache.org/download-80.cgi
Web profile is different from full profile in that web profile supports only Servlet-JSP, but not JPA (or hibernate as stated in your question).
Users will not require anything except for the browser in case you write a web application (Servlets+JSP, Struts, JSF, etc. - just give them a web reference). But you can go further than that. You can write a Java SE desktop client for EJB, or SOAP service (they will be placed in full-profile server like Glassfish), and distribute for your customers. In this way they will not require any browser, but your custom desktop program.
Some of the libraries require to be added to your application server and configured manually. Like Struts. In this case you first need to decide which framework/library you would like to use, then go to their web site, and follow the tutorial on its installation.
To host an J2EE application, a webserver is required that has servlet container. servers included in XAMPP/LAMP/WAMPP will do for php based application. But for J2EE application servlet container is rquired which is there in TOMCAT/GLASSFISH/JBOSS.
On the user side, the user sees pure HTML with additional js/css. He does not see the jsp scriplets/servlet code written in your J2EE application. so no java technology is required on the user system. He only needs a browser.
A J2EE project intends to create a web service. In order to run this project on your computer, you need a local server.
Any IDE can provide you a local server like Tomcat or Glassfish, you just need to try to run this project to get these options.
If you don't need to access the code on the other computer, two options:
You compile your project to get a .war file, which you can deploy on your Tomcat server, or any else.
You put this on a server of yours, and share the url.
Assuming that you are in charge of the app hosting:
If that the app is running on your own remote server, you just need to share the app url and your user can access it with his browser (nothing more is needed).
If you run it in your own computer, as localhost, he won't be able to access it, and I recommand the usage of a host like Openshift to make it accessible (that's a free solution).
I'm working in a lab where they typically deploy apps to Geronimo. I have an existing stand-alone server based app written in Java. Can any Java application be hosted in Geronimo? If so, is there a good reference to take an existing app and host it in Geronimo? Is there a benefit to hosting something in Geronimo or are there times when something is best left as a stand-alone app?
When you work on an Application Server, there is specific way a program should be written for it to be qualified for deployment on app server. A program can be a Servlet, EJB, JSP etc. If your existing stand-alone server based app is any of these, then it can surely be deployed on Geronimo.
Where does the application logic run in a Java Web Start deployment? I want to understand the intellectual property security risk of Java Web Start. On the client end does it merely start the application on a server and then proceed to process pixels (GUI objects) and mouse clicks at the client? or is my application logic executing at the client?
Implicit in my question is the assumption that I place no value on any aspects of the design that can be inferred by looking at the GUI buttons, text output and by being an experienced user of the application. The value is in the code and logic.
Java Web Start downloads code to the client, and executes it there. The application logic will execute at the client.
Basically JWS keeps local .jar in sync with that on a server to execute an application in local mode. Read about JNLP here.
So the risk for reverse engineering is the same as with any jar packet Java app.
Basically Java Web Start downloads the latest jars (Application Logic) from the server when u launch it with the help of JNLP. and then it installs this application in temporary internet files or cache.
Your whole application logic(cache) exists in cache at client side. and then your jnlp file use them (jars)
Requirements:
Should be open source.
Don't necessarily need to connect to an existing IM server, and can run my own so long as it can run in a Linux OS.
Needs to support SSO with the app deployed in JBoss.
Should be able to either skin the chat client to look the same as the app or better still, embed it without any borders or decorators.
Thoughts?
There is a sample chat client with the Jetty webserver you can adapt.