Deploying Akka HTTP to Azure - java

I was looking for some info on how to deploy Akka Http app to Azure. Azure supports Java Web Apps, but I assume it does only for apps that run in TomCat or alike. But Akka Http is a standalone application - is there any support for that and in any case, how should I proceed with it?
I am aware of sbt-native-packager that can produce various installable formats, but seeing how easy it is to deploy .NET app from Visual Studio, I would love to see a simpler way for Java as well.

Based on my understanding, your app using Akka Http is a standalone jar file which need to be deployed on Azure WebApps. Please refer to the section Application configuration Examples of the offical tutorial Upload a custom Java web app to Azure to create a web.xml file in the path wwwroot to deploy your app like these samples Jetty or Springboot.

Related

REST API Deployment for Spring MVC

Currently I'm learning to build a REST API (backend) with the ionic application (frontend), but I'm facing an issue in backend REST API deployment. Thus, I'm asking this question to get some clues and answers related to REST API deployment, since I'm really new and no clue how to deploy a REST API. I had checkout some tutorial on youtube, but it seem like most of the example in videos are not using the technologies or environment that same as the REST API I built. The following shown the technologies I used to built my system frontend and backend:
REST API (BACKEND):
Language: Java, Spring MVC Framework
Database: Hibernate, Oracle SQL Developer
Web App Build Technology: Gradle, Gretty (To app start my application)
Ionic Application (FRONTEND):
Technologies: Angular Framework, HTML, CSS
How the application is working in localhost?
STEP 1: I will app start using Gretty plugin in gradle
STEP 2: I active the command "ng serve" (ionic serve) to run my ionic application
STEP 3: After both frontend and backend is successfully run, now I can access the provided link that generated from ng serve to access my web app and do anything I want.
Everything is working perfectly in local system, but it is different case when I test my ionic web app through my smartphone (Since ionic allows us to build progressive web app). The frontend ionic application will not able to communicate with backend when the operating environment of frontend is not in local system and I know it's really make sense, since my backend REST API haven't deploy which only able to operating on localhost. Therefore, I'm have tried to find solution on youtube and other internet sources to deploy my rest api online, but I don't see any information or deployment video that using the same technologies as I used to built my rest api (Spring MVC, oracle developer, gradle).
Thus, I'm asking this "stupid" question in here to find out whether any solution to deploy my rest api? or any suggestion to change the technologies that I used to built my rest api? or any mistakes I had made which violate the best coding practice in building rest api.
As a new programmer, I really appreciate the answers from all you guys. Thank you.
First, let's explain some concepts:
You backend is the application you coded, deployed on a server that exposes an endpoint for access - e.g. http://localhost:8080/yourApp - where your host/domain is your current computer (localhost) and the port is 8080 or anything you setup.
If you want to access from you smartphone:
1) Since your app is hosted on your pc, you need to be connected to the same wifi network
2) From your host machine, where you deployed your app, look for your ip address.
open your console/terminal
type ipconfig/ifconfig
look for your wifi and copy ipv4 address
3) redeploy your frontend pointing to your host machine ip
It worked before because you where on the same machine (localhost means redirect to your own device). When you switched to your phone it, also, redirects to your own smartphone.

Spring Boot on Android?

Is it possible to run Spring Boot on an Android device?
Right now I am successfully running a web service on localhost using Spring Boot which I've got building in IntelliJ IDEA. I need to get the same web service code running on an Android device. Is it possible to build the web service app into a JAR file that I can get running on an Android phone? I have a Google Nexus 6P running Android Nougat. I've done some limited research, and have found an application called JBED. So far I haven't been able to get this working.
I've started from scratch and built the example JAR:
gs-spring-boot-0.1.0.jar
and hopefully I can find a way to run this JAR. I'm guessing it probably won't work so if anyone has a better idea that would be great!
You can use i-jetty to host servlet based apps in android. or embed i-jetty (replacing tomcat or netty) in your spring boot app
Short answer is you're not gonna be able to directly run your spring boot application on your android phone. Spring boot is meant as a wrapper to quickly bootstrap Spring applications and is going to best serve you when building web based applications. As I see it you have two options.
Deploy your jar on the cloud somewhere(ec2,digitalocean, heroku, cloud foundry, etc.) and just access your Spring MVC app from the android browser. If you have some really complex logic in your boot app that you don't think you can port to android, you can still deploy your boot app in the cloud, and create a really "dumb" front end android application that consumes all of it's data from the spring boot app running externally.
Port you current spring boot application to a true Spring for Android project. http://projects.spring.io/spring-android/. The tools are out there to help you port it over all you have to do is put the work in.
There's an AnLinux app in play store that helps install a Linux distro inside termux.
I was able to install open jdk, spring cli and then run an spring boot project in that.
Here's a video I recorded demoing the same - https://m.youtube.com/watch?v=n9CY2wZPWJ0&t=1s

