HTTP 400 Error when trying to check Tomcat installation

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

HTTP 400 Error when trying to check Tomcat installation

BoyePeter
Hi Folks,

After installing Tomcat and trying to check that it is working OK, I get the HTTP 400 error message.

I am running Windows XP Professional version 2002 SP 3 with all updates applied.
I am running Internet Explorer v 7.0.5730.11.
I have installed Java JDK 1.6.0_11 with the JRE from the same download.
I installed Tomcat 6.x Core from its zip into C:\tomcat.
I set the environment variable JAVA_HOME to point to the JDK 1.6.0_11 directory
(C:\Program Files\Java\jdk1.6.0_11).
The JRE is installed at C:\Program Files\Java\Jre6.
I copied the servlet-api.jar to the JDK directory\jre\lib\ext.
I edited the c:\tomcat\conf\context.xml file to have <Context reloadable=true>.
I edited the c:\tomcat\conf\web.exl file to un-comment the invoker entrie for <servlet> and <servlet_mappings>.
I checked all these by loading the files into IE and the entries were exactly as described in the tomcat documentation.
I created the classes sub directory as c:\tomcat\webapps\ROOT\WEB-INF\classes.

Prior to doing all the above, I had cleaned my system by removing all previous version of Java and tomcat. I also ran Norton 360 Registry cleanup to try to make sure that there were no random or odd registry entries. I hard rebooted the PC and then started the Java and tomcat installations.

When I start up tomcat in the command window, it appears to be successfully loaded reporting that it is using port 8080.

All of the above is standard and in line with the documentation.

BUT

when I try to test the installation using the examples that come with tomcat using the URL http://localhost:8080/ I get the HTTP 400 Bad Request message.

This tells me that IE was able to connect to the web server but the web page could not be found because of a problem with the address.

I have tried loading my servlet into the tomcat classes directory but get the same message.

I have tried adding various tomcat directories to the URL (e.g. examples) but get the same message.

If I stop tomcat and try the URL, I get a different IE error that recognises that there is no web server running. I did this to check whether I had another webserver also running in the background.

The Tomcat documentation on trouble shooting does not mention this error and clearly states that there are only 3 things that can go wrong with the installation:

1.   Port 8080 is being used by another process, in which case Yomcat won't start.
2.   An "Out of Environment Space" error that affects Windows 95, 98 and ME.
3.   The localhost isn't found because one is behind a proxy.

None of these would seem to apply to my situation.

Can anyone, please, provide some insight into how I can overcome this problem.

Ta much & best regards,

Pete
Reply | Threaded
Open this post in threaded view
|

Re: HTTP 400 Error when trying to check Tomcat installation

Kees de Kooter
Did you try to access the manager application at
http://localhost:8080/manager/html?

If that works your tomcat is running fine.

I suggest you read up on building and packaging java web applications.
You can deploy your .war files using this manager application.



On Thu, Dec 11, 2008 at 11:51, BoyePeter
<[hidden email]> wrote:

