I have a REST service, that uses Jersey, deployed on my local machine. The service does not use an ORM. Instead, it uses the JDBC driver to populate models from my MYSQL database. Everything is working as expected and now, I would like to deploy my service onto Openshift. I have read up on how Openshift works and I'm a little confused. I do not have any experience with GIT, so I found myself getting lost when the Openshift website told me to push my application to their servers via GIT.
I am looking to have my REST service, as well as MYSQL database moved to the Openshift server without making changes to my existing code. This is my first time deploying a web service on something other than localhost so any leads, regarding what to do research on to get what I want would be very much appreciated.
I've been using OpenShift to host some personal projects, and I can feel your pain when you get a little lost with how to do it. I had been using Git for awhile though so that helped.
This page. is what helped me get the tools set up for git correctly. They require ruby, and node, so you'll have to install those as well. Once you get everything set up though, you'll basically "Clone" the repository that open shift gives you which will create a local instance of the repositories contents in your computer. You can then use the commands "git add", "git commit" and "git push" which will push your changes back up to their server.
Good instructions exist on this page describing what I just told you. From what you said it looks like you've completed steps 1 + 2, but steps 3 and 4 are still left. You have to have your command line tools set up first however. Let me know if it helps!
Related
I have managed to create my first JEE application. Now I am trying to publish it online, I tried openshift and Amazon EC2 tutorials but none of them worked.
So is there another way to deploy it ?
folder's tree
If it's working locally then you're almost there.
Check this out. Will's answer should answer your question.
If you work for a company and have a server set-up there, you could reroute your domain to the company’s server and do the same. In this case, you can deploy your webapp on a virtual machine at port 80. This VM's IP address will be the one which your domain reroutes to.
The procedure is pretty much the same in both cases.
I built a simple jhipster app to start a new Spring Application project from. I chose:
Java 7
Local Auth
Postgresql both for production and development
No HTTP sessions
No Websocket
Ehcache
Maven
Grunt
I created the relevant Schemas in Postgresql and started the app with mvn spring-boot:run in the terminal and I get a starting page for my application on localhost. Only the navigation is visible and none of the attached javascripts seems to be running or at least working properly. In the javascript log I get "ReferenceError: angular is not defined". None of the links take me anywhere.
Talking about logs, the startup says the app is using org.jboss.logging. I see no log files. Anyone knows where the logs are? I'm trying to read the source code for log settings, but I can't seem to find the proper settings.
There are no created tables in the database either.
I assume there is a setting I missed somewhere, but I don't have a clue yet. Hopefully I can find the logs soon and get one.
Any ideas how to diagnose this problem is most welcome. Thank you.
I have a full stack web application that I want to host on Heroku. I have never deployed a web application so I don't know where to begin. Can anyone help me out? The frontend is HTML/CSS/JS(angular) and the backend is java(spring) if that helps.
This guide pretty much goes through everything that you need to do to deploy to heroku.
Basically, if you have your code hosted on github already, you can just create the app on heroku, add a heroku remote (git add remote 'git#heroku.com:yourapp.git') and push to heroku (git push heroku master). If you are unfamiliar with git, I suggest you start with that.
First and foremost, Heroku has a developer manual here Heroku Java Development Going through that, you will realise that Heroku gives you tomcat/jetty support only, but you must use embedded versions, and fireup everything on your own.
I guess since you have to fireup everything on your own, using even a full-fledged javaee could be possible, the only problem is firing it up, and tomcat/jetty gives you an easier option.
I have coded a Jersey based java server which is all wrapped in one excecutable jar.
I am looking for a web host service in which i can deploy the jar and run it.
I saw some dedicated servers which can do this but this is overshooting the need, any suggestions?
As per your comment I understand that you created a web application with a Jetty embedded server.
I think the best solution for you in this case is to get a virtual machine host, install JRE, upload your *.jar and run it from there. Given firewall permissions and correct configuration you should be able to receive requests on the 80 port. Cons? It costs. A lot.
Most of the Java hosts have already a servlet container running (almost always Tomcat) and you can only deploy your web application in it. Having an embedded Jetty server messes up everything for you.
I strongly suggest you to detach your web application (or as you called it REST server) from Jetty and deploy the *.war in any of the multiple free Java hosts to test it online.
EDIT
Thanks to you I made a deeper research on the topic and found an interesting guide to deploy a web application with embedded Jetty server in Heroku. I've never tried it nor I know if its free, but maybe you can give a try.
Digital Ocean work pretty well for me. Their basic packages are really cheap and you get root control over your own machine, meaning you can host whatever you want without restrictions. The only downside is that they are pretty old school - you have to set up EVERYTHING yourself, including firewalls etc. There are a lot of guides available on their website though, which makes life a lot easier!
http://www.digitalocean.com
I know this is a touch redundant but I don't have voting or comment rights yet so this is the only method for me to communicate.
Digital Ocean is a solid choice. I am paying 5$ a month for a VM with 512 Mb Ram and 20 gigs of storage (which for my use is just fine.) I am still working on my first proper deploy but as stated above there are tons of tutorials to guide you through it. I have no prior command line experience but I've managed to get the server running, Created an SSH key, uploaded my landing page and have gotten a test project using Spark as the embedded server up and functional in a matter of a few hours. The Droplets are easily scalable from what I've seen. I'm still having trouble deploying an Rest based app with Postgres as the DB but it seems more to do with the ports in play than anything else. Keep getting 404s.
Silly question as I just started web dev. Consider that I've got the project build on Spring MVC Framework in the Netbeans (a web site). I would like to make it live.
What is the actual process of making it live considering the fact that I bought the domain and got the hosting? i.e. you upload project in the repository of hosting provider? (not sure if the question is correct, hence correct me if it's wrong)
Can I somehow connect the repository of hosting provider with my Netbeans to update my web site directly from it? (like it works f.e. with svn repository)
First of all, it's a java application that you want to host / publish, so you will need java hosting company.
You need domainname, you can buy one, or get free domainname (there's a few options, you can get free .tk domain, some hosts offer free domain with 1 year prepay as well).
Yes you can connect to your host's SVN with your Netbeans IDE. But deployment process depends on how you will set up your environment on host side. SVN is a place where you keep your source code, not a compiled java application. You can use your host's SVN server, but then still you need to compile java code and build war file which you can deploy under your java server. Some java hosting companies offer Apache Maven, which can helps in your case. Another solution is to build war locally, and upload ready app to your java host account (try to use SFTP or SCP, most of java hosting companies offer SSH access to your account, try to avoid FTP as it's pretty unsecure).