Bluemix "forbidden" error on JSP pages - spring

I deployed my java application on Bluemix. It's a Spring MVC application with some REST controller to expose web services and some jsp page to create a admin panel.
The JSP pages are in the root of web application (not in WEB-INF directory). If I run the application in local on my tomcat server, everything works, the web services and the JSP, but if I deploy on Bluemix i have this error:
Error 403: SRVE0190E: File not found: /admin/index.jsp
It's a strange error because it says "File not found", but it's not a 404 error, but a 403 (Forbidden), so I think it could be some kind of configuration problem...
Thanks

If your application runs on tomcat locally, then you can try using the tomcat buildpack:
cf push <appname> -b java_buildpack -p path/to/file.war

your problem seems related to your application context root, probably the server.xml resulting after application uploading and staging is not enough to manage it.
Generally speaking before submitting an application on Bluemix it should be better trying to deploy it to a local Liberty server first. If you are able run this application locally on your liberty server, package up the server, and then push the package using the related option from cf cli.
Follow this link https://www.ng.bluemix.net/docs/starters/liberty/index.html
to have a complete reference about java liberty runtime on Bluemix and about its options

Related

How do I connect my Azure frontend static web app to my Azure backend app service via endpoints?

For a learning project we've built a frontend and backend application. The frontend "application" is just a bunch of linked html/css/javascript files. The backend application is a spring boot / maven / java project with some endpoints.
When I run the backend application locally I am able to send a GET-request successfully using Postman. Now we've hosted the backend application via Azure and I have no idea how I can send a GET-request, I don't know which url to use.
After I get this to work I'd like to connect front- and backend application using these url's.
As you can run the backend application in your local environment successfully, you have to follow the below steps to configure and deploy the spring boot web app to azure app service:
In a terminal window, run the following command to configure your web app with the Azure Maven Plugin
./mvnw com.microsoft.azure:azure-webapp-maven-plugin:1.14.0:config
Then, at the Command Prompt, run this maven command and set the default configurations by typing ENTER and Confirm (Y/N) => 'y' and the configuration will gets completed.
Once you've done with the above steps, run
mvn azure-webapp:deploy to publish the web app to Azure.
Your webapp URL will be displayed in the output.
I don't know which url to use?
You can use that URL from maven console output and access the web-app.
Also Refer this SO thread to know how to deploy frontend and backend to the same app service plan.

Unable to deploy spring boot application to weblogic server

Issue :
Unable to deploy Spring-Boot application in WebLogic Server.
Description
I am new to Spring boot trying to build a proxy application to route the requests to source system but having issues deploying to weblogic-12c. It's a very simple application that exposes a rest service and then redirects the received request to upstream system.
What did I try ?
Tried log4j version in pom.xml and dispatcher-servlet.xml approaches googling, I've also read the issue is b'coz of the data sources but I don't have any persistence logic and don't need a data source to be configured in weblogic.
Below is the error I am seeing, any suggestions are highly appreciated.
ERROR:
Unable to access the selected application.
Message icon - Error java.io.IOException
Message icon - Error weblogic.utils.compiler.ToolFailureException

Deploy SpringBoot Api into IIS Web Server

I created spring boot api with gradle build. everything working fine in my local.
I deployed angular app in Sites/DefaultsTest in IIS web server. it run in https://example.app.com/app
SpringBoot API base path is '/api'
I want to deploy spring boot api in same windows server machine and should able to access through Angular App globally.
please guide me.
IIS WebServer Dashboard
As far as I know, the spring boot API is a java web application, we don't suggest you directly hosted the java web application in the IIS.
I suggest you could try to install a docker or using tomcat to host the application, then you could use IIS reverse proxy to redirect the request to that API to get the result.
More details about how host the spring boot application on the docker, you could refer to below article.
https://blog.codecentric.de/en/2017/04/ansible-docker-windows-containers-spring-boot/
More details about how to use IIS reverse proxy, you could refer to below article.
https://blogs.msdn.microsoft.com/friis/2016/08/25/setup-iis-with-url-rewrite-as-a-reverse-proxy-for-real-world-apps/

How to deploy html from tomcat server with Springboot

So, the answer is probably super easy, but I just can't seem to figure it out.
I have set up a REST webservice, according to this tutorial: https://spring.io/guides/gs/rest-service/ and have set up the Requestmapping and everything using postman, and that end is working like I intended to.
I am setting up my site locally, but when I try to send a get request with jquery, I am receiving the following error: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
So I have understood that the problem is that I am trying to run my html from file:// and that the solution is to run it from localhost on the tomcat server and found this answer in another topic: Deploying just HTML, CSS webpage to Tomcat
However, I cannot find such a webapps folder, and I am assuming it is because my tomcat server is deployed using maven and springboot. So how do I deploy my html/js on the tomcat server when it is deployed this way?
I am working on a mac and with IntelliJ.
In your spring boot application you can put your index.html file in src/main/resources/static directory and it will be served by the application.
Also you may try to configure CORS in spring boot, see this answer for links.
If you are deploying normal web applications like jee apps you do it by placing your war file in webapps folder. The web apps folder is inside your tomcat
But for for intellij-idea go through this, it should work:
Where is my app placed when deploying to Tomcat?

How to access spring application deployed in openshift's tomcat?

I have created a simple spring boot application and deployed it to openshift redhat (as Tomcat 7 application) through my OpenShift explorer from my Eclipse SDE.
When I tried to access from my openshift domain url, It showing status 404 but same application is working fine in my local.
My local url:
http://localhost:8082/TestApp/testme.do
My openshift url:
http://test-{mydomain}.rhcloud.com/TestApp/testme.do
Is there any specific way to access the openshift application url?
Thanks in advance for those giving assistance, Please let me know if you need additional details.
Regards,
Dhana.

Resources