1

I am going to write several simple web apps, but I have an issue with deploying applications. I use NetBeans IDE 8.0 (Build 201403101706) with Apache Tomcat 8.0.3 (that came along with Netbeans).
After I click 'deploy' on my web app, there is a new WebApplication1 run-deploy window. It contains:

ant -f C:\\Users\\chechulin\\Documents\\NetBeansProjects\\WebApplication1 -Dbrowser.context=C:\\Users\\chechulin\\Documents\\NetBeansProjects\\WebApplication1 -DforceRedeploy=true -Ddirectory.deployment.supported=true -Dnb.wait.for.caches=true -Dnb.internal.action.name=redeploy run-deploy
init:
deps-module-jar:
deps-ear-jar:
deps-jar:
library-inclusion-in-archive:
library-inclusion-in-manifest:
compile:
compile-jsps:

And there is a never-ending 'Deploying WebApplication1" process. Server shows that there is no apps. And I cannot expand Web Applications node that should be like on the following picture: web apps tomcat

But when I take .war file from the project /dist directory and manually deploy in to the server, it works fine!
I just cannot figure where is the problem!

7
  • Looks like you might are deploying to a different server than you think. You say you're using Tomcat 8.0.3, but the image says that you've got Tomcat 6 configured within NetBeans. Which is your app configured to deploy to? Commented Apr 17, 2014 at 10:50
  • I just took the image from the web to show what I mean by 'web applications node'. It doesn't expand in my case. Commented Apr 17, 2014 at 10:52
  • Have you tried removing (unregistering tomcat) from within NetBeans and then registering it again? Commented Apr 17, 2014 at 10:53
  • Yes, I did (saw the same advice in another topic). But nothing has changed. Moreover, there is a server log in Netbeans, and it shows when I deploy and undeploy my .war file. Commented Apr 17, 2014 at 11:10
  • Have you tried with a basic IDE generated project. Does that work? Are you getting any errors in the NetBeans or Tomcat log files? When you added Tomcat into NetBeans, did you specify a username/password to connect with and tell NetBeans to create that user? Commented Apr 17, 2014 at 11:21

3 Answers 3

3

Open tomcat_users.xml as administrator, you can find it under conf folder like in my case C:\Program Files\Apache Software Foundation\Tomcat 8.0\conf\tomcat_users.xml and find tag <user> and add role manager-script in roles attribute like this

<user username="admin" password="admin" roles="admin-gui,manager-gui,manager-script" />

But make sure tomcat is not running.

Sign up to request clarification or add additional context in comments.

Comments

2

I faced the same error. It seems that Netbeans can not deploy to Tomcat7 and Tomcat8 (Or at least i could not find the way how to do it). Netbeans log files gives below error

INFO [org.netbeans.modules.tomcat5.deploy.TomcatManagerImpl]: TomcatManagerImpl connecting to: http://localhost:8080/manager/list java.io.FileNotFoundException: http://localhost:8080/manager/list

Similarly it tries to use manager/deploy for deploying.

Tomcat documentation states that after tomcat7 they changed the structure and these two links are not available anymore.

When I installed Tomcat6 and configured at Netbeans, it worked and deployed as expected.

Comments

0

I got the same error: Netbeans then hangs when deploying on Apache Tomcat. I found out that the version of Java of my application was not supported by the version of Tomcat I was trying to deploy into. In particular, I was trying to deploy a Java 8 (also known as Java 1.8) JSP application into Tomcat 11.

Then I checked the Apache Tomcat compatibility list: https://tomcat.apache.org/whichversion.html and found out that Java 8 was supported until Apache Tomcat 9.0.x. I downloaded then Tomcat 9, configured in the Netbeans Servers (via the menu Tools->Servers), and the application was deployed successfully.

Also, I had to kill a previously running Tomcat server on the same port (8080) that blocked my new server from launching. I couldn't find that process from the Tasklist in Windows, but I could successfully find and kill it via the command line commands:

netstat -aon |find /i "listening" |find "8080"

and then copy the PID into the kill command:

taskkill /F /PID

Ex: taskkill /F /PID 189

See also this answer (where I took these commands from): https://stackoverflow.com/a/42084313/5538923 .

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.