Deploy Java restful web service to live server

I have just learned to create java rest API using jersey and Oracle database.
I'm developing in eclipse and using weblogic server to run and test web service on localhost.
My question is what are the options of live servers to deploy this service so that I can access this API in my android application or any web application???
You can do that. But you have to make sure that all the dependent jars are packaged with the your WAR project(eg; Oracle db related things).
Some blog entries which give you an idea about what are all these servers and which one to pick for open development and common standards - http://blogs.forrester.com/mike_gualtieri/11-07-15-stop_wasting_money_on_weblogic_websphere_and_jboss_application_servers,
and this one http://zeroturnaround.com/rebellabs/the-great-java-application-server-debate-with-tomcat-jboss-glassfish-jetty-and-liberty-profile/
This will give pretty good idea about what is all these servers :)

Creating Java Restful webservice on Windows Azure

we are working on our graduation project project that has two main block
1- A website that is written in ASP.NET
2- A webservice that access the database (mySQL DB) , do some processing on data and communicate with that website to show the results.
We are using a java library [Apache Mahout] in that webservice to help us do that processing and that's why we need to write this webservice in JAVA
How can we create and host a Restful java webservice on Windows Azure ? What are the available options ?
Also , Is it possible to start the processing and stop it depending on a request that is sent from the website or another block (another webservice for example) ?
I hope the situation is now clear.I would appreciate if you could provide us with any resources that could help us understand how Restful java Webservice in Azure works :)
Today you have two options for running Java on Windows Azure: Cloud Services and Virtual Machines. Cloud Services (Platform as a Service) enable you to package up a web deployment (WAR) along with a JDK and your java server of choice (Jetty, tomcat, Jboss, etc) and deploy it. Your other option is to use a virtual machine (Infrastructure as a Service). You have a few different options for virtual machines (including officially supported Oracle images: http://www.windowsazure.com/en-us/campaigns/oracle/).
Your easiest option will be looking at Cloud Services (though this does require packaging no a Windows computer). There is a great Windows Azure plugin for Eclipse that will help you out tremendously (http://msdn.microsoft.com/en-us/library/windowsazure/hh694271.aspx). There are also a lot of tutorials, resources, and links to references here: http://www.windowsazure.com/en-us/develop/java/.
Azure websites now supports Java web applications - check it out - http://azure.microsoft.com/en-us/documentation/articles/web-sites-java-get-started/ - you use the default JDK 7 with Tomcat 7.0.50 or Jetty 9.1.0 OR you can even upload your own web container and configure it as per your requirements. Please refer to the link above.
I have created a Java web service using Axis2 Framework/Eclipse and deployed it on Azure Websites.

How would I/can I post a java web project from Netbeans to Sharepoint?

I have a java web application that I am developing in Netbeans (and running through Tomcat). Is there any way to put this application on Sharepoint?
This is my first time doing this. I've read that to post the application to a tomcat server you just have to copy the .war file over, but I haven't been able to find an easy solution for Sharepoint.
Sharepoint isn't a Java Application Server. You'll have to use Tomcat (or another Java Application Server) to host your application. If you need to interact with Sharepoint from your application, you'll have to use web services, a shared database or something else to communicate.
That's not possible out of the box. SharePoint only runs ASP.NET applications, not java projects.
You can deploy the solution to a Tomcat server and then use the Page Viewer Web Part to show external content.

Categories

Resources