>
> Hi Folks,
>
> After installing Tomcat and trying to check that it is working OK, I get the
> HTTP 400 error message.
>
> I am running Windows XP Professional version 2002 SP 3 with all updates
> applied.
> I am running Internet Explorer v 7.0.5730.11.
> I have installed Java JDK 1.6.0_11 with the JRE from the same download.
> I installed Tomcat 6.x Core from its zip into C:\tomcat.
> I set the environment variable JAVA_HOME to point to the JDK 1.6.0_11
> directory
> (C:\Program Files\Java\jdk1.6.0_11).
> The JRE is installed at C:\Program Files\Java\Jre6.
> I copied the servlet-api.jar to the JDK directory\jre\lib\ext.
> I edited the c:\tomcat\conf\context.xml file to have <Context
> reloadable=true>.
> I edited the c:\tomcat\conf\web.exl file to un-comment the invoker entrie
> for <servlet> and <servlet_mappings>.
> I checked all these by loading the files into IE and the entries were
> exactly as described in the tomcat documentation.
> I created the classes sub directory as
> c:\tomcat\webapps\ROOT\WEB-INF\classes.
>
> Prior to doing all the above, I had cleaned my system by removing all
> previous version of Java and tomcat. I also ran Norton 360 Registry cleanup
> to try to make sure that there were no random or odd registry entries. I
> hard rebooted the PC and then started the Java and tomcat installations.
>
> When I start up tomcat in the command window, it appears to be successfully
> loaded reporting that it is using port 8080.
>
> All of the above is standard and in line with the documentation.
>
> BUT
>
> when I try to test the installation using the examples that come with tomcat
> using the URL http://localhost:8080/ I get the HTTP 400 Bad Request message.
>
> This tells me that IE was able to connect to the web server but the web page
> could not be found because of a problem with the address.
>
> I have tried loading my servlet into the tomcat classes directory but get
> the same message.
>
> I have tried adding various tomcat directories to the URL (e.g. examples)
> but get the same message.
>
> If I stop tomcat and try the URL, I get a different IE error that recognises
> that there is no web server running. I did this to check whether I had
> another webserver also running in the background.
>
> The Tomcat documentation on trouble shooting does not mention this error and
> clearly states that there are only 3 things that can go wrong with the
> installation:
>
> 1.   Port 8080 is being used by another process, in which case Yomcat won't
> start.
> 2.   An "Out of Environment Space" error that affects Windows 95, 98 and ME.
> 3.   The localhost isn't found because one is behind a proxy.
>
> None of these would seem to apply to my situation.
>
> Can anyone, please, provide some insight into how I can overcome this
> problem.
>
> Ta much & best regards,
>
> Pete
>
> --
> View this message in context: http://www.nabble.com/HTTP-400-Error-when-trying-to-check-Tomcat-installation-tp20953242p20953242.html
> Sent from the Tomcat - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: HTTP 400 Error when trying to check Tomcat installation

BoyePeter
This post was updated on .
Hi,

Thanks for the reply and have just tried your suggestion.

A dialogue box has appeared asking for a user name and password and saying that the server localhost at Tomcat Manager Application requires a username and password. And I haven't set up a user name & password.

This would seem to indicate that Tomcat is working ok but doesn't yet help me to use it.

I cancelled the request with a response saying that I had to edit the /conf/tomcat-users.xml file to add a manager user with password. This I have done but it refuses to recognise the user name and password. I have also found, buried in the documentation, a requirement to create an environment variable called CATLINA_HOME which points to the tomcat directory (c:\tomcat) which I have done but this makes no difference.

Thanks for the suggestion that I should read up on building and packaging web applications and this is what I am doing by using the Java for Dummies book and the Skillsoft online training course. It was the Java for Dummies book that recommended Tomcat so that I could test out my Java servlets and I have followed the instructions in that book and the Tomcat documentation to install Tomcat and to store my initial very simple servlet. But, as my initial post indicated, the instructions on how to use Tomcat and to test that it is working, do not seem to be correct.

Your answer & my test has, I think, indicate that Tomcat has been installed correctly but I still don't know how to use it.

Apologies for being so stupid but is there, anywhere, a simple guide to getting tomcat working? I thought that I had found this in the Java for Dummies book and in the Tomcat 'RUNNING.TXT' file but I am still stuck.

Further help and advice would be much appreciated.

Best Regards,

Pete




Kees de Kooter wrote
Did you try to access the manager application at
http://localhost:8080/manager/html?

If that works your tomcat is running fine.

I suggest you read up on building and packaging java web applications.
You can deploy your .war files using this manager application.



