netbeans
netbeans copied to clipboard
Double deploy
Apache NetBeans version
Latest release
What happened
- Deploy Java web application to Tomcat (run from Netbeans).
- Stop Tomcat (e.g. from Netbeans).
- Wait (for Tomcat to fully stop).
- Debug the app (debug project from Netbeans).
The app starts twice. Is first started with the server and then re-deployed. This causes various problems. Obviously longer startup. But also some tasks will run twice (tasks scheduled on app startup).
The app should be deployed once (remove the app before starting Tomcat and then start and deploy).
Did this work correctly in an earlier version?
- [ ] This used to work!
Operating System
Windows 10
JDK
JDK 15
Apache NetBeans packaging
Apache NetBeans provided installer
Anything else
Note that I had this with JDK7 and Tomcat7 and the same on Tomcat9 with JDK15. The project is on Spring Boot 2.6 on Maven (older on Spring 3 something and also a Maven project). So none of that seem to be a factor.
Are you willing to submit a pull request?
- [ ] Yes I am willing to submit a PR!
Code of Conduct
- [X] I agree to follow the Apache Software Foundation's Code of Conduct
i found this fixed on netbeans25
Still the same on NB26.
Even relatively simple micro service projects that use latest SpringBoot deploy twice.
Workaround:
- Clear work and temp dirs (I use a script for that, on Windows running with Git bash). Crucially this removes:
work\Catalina\localhost\aash\ - Remove project's xml from conf dir:
conf\Catalina\localhost\aash.xml.
Perhaps Netbeans could do something like that: before starting Tomcat remove localhost/projectName.xml and localhost/projectName/ (where projectName is the name of the project being deployed).
clear-temp.sh:
: <<'COMMENT'
Running on Windows:
1. Open Tomcat's main dir in Git Bash (the dir with `conf` and `bin`).
2. Run this file. (or paste the code in console)
Or create lnk with tomcat as the workdir.
COMMENT
# del
echo "Removing work contents..."
rm -rf ./work/*
echo "Removing temp contents..."
rm -rf ./temp/*
echo -e "\nDone\n"
# PAUSE
read -rsp $'Press any key to continue...\n' -n 1 key