How to deploy REST web service to Heroku? - java

I am trying to deploy a simple java rest service using webapp-runner in heroku, i follow the instructions in documentation and everything perfect, i run my app and is working cause i can see my html welcom page, the problem is that i cant access to my rest resources with the path i provided even in a local deploy http://localhost:8282 this is the path when i open my app, http://localhost:8282/wr/test and this should show a simple get method, but doesn't work neither local with webapp-runner nor remote in heroku, this is the link https://appbergas.herokuapp.com/ , what am i doing wrong? which should be the complete uri i thought https://appbergas.herokuapp.com/wr/test
im using javax ws rs,also when i deploy it in glassfish everything goes great.

Related

Spring Boot app not running properly on Azure

I have a spring boot application, built to a war file. The code is here. The application works properly when running locally in ./gradlew bootrun, and my REST endpoints are responsive.
I set up FTP credentials on my azure site (Windows resource), and I've successfully uploaded the war file via the deploywar endpoint, as described here.
When I FTP in to the site, I see the war file exploded in to /site/wwwroot/webapps/ROOT/. However, it's unclear to me how to access the site.
THe main URL is https://springboottest01.azurewebsites.net/, which still is serving the hostingstart.html. If I go to https://springboottest01.azurewebsites.net/webapps/ROOT/, I pull down my webapp's index.html, and a few JS files. However, the REST API call that it tries to make, /students/list, fails to run (404 error), which makes me think that the spring boot backend isn't actually running.
How do I diagnose this? What do I need to do to get this to work?
I also tried setting up a Linux resource (Tomcat 8.5) and deploying the webapp to that site. When I do that, I get the same problems there (in this case, the webapp is available at the root URL of that resource, but the REST endpoint that it tries to call fails). https://springboottest02.azurewebsites.net/

How to deploy webService and get access to wsdl?

I have got a webService without ui. It simple jax-ws app that will allow to manage users via soap requests. I tried to deploy it on websphere. It was deployed, But! my app doesn't appear in Service Providers and i can't get access to wsdl file via url that i pass in wsdlsoap:aderess location. It haven't got any servlets and other stuff. I create my app using template that deploy with success, it appear in Service Providers. I research all internet, but idk what go wrong.
P.S: Template project was eclipse project. I just add maven and has no idea why it wouldn't work.
The fact that your web service hasn't appeared in the Service Providers section means you've deployed it the wrong way.
Check whether you've selected the "Deploy web-services" option during deployment.
You probably got an issue in your trace.log file which possibly references to the ffdc, check it to investigate the problem.
You also haven't mentioned if you using servlet or EJB-based web services.

How to get started on Google App Engine for current GlassFish solution

I'm currently running my Java application on a GlassFish server on AWS-EB.
Since our front-end is already running on the Google Cloud Platform, I would like to migrate my back-end to GCP as well.
I tried the Jelastic interface but I was not happy with the speed results.
Now I'm looking to deploy my application on the App Engine but when I deploy my current .war file, I get the following error:
Error 404 - Not Found.
No context on this server matched or handled this request.
Contexts known to this server are:
/ ---> o.e.j.w.WebAppContext#7e0b0338{/,file:///var/lib/jetty/webapps/root/,UNAVAILABLE}{/root.war} [failed]
I guess I'm missing something, since GCP is using Jetty as a server.
I'm a bit lost and I hope you guys can point me in the right direction to make this migration successful.
It's suggested here that Jetty requires two configuration files (web.xml and applicationContext.xml).
As well as this, the original poster in the issue above stated that they solved their issue in this GitHub post by rebuilding their project before deploying.

How to test a REST WS using URL

I've Googled how to but I can't seem to find a step-by-step guide for a beginner. I just want to make sure a class is working and printing fine. A lot of tutorials said to just put the URL in the browser but I don't even know how to get the URL of my web service.
What I've done so far:
1. Created a WAR file out of the project
2. Deployed the WAR file on Tomcat
By default, the path will be based on the name of your WAR file, but can be easily configured.
see this response: How to set the context path of a web application in Tomcat 7.0

Make web service work on different server

I am developing a web service with Eclipse. This service will be accessed from Android with ksoap2.
I successfully tested the service on my local apache tomcat (http://localhost:8080/) and now want to set this service up on a different server (i.e. http://giraffe/).
The .wsdl file generated by Eclipse contains the following line:
<wsdlsoap:address location="http://localhost:8080/AndroidService/services/AndroidService"/>
I guess this won't work out if I just add the .war file to giraffe and try to reach the service.
My question now is the following: What do I need to change in order to be able to use this service on a different server? Do I just have to change this address location?
If you need me to post some of the code/files, just tell me.
My eclipse project structure looks like this:
You can replace http://localhost:8080 on wsdl with http://giraffe/
Are you facing any issue once you deploy on the server?

Categories