On Thu, Dec 11, 2008 at 11:51, BoyePeter
<pete@brooklyncottage.demon.co.uk> wrote:
>
> Hi Folks,
>
> After installing Tomcat and trying to check that it is working OK, I get the
> HTTP 400 error message.
>
> I am running Windows XP Professional version 2002 SP 3 with all updates
> applied.
> I am running Internet Explorer v 7.0.5730.11.
> I have installed Java JDK 1.6.0_11 with the JRE from the same download.
> I installed Tomcat 6.x Core from its zip into C:\tomcat.
> I set the environment variable JAVA_HOME to point to the JDK 1.6.0_11
> directory
> (C:\Program Files\Java\jdk1.6.0_11).
> The JRE is installed at C:\Program Files\Java\Jre6.
> I copied the servlet-api.jar to the JDK directory\jre\lib\ext.
> I edited the c:\tomcat\conf\context.xml file to have <Context
> reloadable=true>.
> I edited the c:\tomcat\conf\web.exl file to un-comment the invoker entrie
> for <servlet> and <servlet_mappings>.
> I checked all these by loading the files into IE and the entries were
> exactly as described in the tomcat documentation.
> I created the classes sub directory as
> c:\tomcat\webapps\ROOT\WEB-INF\classes.
>
> Prior to doing all the above, I had cleaned my system by removing all
> previous version of Java and tomcat. I also ran Norton 360 Registry cleanup
> to try to make sure that there were no random or odd registry entries. I
> hard rebooted the PC and then started the Java and tomcat installations.
>
> When I start up tomcat in the command window, it appears to be successfully
> loaded reporting that it is using port 8080.
>
> All of the above is standard and in line with the documentation.
>
> BUT
>
> when I try to test the installation using the examples that come with tomcat
> using the URL http://localhost:8080/ I get the HTTP 400 Bad Request message.
>
> This tells me that IE was able to connect to the web server but the web page
> could not be found because of a problem with the address.
>
> I have tried loading my servlet into the tomcat classes directory but get
> the same message.
>
> I have tried adding various tomcat directories to the URL (e.g. examples)
> but get the same message.
>
> If I stop tomcat and try the URL, I get a different IE error that recognises
> that there is no web server running. I did this to check whether I had
> another webserver also running in the background.
>
> The Tomcat documentation on trouble shooting does not mention this error and
> clearly states that there are only 3 things that can go wrong with the
> installation:
>
> 1.   Port 8080 is being used by another process, in which case Yomcat won't
> start.
> 2.   An "Out of Environment Space" error that affects Windows 95, 98 and ME.
> 3.   The localhost isn't found because one is behind a proxy.
>
> None of these would seem to apply to my situation.
>
> Can anyone, please, provide some insight into how I can overcome this
> problem.
>
> Ta much & best regards,
>
> Pete
>
> --
> View this message in context: http://www.nabble.com/HTTP-400-Error-when-trying-to-check-Tomcat-installation-tp20953242p20953242.html
> Sent from the Tomcat - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Reply | Threaded
Open this post in threaded view
|

RE: HTTP 400 Error when trying to check Tomcat installation

BEN HMIDA aymen
Hi Peter,
Where did you placed your application?

-----Message d'origine-----
De : BoyePeter [mailto:[hidden email]]
Envoyé : jeudi 11 décembre 2008 13:50
À : [hidden email]
Objet : Re: HTTP 400 Error when trying to check Tomcat installation


Hi,

Thanks for the reply and have just tried your suggestion.

A dialogue box has appeared asking for a user name and password and saying
that the server localhost at Tomcat Manager Application requires a username
and password.

I did set up a user name and password for Tomcat and so assume that this has
been set by the Tomcat developers at Apache.

This would seem to indicate that Tomcat is working ok but doesn't yet help
me to use it.

Thanks for the suggestion that I should read up on building and packaging
web applications and this is what I am doing by using the Java for Dummies
book and the Skillsoft online training course. It was the Java for Dummies
book that recommended Tomcat so that I could test out my Java servlets and I
have followed the instructions in that book and the Tomcat documentation to
install Tomcat and to store my initial very simple servlet. But, as my
initial post indicated, the instructions on how to use Tomcat and to test
that it is working, do not seem to be correct.

Your answer & my test has, I think, indicate that Tomcat has been installed
correctly but I still don't know how to use it.

Further help and advice would be much appreciated.

Best Regards,

Pete





Kees de Kooter wrote:

