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

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.

Related

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!

Deploy on Elastick Beanstack (Tomcat) index page not served

I'm trying to load my Spring Boot REST application on amazon AWS, specifically I'm using the Elastick Beanstack service.
I can configure everything correctly, but the public address (http://socialnotes-env-tomcat.eu-west-1.elasticbeanstalk.com/) does not serve the index html page. In local with
java -jar ...... snapshot.war
everything works correctly, but on amazon aws it seems not to find the index page (even if decompressing the war I see it in the main folder)
It seems very strange and I can not solve, the endpoints seem to work properly and I can also access the static files (http://socialnotes-env-tomcat.eu-west-1.elasticbeanstalk.com/static/assets/images/coffee.jpg)
I followed this guide to create the war file: https://www.mkyong.com/spring-boot/spring-boot-deploy-war-file-to-tomcat/
But I can not in any way make the index page return, I always get a 404.
Can you look in "Logs" of your project at AWS what caused the problem? You can choose option "Last 100 lines" and scrole down. That may help or at least may give some clues.

How to get rid of this error when starting Tomcat

I am adding some things in an existing Android app, which connects to a Apache Tomcat server to get information from a database, but some of the changes required that I also make minor changes on the webapp (changing some database fields).
I had never used tomcat, but managed to do the simple changes here and there.
But when I deployed it, I noticed some errors(see the photo).
How can I fix them ?
The app works regardless of them, but the server takes a few more seconds to start up.
P.S.I read somewhere that this means that the server already has these libs, and doesnt need to use the ones from the lib folder of the app ?

Symfony2 deployment via ftp

I tried to deploy my project with capifony, becouse I found here an answer, that with capifony deployment is easy. Well I don't think it is, so my question is:
How can I deploy my project via ftp, I put all my files on the server but even if I browse to web/app.php, the only thing I get is an empty page, whatever route I write in the url. So someone please explain me how can I get this work! Thank you!
A couple of things to think of when deploying a Symfony2 project to a new server or computer (as far as I've encountered) might be:
Make sure that the server and it's PHP installation meets the Symfony2 requirements (and perhaps also the recommendations)
Check that you've somewhat followed the installation instructions (found here)
Try to clear the cache
Make sure that the web server and it's PHP process have write permissions to the cache folder
If none of these helps, try to modify the app_dev.php to temporarily allow access from your current (client) IP (instead of restraining it to localhost). Then, hopefully, you'll get a more useful and detailed error message, instead of the blank page (which often is caused by some fatal error that have occurred during the initialization of the framework and its kernel)
Update: Noticed now that you've tagged your question with 'windows', but that you don't mention which server you're trying to deploy to. I wrote the above with some *nix based server in mind, but hopefully some of it are applicable to Windows servers too (but there might be other common sources of error running under Windows that I'm not familliar with

Two Hudson Masters on the same Windows Server

I want to setup two Hudson Masters on the same Hardware. This will make administering Hudson easier, since both servers are used by two different (and independent) teams.
So far I tried to install one server as a service. I verified the installation and it is running ok. I than copied the installation into another path and changed the service information (different service Name and description) and the httpPort. I then create the service, once using sc.exe create and once using hudson.exe install. In both cases the server started. However, the configuration page acted goofy. So this approach is either not working at all or I missed another configuration file.
Does anyone has an idea how to accomplish this?
I tried the same approach as documented in the question but avoided the copying of the original installation. So I created two folders and put a copy of hudson.war in it. Then I performed the following steps for both folders.
Start Hudson with java -jar hudson.war
Installed Hudson as a service using the web UI
went into the Hudson Base Dir and ran hudson uninstall
modified the port and the Service information in hudson.xml
installed the service through command line hudson install
Now I have two services and the first quick test looks promising.
May I suggest:
run two instances of Tomcat
have each Tomcat running on its own HTTP port
deploy HUDSON.WAR in each Tomcat
set CATALINA_OPTS for each Tomcat to point to a different HUDSON_HOME

Resources