Re: Accessing Manager app through URLConnection
Thanks, no I was not. I will read up more thoroughly. I think I was just missing the whole point of what it was and thought it was something it wasn't. Original Message Follows From: Tom Anderl [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Subject: Re: Accessing Manager app through URLConnection Date: Sat, 26 Jan 2002 12:20:33 -0800 (PST) Are you giving it a command? e.g. http://your.server/manager/list From the log, it looks like you're not including the command (list in this case) So the manager sees an empty command string and doesn't recognize what it's supposed to do with it. Catch you later, Tom On Sat, 26 Jan 2002, Donald Lee wrote: I setup mine and it authenticates then gives me, FAIL - Unknown command I don't even know where to begin troubleshooting because I don't know what I am supposed to be looking for. Localhost_log file has the following, 2002-01-26 15:13:35 StandardWrapper[/manager:Manager]: Loading container servlet Manager 2002-01-26 15:13:35 Manager: init 2002-01-26 15:13:35 Manager: init: Associated with Deployer 'localhost' localhost_access_log has 192.168.0.1 - - [26/Jan/2002:15:13:33 -0500] GET /manager HTTP/1.1 401 618 192.168.0.1 - dwlee1 [26/Jan/2002:15:13:35 -0500] GET /manager HTTP/1.1 200 40 Original Message Follows From: Craig R. McClanahan [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Subject: Re: Accessing Manager app through URLConnection Date: Sat, 26 Jan 2002 08:46:45 -0800 (PST) On Fri, 25 Jan 2002, Christian Cryder wrote: Date: Fri, 25 Jan 2002 23:31:28 -0700 From: Christian Cryder [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: Tomcat-User [EMAIL PROTECTED] Subject: Accessing Manager app through URLConnection Ok, how can I go about accessing the Manager app through a URL connection? Its currently generating a 401 error code, and I know the reason is because of the role stuff...how can I programatically assign a role? Or is there a way I can pass the user/pwd info along with the url poarameters somehow? I'd greatly appreciate some ideas on this... Hi Christian, You are indeed getting a 401 error because the manager webapp is protected by a security constraint using BASIC authentication. If you run it from a browser, you get the usual pop-up dialog. To use automated connections, your client code is going to have to create an Authorization header that encodes the username and password, in the format required by RFC 2617, and include it with the request to bypass the 401 dialog. One source of code you could use to figure out what's necessary is in the HEAD branch of the Tomcat 4 repository -- in class org.apache.catalina.ant.AbstractCatalinaTask. (As the name implies, this is the base class for a set of custom Ant tasks that interact with the Manager webpp, documented on the manager-howto.html page in the nightly builds of Tomcat 4. THanks, Christian Craig McClanahan -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- I am Microsoft of Borg. You will be assimilated. Resistance is futi . . . GENERAL PROTECTION FAULT IN MSBORG32.DLL -- Donald Lee ([EMAIL PROTECTED]) Associate Enterprise Engineer MCSE, Compaq ASE, ACT, A+, TCT, HP _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- I am Microsoft of Borg. You will be assimilated. Resistance is futi . . . GENERAL PROTECTION FAULT IN MSBORG32.DLL -- Donald Lee ([EMAIL PROTECTED]) Associate Enterprise Engineer MCSE, Compaq ASE, ACT, A+, TCT, HP _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Accessing Manager app through URLConnection
On Fri, 25 Jan 2002, Christian Cryder wrote: Date: Fri, 25 Jan 2002 23:31:28 -0700 From: Christian Cryder [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: Tomcat-User [EMAIL PROTECTED] Subject: Accessing Manager app through URLConnection Ok, how can I go about accessing the Manager app through a URL connection? Its currently generating a 401 error code, and I know the reason is because of the role stuff...how can I programatically assign a role? Or is there a way I can pass the user/pwd info along with the url poarameters somehow? I'd greatly appreciate some ideas on this... Hi Christian, You are indeed getting a 401 error because the manager webapp is protected by a security constraint using BASIC authentication. If you run it from a browser, you get the usual pop-up dialog. To use automated connections, your client code is going to have to create an Authorization header that encodes the username and password, in the format required by RFC 2617, and include it with the request to bypass the 401 dialog. One source of code you could use to figure out what's necessary is in the HEAD branch of the Tomcat 4 repository -- in class org.apache.catalina.ant.AbstractCatalinaTask. (As the name implies, this is the base class for a set of custom Ant tasks that interact with the Manager webpp, documented on the manager-howto.html page in the nightly builds of Tomcat 4. THanks, Christian Craig McClanahan -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Accessing Manager app through URLConnection
I setup mine and it authenticates then gives me, FAIL - Unknown command I don't even know where to begin troubleshooting because I don't know what I am supposed to be looking for. Localhost_log file has the following, 2002-01-26 15:13:35 StandardWrapper[/manager:Manager]: Loading container servlet Manager 2002-01-26 15:13:35 Manager: init 2002-01-26 15:13:35 Manager: init: Associated with Deployer 'localhost' localhost_access_log has 192.168.0.1 - - [26/Jan/2002:15:13:33 -0500] GET /manager HTTP/1.1 401 618 192.168.0.1 - dwlee1 [26/Jan/2002:15:13:35 -0500] GET /manager HTTP/1.1 200 40 Original Message Follows From: Craig R. McClanahan [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Subject: Re: Accessing Manager app through URLConnection Date: Sat, 26 Jan 2002 08:46:45 -0800 (PST) On Fri, 25 Jan 2002, Christian Cryder wrote: Date: Fri, 25 Jan 2002 23:31:28 -0700 From: Christian Cryder [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: Tomcat-User [EMAIL PROTECTED] Subject: Accessing Manager app through URLConnection Ok, how can I go about accessing the Manager app through a URL connection? Its currently generating a 401 error code, and I know the reason is because of the role stuff...how can I programatically assign a role? Or is there a way I can pass the user/pwd info along with the url poarameters somehow? I'd greatly appreciate some ideas on this... Hi Christian, You are indeed getting a 401 error because the manager webapp is protected by a security constraint using BASIC authentication. If you run it from a browser, you get the usual pop-up dialog. To use automated connections, your client code is going to have to create an Authorization header that encodes the username and password, in the format required by RFC 2617, and include it with the request to bypass the 401 dialog. One source of code you could use to figure out what's necessary is in the HEAD branch of the Tomcat 4 repository -- in class org.apache.catalina.ant.AbstractCatalinaTask. (As the name implies, this is the base class for a set of custom Ant tasks that interact with the Manager webpp, documented on the manager-howto.html page in the nightly builds of Tomcat 4. THanks, Christian Craig McClanahan -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- I am Microsoft of Borg. You will be assimilated. Resistance is futi . . . GENERAL PROTECTION FAULT IN MSBORG32.DLL -- Donald Lee ([EMAIL PROTECTED]) Associate Enterprise Engineer MCSE, Compaq ASE, ACT, A+, TCT, HP _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Accessing Manager app through URLConnection
Are you giving it a command? e.g. http://your.server/manager/list From the log, it looks like you're not including the command (list in this case) So the manager sees an empty command string and doesn't recognize what it's supposed to do with it. Catch you later, Tom On Sat, 26 Jan 2002, Donald Lee wrote: I setup mine and it authenticates then gives me, FAIL - Unknown command I don't even know where to begin troubleshooting because I don't know what I am supposed to be looking for. Localhost_log file has the following, 2002-01-26 15:13:35 StandardWrapper[/manager:Manager]: Loading container servlet Manager 2002-01-26 15:13:35 Manager: init 2002-01-26 15:13:35 Manager: init: Associated with Deployer 'localhost' localhost_access_log has 192.168.0.1 - - [26/Jan/2002:15:13:33 -0500] GET /manager HTTP/1.1 401 618 192.168.0.1 - dwlee1 [26/Jan/2002:15:13:35 -0500] GET /manager HTTP/1.1 200 40 Original Message Follows From: Craig R. McClanahan [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Subject: Re: Accessing Manager app through URLConnection Date: Sat, 26 Jan 2002 08:46:45 -0800 (PST) On Fri, 25 Jan 2002, Christian Cryder wrote: Date: Fri, 25 Jan 2002 23:31:28 -0700 From: Christian Cryder [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: Tomcat-User [EMAIL PROTECTED] Subject: Accessing Manager app through URLConnection Ok, how can I go about accessing the Manager app through a URL connection? Its currently generating a 401 error code, and I know the reason is because of the role stuff...how can I programatically assign a role? Or is there a way I can pass the user/pwd info along with the url poarameters somehow? I'd greatly appreciate some ideas on this... Hi Christian, You are indeed getting a 401 error because the manager webapp is protected by a security constraint using BASIC authentication. If you run it from a browser, you get the usual pop-up dialog. To use automated connections, your client code is going to have to create an Authorization header that encodes the username and password, in the format required by RFC 2617, and include it with the request to bypass the 401 dialog. One source of code you could use to figure out what's necessary is in the HEAD branch of the Tomcat 4 repository -- in class org.apache.catalina.ant.AbstractCatalinaTask. (As the name implies, this is the base class for a set of custom Ant tasks that interact with the Manager webpp, documented on the manager-howto.html page in the nightly builds of Tomcat 4. THanks, Christian Craig McClanahan -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- I am Microsoft of Borg. You will be assimilated. Resistance is futi . . . GENERAL PROTECTION FAULT IN MSBORG32.DLL -- Donald Lee ([EMAIL PROTECTED]) Associate Enterprise Engineer MCSE, Compaq ASE, ACT, A+, TCT, HP _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Accessing Manager app through URLConnection
I was able to get it to work by following the instructions in Craigs email. I'm attaching a couple of classes that I created to make the whole thing easy. Basically, look at the very bottom of HttpRequester.java, and you'll see an example that looks something like this: HttpRequester hr = new HttpRequester(); String urlStr = http://localhost:8080/manager/list;; hr.setRequest(urlStr, HttpRequester.GET, null, admin, 123123, null); hr.connect(); String inputLine; while ((inputLine = hr.readLine()) != null) { System.out.println(inputLine); } hr.disconnect(); urlStr = http://localhost:8080/manager/reload?path=/examples;; hr.setRequest(urlStr, HttpRequester.GET, null, admin, 123123, null); hr.connect(); String inputLine; while ((inputLine = hr.readLine()) != null) { System.out.println(inputLine); } hr.disconnect(); Both of these work for me. Christian -- Christian Cryder [[EMAIL PROTECTED]] Internet Architect, ATMReports.com Barracuda - http://barracuda.enhydra.org -- What a great time to be a(n employed) Geek -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] he.org]On Behalf Of Donald Lee Sent: Saturday, January 26, 2002 12:58 PM To: [EMAIL PROTECTED] Subject: Re: Accessing Manager app through URLConnection I setup mine and it authenticates then gives me, FAIL - Unknown command I don't even know where to begin troubleshooting because I don't know what I am supposed to be looking for. Localhost_log file has the following, 2002-01-26 15:13:35 StandardWrapper[/manager:Manager]: Loading container servlet Manager 2002-01-26 15:13:35 Manager: init 2002-01-26 15:13:35 Manager: init: Associated with Deployer 'localhost' localhost_access_log has 192.168.0.1 - - [26/Jan/2002:15:13:33 -0500] GET /manager HTTP/1.1 401 618 192.168.0.1 - dwlee1 [26/Jan/2002:15:13:35 -0500] GET /manager HTTP/1.1 200 40 Original Message Follows From: Craig R. McClanahan [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Subject: Re: Accessing Manager app through URLConnection Date: Sat, 26 Jan 2002 08:46:45 -0800 (PST) On Fri, 25 Jan 2002, Christian Cryder wrote: Date: Fri, 25 Jan 2002 23:31:28 -0700 From: Christian Cryder [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: Tomcat-User [EMAIL PROTECTED] Subject: Accessing Manager app through URLConnection Ok, how can I go about accessing the Manager app through a URL connection? Its currently generating a 401 error code, and I know the reason is because of the role stuff...how can I programatically assign a role? Or is there a way I can pass the user/pwd info along with the url poarameters somehow? I'd greatly appreciate some ideas on this... Hi Christian, You are indeed getting a 401 error because the manager webapp is protected by a security constraint using BASIC authentication. If you run it from a browser, you get the usual pop-up dialog. To use automated connections, your client code is going to have to create an Authorization header that encodes the username and password, in the format required by RFC 2617, and include it with the request to bypass the 401 dialog. One source of code you could use to figure out what's necessary is in the HEAD branch of the Tomcat 4 repository -- in class org.apache.catalina.ant.AbstractCatalinaTask. (As the name implies, this is the base class for a set of custom Ant tasks that interact with the Manager webpp, documented on the manager-howto.html page in the nightly builds of Tomcat 4. THanks, Christian Craig McClanahan -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- I am Microsoft of Borg. You will be assimilated. Resistance is futi . . . GENERAL PROTECTION FAULT IN MSBORG32.DLL -- Donald Lee ([EMAIL PROTECTED]) Associate Enterprise Engineer MCSE, Compaq ASE, ACT, A+, TCT, HP _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] HttpRequester.java Description: Binary data HttpOutputWriter.java Description: Binary data HttpConverter.java Description: Binary data -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Accessing Manager app through URLConnection
On Sat, 26 Jan 2002, Donald Lee wrote: Date: Sat, 26 Jan 2002 14:57:56 -0500 From: Donald Lee [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: Accessing Manager app through URLConnection I setup mine and it authenticates then gives me, FAIL - Unknown command Manager is a non-interactive webapp that uses the request URI, plus request parameters, to tell it what to do. Details are in the Tomcat docs included with Tomcat 4, or online at: http://jakarta.apache.org/tomcat/tomcat-4.0-doc/manager-howto.html Craig -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Accessing Manager app through URLConnection
Ok, how can I go about accessing the Manager app through a URL connection? Its currently generating a 401 error code, and I know the reason is because of the role stuff...how can I programatically assign a role? Or is there a way I can pass the user/pwd info along with the url poarameters somehow? I'd greatly appreciate some ideas on this... THanks, Christian -- Christian Cryder [[EMAIL PROTECTED]] Internet Architect, ATMReports.com Barracuda - http://barracuda.enhydra.org -- What a great time to be a(n employed) Geek -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]