>
> Did you try to access the manager application at
> http://localhost:8080/manager/html?
>
> If that works your tomcat is running fine.
>
> I suggest you read up on building and packaging java web applications.
> You can deploy your .war files using this manager application.
>
>
>
> On Thu, Dec 11, 2008 at 11:51, BoyePeter
> <[hidden email]> wrote:
>>
>> Hi Folks,
>>
>> After installing Tomcat and trying to check that it is working OK, I get
>> the
>> HTTP 400 error message.
>>
>> I am running Windows XP Professional version 2002 SP 3 with all updates
>> applied.
>> I am running Internet Explorer v 7.0.5730.11.
>> I have installed Java JDK 1.6.0_11 with the JRE from the same download.
>> I installed Tomcat 6.x Core from its zip into C:\tomcat.
>> I set the environment variable JAVA_HOME to point to the JDK 1.6.0_11
>> directory
>> (C:\Program Files\Java\jdk1.6.0_11).
>> The JRE is installed at C:\Program Files\Java\Jre6.
>> I copied the servlet-api.jar to the JDK directory\jre\lib\ext.
>> I edited the c:\tomcat\conf\context.xml file to have <Context
>> reloadable=true>.
>> I edited the c:\tomcat\conf\web.exl file to un-comment the invoker entrie
>> for <servlet> and <servlet_mappings>.
>> I checked all these by loading the files into IE and the entries were
>> exactly as described in the tomcat documentation.
>> I created the classes sub directory as
>> c:\tomcat\webapps\ROOT\WEB-INF\classes.
>>
>> Prior to doing all the above, I had cleaned my system by removing all
>> previous version of Java and tomcat. I also ran Norton 360 Registry
>> cleanup
>> to try to make sure that there were no random or odd registry entries. I
>> hard rebooted the PC and then started the Java and tomcat installations.
>>
>> When I start up tomcat in the command window, it appears to be
>> successfully
>> loaded reporting that it is using port 8080.
>>
>> All of the above is standard and in line with the documentation.
>>
>> BUT
>>
>> when I try to test the installation using the examples that come with
>> tomcat
>> using the URL http://localhost:8080/ I get the HTTP 400 Bad Request
>> message.
>>
>> This tells me that IE was able to connect to the web server but the web
>> page
>> could not be found because of a problem with the address.
>>
>> I have tried loading my servlet into the tomcat classes directory but get
>> the same message.
>>
>> I have tried adding various tomcat directories to the URL (e.g. examples)
>> but get the same message.
>>
>> If I stop tomcat and try the URL, I get a different IE error that
>> recognises
>> that there is no web server running. I did this to check whether I had
>> another webserver also running in the background.
>>
>> The Tomcat documentation on trouble shooting does not mention this error
>> and
>> clearly states that there are only 3 things that can go wrong with the
>> installation:
>>
>> 1.   Port 8080 is being used by another process, in which case Yomcat
>> won't
>> start.
>> 2.   An "Out of Environment Space" error that affects Windows 95, 98 and
>> ME.
>> 3.   The localhost isn't found because one is behind a proxy.
>>
>> None of these would seem to apply to my situation.
>>
>> Can anyone, please, provide some insight into how I can overcome this
>> problem.
>>
>> Ta much & best regards,
>>
>> Pete
>>
>> --
>> View this message in context:
>> http://www.nabble.com/HTTP-400-Error-when-trying-to-check-Tomcat-installation-tp20953242p20953242.html
>> Sent from the Tomcat - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
>

--
View this message in context: http://www.nabble.com/HTTP-400-Error-when-trying-to-check-Tomcat-installation-tp20953242p20954817.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]






---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: HTTP 400 Error when trying to check Tomcat installation

André Warnier (tomcat)
In reply to this post by BoyePeter
BoyePeter wrote:

> Hi,
>
> Thanks for the reply and have just tried your suggestion.
>
> A dialogue box has appeared asking for a user name and password and saying
> that the server localhost at Tomcat Manager Application requires a username
> and password.
>
> I did set up a user name and password for Tomcat and so assume that this has
> been set by the Tomcat developers at Apache.
>
I believe that you are confusing two things : the username and password
under which Tomcat itself runs, and the username/password that Tomcat
uses to protect access to the Manager application.
For this second one, look in the (tomcat-dir)/conf/tomcat-users.xml file.
If they are not there yet, add the following lines :

