Putting up jersey webservice + MySQL database live - java

Over the past two weeks i have been developing a jersey RESTful webservice and a MySql database that it communicates with. Now my Android application is done which gets it's resources from the webservice. During the whole development time i've had the webservice on a tomcat server on localhost. But now I need my service to go live.
And I dont even know where to start. How can I make it go live? What hosting companies are there that supports these demands and where do I start? How does the webservice -> database connection looks like on the hosting part? Is tomcat commonly used to host?
As you can see I got close to no knowledge about this and a wink in the right direction would be great!

What you need is a hosting service that supports Tomcat and MySql.
This what i found googling "tomcat hosting service", but there are a lot more.
You also might want a domain name (like www.mydomain.com). some hosting servies provide that as well.
I suggest you call them and ask them if they provide support for what you need.
Calling a remote service should be the same, all you have to do is change the url host, so instead of:
http://localhost
You'll put your domain:
http://mydomain.com

Related

How to make Java EE application go online without web hosting?

I am learning to make a web application, and have a Java EE web application that uses Apache tomcat as server and web container. Currently, I am able to run the application and the tomcat server (localhost:8080/chatsystemWar)
I am trying to make the application go online without using web hosting. Could someone please help me understand the following?
1-Is it possible?
2-To my surprise, all computers at my house are able to access the application by replacing the "localhost" part with the computer name. How come?
3-Because of 2, I guess I have a working server and application, so all I should need is to somehow get the Internet to know about the application. Would buying a domain name help? What needs to be done after buying one?
4-Would modifying server.xml help?
Thank you very much. This is my first question on stack overflow, but I have been relying on you guys for at least a year now. You guys are awesome!
Long story short, if you want to expose your web application to the wider internet, it must be hosted on an internet facing web server.
You could host it yourself, on your own machine, and open up port 80 on your router, and ask your ISP for a static IP address (or use a dynamic DNS service like NoIP), but that is not really ideal and exposes your machine to the internet for all and sundry to hack on.
A better choice is to purchase web hosting from a company that specializes in such things. Or you could spin up a web server on Amazon AWS and handle it yourself, but either way, you won't be opening up your home network to the internet.
This is a big topic and you'll have to do some more research to learn about all the different aspects.
Is it possible?
Yes.
To my surprise, all computers at my house are able to access the application by replacing the "localhost" part with the computer name. How come?
Because they are all on the same local network.
Because of 2, I guess I have a working server and application, so all I should need is to somehow get the Internet to know about the application. Would buying a domain name help? What needs to be done after buying one?
Yes, a domain name would help, but is not needed. What you need is a static IP address (uncommon for homes, usually cost extra) and to configure your router/firewall to allow the traffic to flow.
Way too broad a topic to cover here.
Would modifying server.xml help?
No.

Developing app with web and Android client with Java

I'm going to start developing a new simple "X management" kind app, like contact management or events management. What I want to know is which tools would be the best to achieve it in the way I want.
My app needs to be a web app running on a server that has a mysql database to save and retrieve some simple information. This app must have a web client but I want it to be able to be extended to work with an Android app client.
Things I've thought:
I've worked on Java with facelets and JPA travels management app running on a GlassFish server on localhost with a JSF web view, so maybe my web client and the full app could be done with this.
I've worked with web services such as SOAP and REST with Jaxb and xml schemes to retrieve information parsing some webs into xml or json to show on a client .net app. So I've thought I can add to my app, like last topic we talked about, a REST web service layer to easily work as I want, or at least I think it would be easy. If I do this the Android app could share the same app core code but using the REST service.
My question is what could be the best way to do an app with 2 client side in different platforms that could share some code to be easy to extend it moreover to a desktop app. I've talked about these 2 options because I'm a students of computers at university and those are the tools I know, but I can easy learn more. I've also think about just a REST service and create a web and an Android client to work on same service or something like that.
This post is getting long, so here is the summary: What technologies and tools do you think are the best choice to create an java web app that needs to have web and Android client? Also what server, like tomcat, GlassFish or another, should I use? And what about persistence layer? JPA with mysql is the best I know to work with.
Thanks a lot.
P.D: I work with eclipse
From my point of view:
You can use java jersey and java spring both ( java spring as Dependency injection) for creating RESTful Web service. So, In server side you will create endpoint and you can access data from any platform through those endpoint.
Server can be anyone. It's up to you. I always try to use tomcat but tomcat is not a full JavaEE container it's only a servlet container. So if you want to use full JavaEE version then you should use Glassfish.
And yes JPA .It can be easily used in any environment supporting JPA including Java SE applications, Java EE application servers, Enterprise OSGi containers etc.
On the other hand, still choice is yours.

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.

linking my java web application to the web?

I am beginner java web developer, now my question is after i developed my application, how to make users see it on the web?
I used JSF,MySQL and GlassFish server in my development stage and now i want to publish it.
I got a domain name and an a web hosting account on goDaddy.com
In other words what to do after i develope my web application?
what steps should i take in server creation and other stuff?
I have searched alot but there is no specific way for it. I am trying to make this dynamic website based on jsf development--and it is already done--become alive and out their like any other web site?
any guide lines and steps should i take in making this steps ?
Either you will need a "Production" server to host the application yourself or use a hosting service of some kind that provides a Java EE container. If you're tied to Glassfish, you can Google for those providers like http://glassfishhosting.com/.
Other options that might be good fits for you are cloud services. Something like either Rackspace or Amazon EC2. Each has their own pricing tiers that scale based on usage. Good luck to you going Live!
Can host the code on Github and push it to Heroku.
http://devcenter.heroku.com/categories/java
I don't know the provider you chose but you need a java application server for your live environment. And optimally this should be the same server as your development server.
For our projects we buy a virtual server and install Glassfish on it. This costs around 15 € per month and we have the same environment for development and production.

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