Deploy a war to a Tomcat that is originally designed to work with embedded Tomcat - embedded-tomcat

I encountered a 404 error while trying to access a Spring Boot web app on Tomcat 10. The war is designed and work OK with embedded Tomcat (thru the cmd: mvn spring-boot:run). An example of invocation is http://localhost:8080/api/tutorials. The war file then is deployed in a normal Tomcat, but 404 error in both cases: http://localhost:8080/api/tutorials or http://localhost:8080/api, but OK if http://localhost:8080 (Tomcat welcome page)
I'm using Windows 10, Tomcat 10. Tomcat port, url...is carefully verified correctly
Could anyone help please, thanks much
The attached is my app deployed on Tomcat (no index.html or so)
enter image description here

Related

JETTY- HTML Publisher - Jenkins - Extent Reports - Images are broken 404 not found

The extent report that I generate running a Java Selenium project on a CentOS machine with jenkins it is showing partially correct.
The issue comes when trying to view the screenshots that I have attached into the extent report on Jenkins on png format
I am using HTML Publisher plugin on the latest version
I have already set this command on the jenkins command line
System.setProperty("hudson.model.DirectoryBrowserSupport.CSP", "")
Extent Report on Jenkins
The strange thing is when navigating directly on the CentOS file explorer and going to that path inside the jenkins workspace and opening the html report it is showing correctly as expected
Extent Report opened inside CentOS explorer
Has someone faced this issue before?
Edit:
This is the way I have the report inside a folder, including the jpg or png images at the same level of the html report files at same level of html report
EDIT: I have found a new important information for the issue. I contacted a security teammate and he told me this was related to a configuration issue since port 8080 is listening correctly.
Since Jenkins standalone is using a Jetty Http server it might be an issue with this.
Entering the jenkins logs I got this new information filtering the Jetty logs:
JETTY LOGS
Now I am working on troubleshooting this with the information with the logs
When requesting image not found, the file not allowed
Update your Jenkins Content Security Policy. With type into console the following commands:
System.clearProperty("hudson.model.DirectoryBrowserSupport.CSP");
System.setProperty("hudson.model.DirectoryBrowserSupport.CSP", "sandbox allow-scripts; default-src *; img-src * data: ;");
Go to Manage Jenkins -> Script Console on your jenkins

Cannot see Application server in Tomcat Server

I am building a web app from scratch in Intellij Ultimate version, I can see there the Tomcat and EE is enabled in plugin, as per below:
enter image description here
but when I go to Add configuration, the Application server is blank, and cannot see either when click the dropdown list, does that mean I dont have tomcat installed:
enter image description here
anyone else had the similar issue?
Confirmed with JetBrain that Integration for tomcat is pre-installed in the IntelliJ IDE. However the Tomcat itself - is not. Thus, I need to download Tomcat from https://tomcat.apache.org/download-10.cgi and define the path in IntelliJ IDEA. All good now, I had configured my tomcat and working as expected now.

How to run Php Pages in Netbeans

I have just successfully deployed Quercus on Glassfish 4.1. I tested in the browser
http://localhost:8080/quercus-4.0.39/ and saw this:
Congratulations! Quercus™ Open Source 4.0.39 is interpreting PHP
pages. Have fun!
Then ran Netbeans Tools > Options > PHP > Activate PHP Support
It worked. I now see this:
So I made 3 tests:
I ran a php page in an html application but instead of displaying the page it prompts a download box to open in Notepad
I created a new PHP project with below configuration:
But when I run the app with above configuration I receive this error:
Firefox can't establish a connection to the server at localhost.
So I tried with a third test with other configuration:
When I run this third test I get a HTTP Status 404 - Not Found error on GlassFish server.
What am I doing wrong? Thank you!
The problems with your tests are:
PHP needs to be interpreted by a web server. Your browser doesn't know what to do with a PHP file, so it just treats it like a file rather than a page to render. Apache is the most common and easiest server to do that with, GlassFish is unnecessary and probably not the best choice for PHP.
In this test, you are trying to visit a web server which doesn't exist. You don't have any server that listens on port 80.
Here, GlassFish is reporting that it can't find the resource you requested. Have you made sure to put your PHP project in the right directory for Quercus (like in step 4 of your documentation link) and made sure you're visiting a valid URL?
I think the best thing for you to do is move away from Quercus. The latest version of it is very old and implements an old version of PHP (version 5, whereas the latest is 5.6). Looking at the official website, the project appears to be dead, with broken links and very old documentation.
I would suggest you investigate installing a WAMP (Windows, Apache, MySQL, PHP) or LAMP (Linux, Apache, MySQL, PHP) stack. There are lots of very easy installers for this approach which will help you get up to speed and a lot of helpful tutorials and documentation.
For those who using tomcat, below are the steps :-
Right click your project --> properties --> Run Configuration --> For Run As, select PHP Built-in Web Server
Go to Tools --> Options --> PHP tab --> in Php 5 interpreter, browse the correct location for php
Then it should works !
In my case , my php is in /usr/bin/php7.0, so I put the path in Php 5 interpreter.

Apache Tomcat Server shutdown yet webapplication is still running

I am using Apache Tomcat 6.0.18, I am running on Windows XP
I have a web application which I place it's war file under webapps folder. The web application runs fine, its just when I run the shutdown.bat the application still runs (as in I refresh the page and it doesn't come up not found).
I check the localhost:/8080 and webpage cannot be found comes up
but when I run localhost:/8080/myapp my application comes up.
I have tried this in both IE and Firefox
Thank you for any help.
I had this similar problem, This can only happen if Apache Tomcat is not configured properly. Best way is to check build path and look for exact directory of Apache.
Example
i.e C:\Program Files (x86)\apache-tomcat-7.0.27
Also look for windows service for start, restart or stop
Run - services.msc
You may want to check this link
i.e
Verify that tomcat is actually down (simplest way is via task manager)
The issue sounds like a caching issue. Try deleting your cache.

is there a problem when migrating from apache tomcat 7.x to weblogic 10.3.3 a project with primefaces 3.0M2 involved

For a particular reason i developed a web app in apache tomcat 7.x and now i have to deploy it in weblogic server 10.3.3, in my project i use JSF 2.0 and Primefaces 3.0M2 and every thing works fine under tomcat container, but in WLS i get and error on startup, a FileNotFoundException when loading primefaces-3.0M2.jar!/META-INF/faces-config.xml, but that's not all, some pages does not display and in the logs there's and entry saying: *SEVERE: jsf.cannot_instantiate_behavior_error null*. I was thinking maybe WLS does not load the primefaces' behaviors and i put in my faces-config.xml the content of primefaces' faces-config.xml, but still nothing, any help would be accepted.