Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7796665
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T23:26:17+00:00 2026-06-01T23:26:17+00:00

Does anyone know what I might be doing wrong here? I added the username

  • 0

Does anyone know what I might be doing wrong here? I added the username and password to the tomcat-user.xml but I am still getting a “401 Unauthorized” error.

String url = "http://localhost:9080/manager/list";
HttpPost httppost = new HttpPost(url);
httppost.setHeader("Authorization", "Basic " + userPass);

log.debug("executing request {}", httppost.getRequestLine());
DefaultHttpClient httpclient = new DefaultHttpClient();
HttpResponse response = httpclient.execute(httppost);
HttpEntity entity = response.getEntity();

BufferedReader rd = new BufferedReader(new InputStreamReader(entity.getContent()));
String line;
StringBuffer buffer = new StringBuffer();
while ((line = rd.readLine()) != null) {
buffer.append(line);
buffer.append('\n');
}
rd.close();
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T23:26:19+00:00Added an answer on June 1, 2026 at 11:26 pm

    The answer depends on whether you’re using Tomcat 5.5/6 or Tomcat 7.

    Tomcat 7

    You’ll need to access the the listing with the following URL:

    http://localhost:9080/manager/text/list
    
    • http://tomcat.apache.org/tomcat-7.0-doc/manager-howto.html#List_Currently_Deployed_Applications

    You’ll need to configure tomcat-user.xml with a user that has the manager-script role.

    • http://tomcat.apache.org/tomcat-7.0-doc/manager-howto.html#Configuring_Manager_Application_Access

    Tomcat 5.5/6

    You’ll need to access the the listing with the following URL:

    http://localhost:9080/manager/list
    
    • http://tomcat.apache.org/tomcat-5.5-doc/manager-howto.html#List_Currently_Deployed_Applications (Tomcat 5.5 docs referenced because for some reason the Tomcat 6 docs contain the Tomcat 7 specific instructions)

    You’ll need to configure tomcat-user.xml with a user that has the manager role.

    • http://tomcat.apache.org/tomcat-5.5-doc/manager-howto.html#Configuring_Manager_Application_Access

    Update

    You may not be performing the Basic Auth step correctly. The username/pass might need to be base64 encoded. See the highest voted answer in this question: Http Basic Authentication in Java using HttpClient?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know what's wrong with this code? Cipher cipher = Cipher.getInstance(AES/ECB128/PKCS5Padding, SunJCE); Algorithm:
Does anyone know if a user generated HTML5 Canvas could be attached to a
Does anyone know where I might be able to find free scaffold templates (i.e.
Does anyone know, what an XMLHttpRequest enables a web page to do, which cannot
Does anyone know where code can be found for Metaphone 3 matching for T-SQL
Does anyone know how to make x-axis and y-axis look a bit bolder or
Does anyone know how I would force the computer to update the time with
Does anyone know why 2 /// 2 is 2 in Javascript? What is this
Does anyone know why the file doesn't format correctly on the line < taskinprogress>
Does anyone know how to generate the following generic method declaration using CodeModel? public

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.