views:

859

answers:

2

i'm using netbeans and when i create a new web application project i click the "Add" to add a server cause in a tutorial they are using tomcat and not glassfish.

I then choose Tomcat 6.0 from the list and the next page is displayed where i have to input

Server Location
Username
Password

I dont get this part. What location do they mean? And what username and password?

+4  A: 

With Server Location they probably mean the root directory of the Tomcat installation, sometimes also known as CATALINA_HOME.

There's a file in Tomcat's conf directory called tomcat-users.xml. The Tomcat documentation tells you to add a user ID and password to this file so you can administer Tomcat. So those would need to be entered in NetBeans then.

Carl Smotricz
why is the tomcat installation directory? i have only downloaded and installed Netbeans but i chose ALL so that would include Glassfish AND Tomcat. But in the Netbeans application folder i just see glassfish folder.
weng
Do a file search or something for a directory called `webapps`. This is where Tomcat normally stashes Web applications. One directory up from that is the Tomcat main directory.
Carl Smotricz
But maybe Netbeans really didn't install a Tomcat for you. In that case, you may be best off following Pascal's suggestion and going with Glassfish. Some app server specific instructions from the tutorials you're following may end up differing a bit.
Carl Smotricz
While the download includes the bits for Tomcat, the IDE installer does not install Tomcat (by default)... you have to do a custom install to get the IDE to install Tomcat and register it with the IDE
vkraemer
@vkraemer: Thanks, that's very helpful. I didn't know this, I'm an Eclipse person.
Carl Smotricz
A: 

Carl's answer is right, but there is a wiki page with instruction on how to register an existing Tomcat installation with NetBeans that is a bit more complete.

Also, the IDE will add the values of user name and password to the tomcat-users.xml for you if the checkbox with the label 'Create user if it does not exist' is selected (and you have write access to the tomcat-users.xml file).

vkraemer
Watch out for https://netbeans.org/bugzilla/show_bug.cgi?id=151222
vkraemer