<role rolename="manager"/>
<user username="theBossHere" password="qwerty" roles="manager"/>

then restart Tomcat.
Close and re-open the browser, call the Manager page again, and use the
above userid/password to login.



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: HTTP 400 Error when trying to check Tomcat installation

BoyePeter
Ta very much for your response. I very stupidly did not think to stop and restart Tomcat.

I have now got into the Manager application. I now have to read up and understand how to use it.

My very best regards,

Pete



awarnier wrote
BoyePeter wrote:
> Hi,
>
> Thanks for the reply and have just tried your suggestion.
>
> A dialogue box has appeared asking for a user name and password and saying
> that the server localhost at Tomcat Manager Application requires a username
> and password.
>
> I did set up a user name and password for Tomcat and so assume that this has
> been set by the Tomcat developers at Apache.
>
I believe that you are confusing two things : the username and password
under which Tomcat itself runs, and the username/password that Tomcat
uses to protect access to the Manager application.
For this second one, look in the (tomcat-dir)/conf/tomcat-users.xml file.
If they are not there yet, add the following lines :

<role rolename="manager"/>
<user username="theBossHere" password="qwerty" roles="manager"/>

then restart Tomcat.
Close and re-open the browser, call the Manager page again, and use the
above userid/password to login.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Reply | Threaded
Open this post in threaded view
|

Re: HTTP 400 Error when trying to check Tomcat installation

Markus Schönhaber-10
In reply to this post by BoyePeter
BoyePeter:

> I am running Windows XP Professional version 2002 SP 3 with all updates
> applied.
> I am running Internet Explorer v 7.0.5730.11.
> I have installed Java JDK 1.6.0_11 with the JRE from the same download.

Care to mention the Tomcat version you're using?

> I copied the servlet-api.jar to the JDK directory\jre\lib\ext.

Why?
Don't do that.

> I edited the c:\tomcat\conf\context.xml file to have <Context
> reloadable=true>.
> I edited the c:\tomcat\conf\web.exl file to un-comment the invoker entrie
> for <servlet> and <servlet_mappings>.

Why?
The Invoker Servlet is evil. It may be OK for a quick test but is a big
no-no for any installation reachable over the net.
I suggest you get used to create a webapp with a real deployment
descriptor instead.

> when I try to test the installation using the examples that come with tomcat
> using the URL http://localhost:8080/ I get the HTTP 400 Bad Request message.
>
> This tells me that IE was able to connect to the web server but the web page
> could not be found because of a problem with the address.

What do Tomcat's log messages show?
If you've not already done so, turn off IE's "friendly" error messages.

Regards
  mks


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: HTTP 400 Error when trying to check Tomcat installation

BoyePeter
In reply to this post by BEN HMIDA aymen
Hi Ben,

Thanks for the response. I put the compiled class into
                   c:\tomcat\webapps\ROOT\WEB-INF\classes
It was a very simple Hello World servelt from the Java for Dummies book (page 647) and on page 649 it says to move the compiled class file to that directory.

Although I now have the Manager application working and have gained access to it, I am even more puzzled that I cannot access the examples provided by Tomcat in the way that they suggest.

The fact that I can get into the Manager application by using the URL "http::/localhost:8080/manager/html" suggests that my Tomcat installation is all working correctly but the recommended Tomcat URL "http://localhost:8080/" still gives the HTTP 400 error.

Ta much and best regards,

Pete



BEN HMIDA aymen wrote
Hi Peter,
Where did you placed your application?

-----Message d'origine-----
De : BoyePeter [mailto:pete@brooklyncottage.demon.co.uk]
Envoyé : jeudi 11 décembre 2008 13:50
À : users@tomcat.apache.org
Objet : Re: HTTP 400 Error when trying to check Tomcat installation


Hi,

Thanks for the reply and have just tried your suggestion.

