War file working on my PC but 404 error with older Tomcat - spring

I had to develop an app with Flutter for my dissertation. The app was an update and an extension of an old app devepoled by another student of my university, 2 years ago.
He developed also the backend that was written in Java using Spring and Maven.
Developing my app, I had to do some changes and additions in his code.
Some days ago I tried to export the backend project as a war file compiling with the JDK 15 (during the developing I used the Intellij's build-in Tomcat to test the new features) and I did the deploy on my Tomcat and I got error 404.
After reading many posts about this error on this site I found the solution by simply installing and compiling with java 12.
At that point, excited by the idea of finally being able to use my application and start the tests necessary for my thesis, I deployed the same war file to the Tomcat running on university server and I got error 404 again:
"HTTP Status 404 - /backend-api/
type Status report
message /backend-api/
description The requested resource is not available.
Apache Tomcat/7.0.52 (Ubuntu)"
I tried to install the same JDK (1:7:0 79) that was used by the developer of the backend during his dissertation, but the problem wasn't solved.
In the second anwser of this thread it seems that they are talking about a similar problem, the point is that I can't modify any setting of the server of my univeristy and, right now, I can not even access to the logs of Tomcat.
I think the problem may be an outdated version of the JDK or Tomcat running on the university server.
But what seems strange to me is that the old version of the backedn is still running on that server and working without problems, and I have not made any changes to the configuration files, but only added a couple of functions.
Do you have any suggestions for me to solve the problem or understand what the cause is?
In a few days I should graduate and without my backend the application is not usable.
On my PC i deployed the war file on Tomcat 7.0.107 with JVM version 1.8.0_271-b09, while the university is running Apache Tomcat / 7.0.52 (Ubuntu) with JVM version 1.7.0_79-b14.
Thanks a lot to anyone who takes their time for trying to help me.

Related

spring-mvc-404 page not found error in maven project

I have been trying to understand and clone the spring mvc login and registration process. As far as I know I am following the same code and process. Only thing I have changed is database details.0 Which works fine I am able to insert the data into the MySQL (8.0.27) database using test file. I am getting the same error even when I am trying his code I am getting error.
here is my code: https://drive.google.com/drive/folders/1JNkZp_O1Lh0y_1NdZ-A85KI1gfgy0_Em?usp=sharing
here is GitHub code: https://github.com/javabyranjith/spring-framework-mvc/tree/master/springmvc-userlogin
Errors I am getting:
action keyword in form was giving error "element loginProcess is not found"-> so I changed it to the form action then it worked
The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
my questions are
can a different version of Apache Tomcat(10.0.13) server can cause the issue?
since I am using new Eclipse so I have updated the new libraries can this cause the issues?
Please suggest the changes so that I can run this project. Suggest the changes here or directly change it in the google drive folder.
Tomcat 10 does not work with Spring 5. Downgrade to Tomcat 9.
10th has jakarta packages renamed from javax, which spring 5 does not support.
Friendly advice, if you are using code from git, they left versions of stuff like java and tomcat for a reason, and the newest versions like Tomcat 10 and JDK17 went through a lot of changes, so always try with suggested versions and try to migrate them to higher ones. Except for Tomcat 10, you will have to wait for Spring 6 for that.
As for the new eclipse, it does not make any difference, the maven project is still the maven project, src, and pom.xml, the structure remained the same.
First try with suggested versions then you can ramp them up once you are sure that it is working.

Error when running two web applications at the same time in tomcat

I have a web application (maven) which uses mariadb as a database and I'm deploying the app with Tomcat on a Raspberry Pi.
Since I wanted to create and deploy a similar version of the original application. I slightly modified the application (which has originally been created by another person). The only change that I made to the application was to connect it to another database instance on my Raspberry Pi, by changing this line:
spring.datasource.url=jdbc:mariadb://localhost:3306/myDatabase2_db
Of course, I created a database by the name of "myDatabase2_db" on the Raspberry Pi in advance. And I also changed the name of the WAR-file to MYAPP2, so that the two applications have different names.
My goal was to deploy the original application and the modified version as completely separate applications (with different databases), but on the same Tomcat instance on my Raspberry Pi.
My observations so far:
(1) If I stop the "original" application in Tomcat and AFTERWARDS deploy the "modified" application and try to run it, it works without any issues.
(2) Only when I try to run both applications at the same time in Tomcat, it always displays the following error in tomcat:
FAIL - Application at context path /MYAPP2 could not be started FAIL -
Encountered exception org.apache.catalina.LifecycleException: Failed
to start component
[StandardEngine[Catalina].StandardHost[localhost].StandardContext[/MYAPP2]]
So far, my guess is that this happens because I used the same code basis for both applications and only changed the above-mentioned 1 line of code. Do I for example have to change something in the pom.xml file or somewhere else?
The problem is just that I didn't create the original application and only have a very limited unterstanding of maven, mariadb and tomcat. I would really appreciate if someone could explain what is happening and how to resolve this issue.
Thanks in advance!

How I get IntelliJ UE and Tomcat 9 to run my web application? (Mac OS)

I have searched everywhere for this. I'm sure I have read the information correctly but can't seem to get a full understanding of it.
I used this tutorial to get things going (https://www.jetbrains.com/help/idea/2016.3/creating-and-running-your-first-web-application.html). I do everything step by step but when it comes to running my web app, The localhost shows the official page of Tomcat and not my index.jsp that I have created. I've tried every path combination to try to get my index to show but I have had no luck.
I have done a lot of googling on this and it seems to be that when I run tomcat it reads the files from the webapps/ROOT folder instead of my project folder. How can I get my intellij or tomcat to read the files from my project? I keep reading that its my run configurations but everything looks good to me, and no one really shows what to actually do.
I wouldn't be asking unless I have tried doing this my self for hours. I'm sorry if it is really simple I just can't see it and would really appreciate your help. Thanks in advance
Structure (Ignore error messages)
Configuration
Artifacts
Deployment tab
I always get routed to this web
Artifact deployed successfully
It looks like you already have Tomcat service started on port 8080, therefore IntelliJ IDEA cannot start another instance and perform the deployment.
You need to shut down the service running on port 8080 so that IDE can start its own copy of the server and perform the configuration/deployment on start.
brew services stop tomcat should help in your case.

Wildfly 9.0.2 on AIX server : application deploys but don't load for customers

We have a JEE application ( with JSF 2.2 PF & RF ) that we have deployed for many of our customers.
We have it deployed on jboss 4, wildfly 8 and recently we HAD to use wildfly 9.0.2 on an AIX environment.
The application is deployed without issues but when accessing it the browser keeps fetching. On my laptop it actually work "sometimes" but the main issue I found is some images keeps fetched with status pending. I tried many browsers so I don't think it's browser related, it's not application related I can guess too.
I gave file access rights to the files.
Any ideas or suggestions plz ?

Oracle JDBC web service in Apache Tomcat 5.5 can't authenticate with DB

I installed a java web service on a machine that accesses an Oracle DB via JDBC on the same network. The service was functioning fine for several months until this morning when I installed another applicaiton that access the database using ODP.NET. I'm trying to figure out what went wronge to cause the ORA-01017 exceptions that I'm getting. This generally means that the login credentials are invalid, but the login credentials haven't changed. I also verified it the service's log4j output that it is indeed still trying to connect to the DB correctly.
I realize I don't have much to go off of here, but I'm trying to figure out what other dependencies that. The web service came packaged with ojdbc14.jar, so that tells me that it targets java1.4, but presumably would work fine in later java versions. Not too sure about it working with later java versions, however, it was working fine until today.
Does OJDBC rely on tnsnames.ora. If it depends on how the service uses OJDBC, then I'm not sure which it is doing. I suppose it's possible I deleted the tnsnames.ora, but that is a bit of a longshot. I also tried manging Apache Tomcat (running on Win Server 2003 x64) to target different java jvm versions, but to no avail. It was initially targeting the default jvm.
Are there other dependencies that I've missed here, or any diagnostic measures I could try? THe same web service is running on another machine on the same network which I am pretty sure is configured exactly the same. Again, it was working on both machines until today, and is now just working on the one.
Tomcat targets JDK 7.
Looks like replacing ojdbc14.jar with ojdbc6_g.jar did the trick. No idea why it was the case only for 1 of the 2 machines. ojdbc6 targets JDK 6, but ojdbc14 did, and should have continued to work. If anyone has any additional insight here, let me know.

Resources