2017  Kodetalk | Feedback | Privacy Policy | Terms | About

Compilation Errors - Server returned HTTP response code: 401 for URL ...

When you type ant install, these message appear:

    java.io.IOException: Server returned HTTP response code: 401
    for URL: http://localhost:8080/manager/install?path= ...

Make sure that the user name and password in your build.properties file match a user name and password with the role of manager in the tomcat-users.xml file.

Creating the Build Properties File

In order to invoke many of the Ant tasks, you need to put a file named build.properties in your home directory. On the Solaris operating system, your home directory is generally of the format /home/your_login_nam. In the Windows operating environment (for example on Windows 2000), your home directory is generally C:Documents and SettingsyourProfile.

The build.properties file contains a user name and password in plain text format that match the user name and password set up during installation. The user name and password that you entered during installation of the Java WSDP are stored in <JWSDP_HOME>/conf/tomcat-users.xml.
For security purposes, the Tomcat Manager application verifies that you (as defined in the build.properties file) are a user who is authorized to install and reload applications (as defined in tomcat-users.xml) before granting you access to the server.

If you have not already created a build.properties file in your home directory, do so now.

The file will look like this:


Note: For security purposes, make the build.properties file unreadable to anyone but yourself.
The tomcat-users.xml file, which is created by the installer, looks like this:
<?xml version='1.0'?>
<role rolename="admin"/>
<role rolename="manager"/>
<role rolename="provider"/>
<user username="your_username" password="your_password"

Answer is