A dialogue box has appeared asking for a user name and password and saying
that the server localhost at Tomcat Manager Application requires a username
and password.

I did set up a user name and password for Tomcat and so assume that this has
been set by the Tomcat developers at Apache.

This would seem to indicate that Tomcat is working ok but doesn't yet help
me to use it.

Thanks for the suggestion that I should read up on building and packaging
web applications and this is what I am doing by using the Java for Dummies
book and the Skillsoft online training course. It was the Java for Dummies
book that recommended Tomcat so that I could test out my Java servlets and I
have followed the instructions in that book and the Tomcat documentation to
install Tomcat and to store my initial very simple servlet. But, as my
initial post indicated, the instructions on how to use Tomcat and to test
that it is working, do not seem to be correct.

Your answer & my test has, I think, indicate that Tomcat has been installed
correctly but I still don't know how to use it.

Further help and advice would be much appreciated.

Best Regards,

Pete





Kees de Kooter wrote:
>
> Did you try to access the manager application at
> http://localhost:8080/manager/html?
>
> If that works your tomcat is running fine.
>
> I suggest you read up on building and packaging java web applications.
> You can deploy your .war files using this manager application.
>
>
>
> On Thu, Dec 11, 2008 at 11:51, BoyePeter
> <pete@brooklyncottage.demon.co.uk> wrote:
>>
>> Hi Folks,
>>
>> After installing Tomcat and trying to check that it is working OK, I get
>> the
>> HTTP 400 error message.
>>
>> I am running Windows XP Professional version 2002 SP 3 with all updates
>> applied.
>> I am running Internet Explorer v 7.0.5730.11.
>> I have installed Java JDK 1.6.0_11 with the JRE from the same download.
>> I installed Tomcat 6.x Core from its zip into C:\tomcat.
>> I set the environment variable JAVA_HOME to point to the JDK 1.6.0_11
>> directory
>> (C:\Program Files\Java\jdk1.6.0_11).
>> The JRE is installed at C:\Program Files\Java\Jre6.
>> I copied the servlet-api.jar to the JDK directory\jre\lib\ext.
>> I edited the c:\tomcat\conf\context.xml file to have <Context
>> reloadable=true>.
>> I edited the c:\tomcat\conf\web.exl file to un-comment the invoker entrie
>> for <servlet> and <servlet_mappings>.
>> I checked all these by loading the files into IE and the entries were
>> exactly as described in the tomcat documentation.
>> I created the classes sub directory as
>> c:\tomcat\webapps\ROOT\WEB-INF\classes.
>>
>> Prior to doing all the above, I had cleaned my system by removing all
>> previous version of Java and tomcat. I also ran Norton 360 Registry
>> cleanup
>> to try to make sure that there were no random or odd registry entries. I
>> hard rebooted the PC and then started the Java and tomcat installations.
>>
>> When I start up tomcat in the command window, it appears to be
>> successfully
>> loaded reporting that it is using port 8080.
>>
>> All of the above is standard and in line with the documentation.
>>
>> BUT
>>
>> when I try to test the installation using the examples that come with
>> tomcat
>> using the URL http://localhost:8080/ I get the HTTP 400 Bad Request
>> message.
>>
>> This tells me that IE was able to connect to the web server but the web
>> page
>> could not be found because of a problem with the address.
>>
>> I have tried loading my servlet into the tomcat classes directory but get
>> the same message.
>>
>> I have tried adding various tomcat directories to the URL (e.g. examples)
>> but get the same message.
>>
>> If I stop tomcat and try the URL, I get a different IE error that
>> recognises
>> that there is no web server running. I did this to check whether I had
>> another webserver also running in the background.
>>
>> The Tomcat documentation on trouble shooting does not mention this error
>> and
>> clearly states that there are only 3 things that can go wrong with the
>> installation:
>>
>> 1.   Port 8080 is being used by another process, in which case Yomcat
>> won't
>> start.
>> 2.   An "Out of Environment Space" error that affects Windows 95, 98 and
>> ME.
>> 3.   The localhost isn't found because one is behind a proxy.
>>
>> None of these would seem to apply to my situation.
>>
>> Can anyone, please, provide some insight into how I can overcome this
>> problem.
>>
>> Ta much & best regards,
>>
>> Pete
>>
>> --
>> View this message in context:
>> http://www.nabble.com/HTTP-400-Error-when-trying-to-check-Tomcat-installation-tp20953242p20953242.html
>> Sent from the Tomcat - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>

