Running java .JAR server on a website hosting plan - java

Is it possible to run a java server application on a web hosting plan such as hostgator.com, or do I have to purchase a dedicated server?

Shared hosting plans do not offer this kind of service. The only things that will run on these are web scripts like PHP (and with some disabled features).
The best option is to purchase a VPS or a dedicated server where you'll have a remote access and on which you will install everything required to run java apps.
You will also have to take care of the security of the server and this is a big responsibility.

Related

Hosting webservices for android App

I am really new to web apps and web services... But i have created a webservice and it's working in localhost(apache glassfish) but i need to deploy this thing in an external se(in java)rver so that every one can consume that web service via my app..Unfortunately am unaware of this technique.
so can anybody help in this problem ? Can i host this webprogram in normal godaddy webserver or is there any other way for this..in fact, my app is a small one and i need the solution for small apps or startups
thank you
GlassFish hosting will be hard to find. If your application is not GlassFish specific and can be run on JBoss, then you might try RedHat OpenShift. They have free plan for small application load and you get for free server administration, database administration, deployment is easy, you might concentrate on coding only.
Another option is to use Heroku. You will also need to neglect GlassFish, but they have easy path to creation of REST web service backend.
I recommend renting a server at amazon:
http://aws.amazon.com/ec2/pricing/
You can take already existing images with GlassFish and a Database or take a naked CentOs/ Red Hat Image and install your GlassFish manually. The link provides a table with all prices. A m3.medium costs $0.070 per Hour. It's super fast and flexible and you have high availability.
In NetBeans you can deploy on a remote server via: Services -> Servers -> Add Server:
Just enter your ip, username and password for the GlassFish Server:
Or
You can host your Project on a Raspberry Pi. Maybe the power is enough for a small Web App:
http://www.thehecklers.org/2013/10/27/glassfish4-raspberrypi/
Advantage: It's cheap and you can learn and control a lot.

For J2EE project to run on different Computer what does it need?

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).

Where to host a Restful web service in JAVA in shared hosting solutions

I have just finished developing a REST web service that is consumed by a mobile application. The web service is developed with Java and runs on an Apache server.
I'm now moving to the testing part. And for that purpose, I need to host my web service in a real server.
It is a first experience for, and I just knew that using mutualised (shared) hosting does not allow me to host whatever application, in whatever language.
The one I get to use is OVH, which does not support java web services hosting.
Does anybody have any other alternative to provide. It would help a lot!!
Like I said, if it is for testing purposes you could always use a "normal" PC, running something like XAMPP.
As an alternative you could give RedHat's OpenShift a try, which offers a free, getting-started plan (more info here) that should more than cover your testing requirements.
To run your app (in Eclipse) you would need to : Run As -> Run on Server
And then select a server. If you haven't done so; I suggest you install a local JBoss/WildFly server (the wizard can take care of that for you).
Doing this will display options to run your app either on the local or the OpenShift/rhcloud server.This makes testing faster and allow you to avoid testing on the OpenShift live server.

Co-Host Ruby on Rails and another web application

I have a rest web service based on Rails.I have another 3rd party website that will be built on either java or .Net. I wanted both the applications i.e. my rails web service and the third party web application that is built on java or .Net to share the database.So we are planning to host both the applications on the same server.Is this possible and what are the hosting providers that have this option?
I do not think you will find an option for a shared host on which you can do both natively, but you could easily do both on almost any VPS or cloud hosting option.
The other reasonable option I think would be to find a Java Servlet host (Tomcat host) and run your Rails application under JRuby. There is pretty good support for this option and it is fairly mature (I could not say the same of IronRuby).
Both applications run on Windows, so should run on the same server.
So either look for hosting providers that support both applications or get a Virtual Private Server (VPS) and install the software yourself.

Server to run java servlet

I'am developing a java servlet application, and tesing it on Eclipse + Apache Tomcat (refer: http://www.vogella.de/articles/EclipseWTP/article.html#overview_wtp).
The application is now tested on the localhost and accesed by any clients on the same LAN.
Now, I need to deploy it into the web server, where everyone from anywhere can access this servlet.
Coud you guide me the way that I've to do to archive this task.
You need to have a computer accessible to everyone - i.e. placed on the internet and not behind a firewall - with the appropriate software installed (and hardened against hacker attacks).
If you do not have such a computer, you can have a look at the Google Application Engine which allows you to deploy Java web applications (with some additional restrictions) to the Google cloud. This is free for low-volume applications.
Yes, you can do it by deploying your application in the Cloud Instance. Since we cannot able to make our server instance or computer to be run always(We may come across internet connection problems, Power Fluctuation, etc.,), We have lot of problems while making our instance public(In Security perspective too). So it is better to use cloud instances.
We have many Cloud Service Providers such as AWS by Amazon, Google Cloud, Microsoft Cloud, etc.,
Take a look on this List of Cloud Services Providers.(You have links for all top 10 providers)

Categories

Resources