--
View this message in context: http://www.nabble.com/HTTP-400-Error-when-trying-to-check-Tomcat-installation-tp20953242p20954817.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org






---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Reply | Threaded
Open this post in threaded view
|

Re: HTTP 400 Error when trying to check Tomcat installation

BoyePeter
This post was updated on .
In reply to this post by Markus Schönhaber-10
Hi mks,
I have installed Tomcat version 6.
I copied the servlet-api.jar to the JDK directory because, according to Java for Dummies, it is needed to compile my servlets. If it is not there, Eclipse reports errors when trying to import javax.servlet.* and when I try to use "extends HttpServlet".

Perhaps I should have mentioned that I am trying to learn how to program in Java and I am trying to set up the test environment for this. I am not trying to set up a Web Server for the internet. The books that I read and the Tomcat documentation said to change the invoker stuff.

I had a look at the Tomcat logs but, being the novice that I am, they didn't mean anything to me.

Not sure how to turn off IE's friendly messages nor what would be the result if I did so.

Pete

PS.
Have just checked the Tomcat logs again and found the following which may have some bearing on this problem:

   SEVERE: Error deploying web application directory ROOT
   java.lang.SecurityException: Servlet of class org.apache.catalina.servlets.InvokerServlet is privileged and cannot be loaded by this web application

This entry was in the catalina.2008.12.11.log

My guess is that this is what is preventing access to the examples and my simple servlet.




Markus Schönhaber-10 wrote
BoyePeter:

> I am running Windows XP Professional version 2002 SP 3 with all updates
> applied.
> I am running Internet Explorer v 7.0.5730.11.
> I have installed Java JDK 1.6.0_11 with the JRE from the same download.

Care to mention the Tomcat version you're using?

> I copied the servlet-api.jar to the JDK directory\jre\lib\ext.

Why?
Don't do that.

> I edited the c:\tomcat\conf\context.xml file to have <Context
> reloadable=true>.
> I edited the c:\tomcat\conf\web.exl file to un-comment the invoker entrie
> for <servlet> and <servlet_mappings>.

Why?
The Invoker Servlet is evil. It may be OK for a quick test but is a big
no-no for any installation reachable over the net.
I suggest you get used to create a webapp with a real deployment
descriptor instead.

> when I try to test the installation using the examples that come with tomcat
> using the URL http://localhost:8080/ I get the HTTP 400 Bad Request message.
>
> This tells me that IE was able to connect to the web server but the web page
> could not be found because of a problem with the address.

What do Tomcat's log messages show?
If you've not already done so, turn off IE's "friendly" error messages.

Regards
  mks


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Reply | Threaded
Open this post in threaded view
|

Re: HTTP 400 Error when trying to check Tomcat installation

André Warnier (tomcat)
BoyePeter wrote:
[...]
>
> Not sure how to turn off IE's friendly messages nor what would be the result
> if I did so.
>
At least I can tell you something about that.
Just search in Google for "ie friendly error messages", and about the
first 30 results will tell you all you need to know about it.

The problem is that some of the error pages you see, are produced by IE
and not by Tomcat.  So it is difficult for people here to help you,
because they do not know what you are looking at.

Alternative (recommended) : install Firefox on your PC and use this to
learn.  It also has a couple of nice plugins/add-ons that will help you
a lot in learning about HTTP, HTML, XML etc..


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: HTTP 400 Error when trying to check Tomcat installation

BoyePeter
Did as you suggested but then all I get is a black web page. I right clicked to look at the source and this was what was shown:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1252"></HEAD>
<BODY></BODY>
<META content=WBVNTMRYKT name=SKYPE_FRAMEID>
<META content=WBVNTMRYKT name=SKYPE_FRAMEID></HTML>

Not sure if you picked up the addition to my previous post. I checked the logs and found the following messages in the catalina.2008.12.11.log:

SEVERE: Error deploying web application directory ROOT
java.lang.SecurityException: Servlet of class org.apache.catalina.servlets.InvokerServlet is privileged and cannot be loaded by this web application

I think this may be the root cause of the problem but I have no idea how to fix it.



awarnier wrote
BoyePeter wrote:
[...]
>
Just search in Google for "ie friendly error messages", and about the
first 30 results will tell you all you need to know about it.
Reply | Threaded
Open this post in threaded view
|

Re: HTTP 400 Error when trying to check Tomcat installation

Markus Schönhaber-10
In reply to this post by BoyePeter
BoyePeter:

> I have installed Tomcat version 6.

Although I doubt it's of any importance wrt your problem, for the
future: Tomcat's version numbers consist of three numbers separated by
dots - like 6.0.18.

> I copied the servlet-api.jar to the JDK directory because, according to Java
> for Dummies, it is needed to compile my servlets.

If the book really says so, I'd think that now was a good time to throw
it away.

> If it is not there,
> Eclipse reports errors when trying to import javax.servlet.* and when I try
> to use "extends HttpServlet".

If you're already using Eclipse, why don't you use it's Web Tools
Platform which takes care of setting the classpath when building, of
deploying etc. when developing webapps?

> Perhaps I should have mentioned that I am trying to learn how to program in
> Java and I am trying to set up the test environment for this.

If you're starting to program in Java, programming servlets is not the
starting point to the most easy route IMO.

> I am not
> trying to set up a Web Server for the internet. The books that I read and
> the Tomcat documentation said to change the invoker stuff.

Then you're most likely reading the wrong books.
But I'd be very interested to know where the official Tomcat
documentation says that one should enable the Invoker servlet.

> I had a look at the Tomcat logs but, being the novice that I am, they didn't
> mean anything to me.

You could post the relevant snippet (the timestamps should give a hint
what might be relevant) here. Even if it means nothing to you, it might
mean a lot to someone trying to help you.

> Not sure how to turn off IE's friendly messages nor what would be the result
> if I did so.

I'm no Windows user myself, so I don't know exactly. But IIRC it's
buried somewhere in the advanced internet options.
Without this option disabled, IE thinks it knows best what to show the
user (and especially: what not) when an error occurs and suppresses the
error message sent by the server that might actually contain information
about what went wrong. OTOH it might not - but with IE's "friendly"
error messages you'll never know.

Regards
  mks

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: HTTP 400 Error when trying to check Tomcat installation

Caldarale, Charles R
In reply to this post by BoyePeter
> From: BoyePeter [mailto:[hidden email]]
> Subject: Re: HTTP 400 Error when trying to check Tomcat installation
>
> SEVERE: Error deploying web application directory ROOT
> java.lang.SecurityException: Servlet of class
> org.apache.catalina.servlets.InvokerServlet is privileged and
> cannot be
> loaded by this web application
>
> I think this may be the root cause of the problem but I have
> no idea how to fix it.

As Markus suggested, throw away the book you're reading.  It is obviously full of errors and extremely dangerous.  The error message you're getting is because you uncommented the invoker servlet; that exists purely for compatibility with older levels and people too lazy to write webapps properly.

You need to go back to the standard Tomcat installation, and don't edit anything in conf other than the conf/tomcat-users.xml file.  You should not be placing your servlet in the ROOT directory; instead, create another directory under webapps that will be the name of your particular application (e.g., "test" or "sample").  Under that directory, you will need to create WEB-INF and WEB-INF/classes; your servlet should be placed in WEB-INF/classes.  Under WEB-INF, you'll need a web.xml file containing a <servlet> declaration for your class.  Look in the examples that come with Tomcat to see what that looks like.  (Alternatively, just use Eclipse Web Tools as Markus also said to do all the dirty work for you.)

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]