You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Brendan Martens <br...@crosscomm.net> on 2008/09/10 23:41:56 UTC

html entities and urls with spaces

Hello,

I am having some issues with tomcat not displaying pages or files with  
spaces in them, it simply 404s. Something like this:

pdf file on filesystem.pdf

being accessed at:

http://server/pdf%20file%20on%20filesystem.pdf

fails to display.

I am migrating this site from an older RHEL server where it works  
fine. I am migrating to a Debian server with up to date Debian  
packages of apache2, tomcat5, and java6.

I am using tomcat5 because the webapp had some odd html entity issues  
with tomcat5.5 and tomcat6 that I was not able to resolve, moving to  
tomcat5 fixed the issues with entities in the page content itself. I  
am not certain that the page content html entity issues and the urls  
with spaces issues are related, but it seems like they may be?

To check that this was a tomcat (and not an apache issue, as I am  
JkMounting the site to tomcat ) issue I tested accessing items with  
spaces with apache and that worked fine.

Any one have any thoughts on this?

Brendan Martens

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


Re: html entities and urls with spaces

Posted by Brendan Martens <br...@crosscomm.net>.
> does "fails to display." mean 404 or do you get a file to download and
> fail to render it on the client side(browser)?

Means it 404s.

> for the 404 make sure the files are located there where tomcat/your
> app looks for them

They are indeed where it's looking for them. When I change the name of  
the file from "file with spaces.html" to "file%20with%20spaces.html"  
the browser is able to find it just fine.



Brendan Martens
Server Administrator
CrossComm, Inc.
919.667.9432 ofc
919.688.7686 fax
www.crosscomm.net

On Sep 10, 2008, at 9:21 PM, Yassine wrote:

> Hi
>
> does "fails to display." mean 404 or do you get a file to download and
> fail to render it on the client side(browser)?
>
> for the 404 make sure the files are located there where tomcat/your
> app looks for them
> for the second case check the http header sent with the pdf file.
>
> Cheers
> Yassine
>
> On Wed, Sep 10, 2008 at 11:41 PM, Brendan Martens
> <br...@crosscomm.net> wrote:
>> Hello,
>>
>> I am having some issues with tomcat not displaying pages or files  
>> with
>> spaces in them, it simply 404s. Something like this:
>>
>> pdf file on filesystem.pdf
>>
>> being accessed at:
>>
>> http://server/pdf%20file%20on%20filesystem.pdf
>>
>> fails to display.
>>
>> I am migrating this site from an older RHEL server where it works  
>> fine. I am
>> migrating to a Debian server with up to date Debian packages of  
>> apache2,
>> tomcat5, and java6.
>>
>> I am using tomcat5 because the webapp had some odd html entity  
>> issues with
>> tomcat5.5 and tomcat6 that I was not able to resolve, moving to  
>> tomcat5
>> fixed the issues with entities in the page content itself. I am not  
>> certain
>> that the page content html entity issues and the urls with spaces  
>> issues are
>> related, but it seems like they may be?
>>
>> To check that this was a tomcat (and not an apache issue, as I am  
>> JkMounting
>> the site to tomcat ) issue I tested accessing items with spaces  
>> with apache
>> and that worked fine.
>>
>> Any one have any thoughts on this?
>>
>> Brendan Martens
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>


Re: html entities and urls with spaces

Posted by Yassine <ya...@gmail.com>.
Hi

does "fails to display." mean 404 or do you get a file to download and
fail to render it on the client side(browser)?

for the 404 make sure the files are located there where tomcat/your
app looks for them
for the second case check the http header sent with the pdf file.

Cheers
Yassine

On Wed, Sep 10, 2008 at 11:41 PM, Brendan Martens
<br...@crosscomm.net> wrote:
> Hello,
>
> I am having some issues with tomcat not displaying pages or files with
> spaces in them, it simply 404s. Something like this:
>
> pdf file on filesystem.pdf
>
> being accessed at:
>
> http://server/pdf%20file%20on%20filesystem.pdf
>
> fails to display.
>
> I am migrating this site from an older RHEL server where it works fine. I am
> migrating to a Debian server with up to date Debian packages of apache2,
> tomcat5, and java6.
>
> I am using tomcat5 because the webapp had some odd html entity issues with
> tomcat5.5 and tomcat6 that I was not able to resolve, moving to tomcat5
> fixed the issues with entities in the page content itself. I am not certain
> that the page content html entity issues and the urls with spaces issues are
> related, but it seems like they may be?
>
> To check that this was a tomcat (and not an apache issue, as I am JkMounting
> the site to tomcat ) issue I tested accessing items with spaces with apache
> and that worked fine.
>
> Any one have any thoughts on this?
>
> Brendan Martens
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

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


Re: html entities and urls with spaces

Posted by André Warnier <aw...@ice-sa.com>.
Brendan Martens wrote:
[...]
>>>
>>> I am migrating this site from an older RHEL server where it works fine.
>>> I am migrating to a Debian server with up to date Debian packages of
>>> apache2, tomcat5, and java6.
>>
For all their perceived faults, it is unlikely that Debian packagers 
would package mutually incompatible versions of Apache, Tomcat, Java, 
and mod_jk.  They may do funny things with the locations of files, but 
incompatible versions is something I have not seen often yet.
As to "up-to-date", that is another question.  The versions of Apache, 
Tomcat, Java and mod_jk might not be the latest ones available on the 
respective "original" sites for all these packages. (*)
So it might help if you tracked down which exact version of each is 
really installed on your system, and listed them.
Like :
uname -a
java -version
for the version of Apache and mod_jk, look at the first line that Apache 
writes to it error.log file when it starts.
For the precise version of Tomcat ?...


This being said, for Apache/mod_jk/Tomcat, the respective probabilities 
of configuration errors versus incompatible versions would be something 
like 100 to 1.


(*) That is because it takes time and work to prepare packages, and make 
sure that the individual components that are supposed to work together 
really do. And by the time that is done, it might well be that a new 
original version of one of the individual packages has come to be available.

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


Re: Tomcat clustering: Don't see Cluster MBean

Posted by Landry Stephane Zeng Eyindanga <LA...@BULL.NET>.
Mark Thomas a écrit :
> Landry Stephane Zeng Eyindanga wrote:
>   
>> Hi all,
>> I am trying to use a tomcat6 cluster. I've just set my configuration
>> (with two tomcat nodes) just as indicated in the tomcat clustering guide
>> (http://tomcat.apache.org/tomcat-6.0-doc/cluster-howto.html).
>> Unfortunately, I see all MBeans that I should see, but the Cluster MBean
>> (|type=Cluster,host=${HOST}|).
>> I'm in a urge, I'm working on an application that needs this MBean, or a
>> cluster dedicated one.
>> Is it a bug ? what should I do ?
>>     
>
> Please do not hijack threads.
>
>   
sorry
> Mark
>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>
>
>   



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


Re: Tomcat clustering: Don't see Cluster MBean

Posted by Mark Thomas <ma...@apache.org>.
Landry Stephane Zeng Eyindanga wrote:
> Hi all,
> I am trying to use a tomcat6 cluster. I've just set my configuration
> (with two tomcat nodes) just as indicated in the tomcat clustering guide
> (http://tomcat.apache.org/tomcat-6.0-doc/cluster-howto.html).
> Unfortunately, I see all MBeans that I should see, but the Cluster MBean
> (|type=Cluster,host=${HOST}|).
> I'm in a urge, I'm working on an application that needs this MBean, or a
> cluster dedicated one.
> Is it a bug ? what should I do ?

Please do not hijack threads.

Mark



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


Re: Tomcat clustering: Don't see Cluster MBean

Posted by André Warnier <aw...@ice-sa.com>.
Hi Landry Stephane.

"Hijacking a thread" usually means hitting the "reply" button on a forum 
message, leave the subject as it was, and then ask a totally unrelated 
question in the message.
You should not do that, because it is confusing for people who try to 
help the original poster of the original question, and because it also 
confuses users who try to follow a conversation.

What you did here however was not really hijacking a thread, since you 
also changed the subject of the messsage.
But you left the original message in, and just asked your new unrelated 
question below.
I don't know if there is an official jargon term for that.
But it is totally confusing also, and your chances of getting an answer 
are severely diminished.

So why do you not start a totally new message, with the correct subject 
and content, and let's see from there, yes ?



Landry Stephane Zeng Eyindanga wrote:
> Mark Thomas a écrit :
>> Brendan Martens wrote:
>>  
>>> Hmmm, here are my jk settings:
>>>
>>> JKWorkersFile    /etc/libapache2-mod-jk/workers.properties
>>> JkLogFile    /var/log/apache2/mod_jk.log
>>> JkLogLevel    info
>>> JkShmFile    /var/log/apache2/mod_jk.shm
>>> JkOptions    +ForwardURICompatUnparsed
>>>     
>>
>> That value of JkOptions should be OK.
>>
>>  
>>> The JK connector is the one from the mod_jk debian package. Could that
>>> be an issue if it was not compiled for the write version of tomcat? I'm
>>> not really sure how the jk connector builds work.
>>>     
>>
>> If the debian docs don't tell you what version they are using then your
>> guess is as good as mine.
>>
>> >From what you say this is easy to repeat. Have you tried accessing 
>> the same
>> file directly on Tomcat? Another option is to enable access logging in
>> httpd and Tomcat and turn up the mod_jk log level to debug, run the test
>> and analyse the results. It should be obvious quite quickly where it id
>> going wrong.
>>
>> Mark
>>
>>
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>>
>>
>>   
> Hi all,
> I am trying to use a tomcat6 cluster. I've just set my configuration 
> (with two tomcat nodes) just as indicated in the tomcat clustering guide 
> (http://tomcat.apache.org/tomcat-6.0-doc/cluster-howto.html).
> Unfortunately, I see all MBeans that I should see, but the Cluster MBean 
> (|type=Cluster,host=${HOST}|).
> I'm in a urge, I'm working on an application that needs this MBean, or a 
> cluster dedicated one.
> Is it a bug ? what should I do ?
> 
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 


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


Tomcat clustering: Don't see Cluster MBean

Posted by Landry Stephane Zeng Eyindanga <LA...@BULL.NET>.
Mark Thomas a écrit :
> Brendan Martens wrote:
>   
>> Hmmm, here are my jk settings:
>>
>> JKWorkersFile    /etc/libapache2-mod-jk/workers.properties
>> JkLogFile    /var/log/apache2/mod_jk.log
>> JkLogLevel    info
>> JkShmFile    /var/log/apache2/mod_jk.shm
>> JkOptions    +ForwardURICompatUnparsed
>>     
>
> That value of JkOptions should be OK.
>
>   
>> The JK connector is the one from the mod_jk debian package. Could that
>> be an issue if it was not compiled for the write version of tomcat? I'm
>> not really sure how the jk connector builds work.
>>     
>
> If the debian docs don't tell you what version they are using then your
> guess is as good as mine.
>
> >From what you say this is easy to repeat. Have you tried accessing the same
> file directly on Tomcat? Another option is to enable access logging in
> httpd and Tomcat and turn up the mod_jk log level to debug, run the test
> and analyse the results. It should be obvious quite quickly where it id
> going wrong.
>
> Mark
>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>
>
>   
Hi all,
I am trying to use a tomcat6 cluster. I've just set my configuration 
(with two tomcat nodes) just as indicated in the tomcat clustering guide 
(http://tomcat.apache.org/tomcat-6.0-doc/cluster-howto.html).
Unfortunately, I see all MBeans that I should see, but the Cluster MBean 
(|type=Cluster,host=${HOST}|).
I'm in a urge, I'm working on an application that needs this MBean, or a 
cluster dedicated one.
Is it a bug ? what should I do ?



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


Re: html entities and urls with spaces

Posted by Mark Thomas <ma...@apache.org>.
Brendan Martens wrote:
> Hmmm, here are my jk settings:
> 
> JKWorkersFile    /etc/libapache2-mod-jk/workers.properties
> JkLogFile    /var/log/apache2/mod_jk.log
> JkLogLevel    info
> JkShmFile    /var/log/apache2/mod_jk.shm
> JkOptions    +ForwardURICompatUnparsed

That value of JkOptions should be OK.

> The JK connector is the one from the mod_jk debian package. Could that
> be an issue if it was not compiled for the write version of tomcat? I'm
> not really sure how the jk connector builds work.

If the debian docs don't tell you what version they are using then your
guess is as good as mine.

>From what you say this is easy to repeat. Have you tried accessing the same
file directly on Tomcat? Another option is to enable access logging in
httpd and Tomcat and turn up the mod_jk log level to debug, run the test
and analyse the results. It should be obvious quite quickly where it id
going wrong.

Mark



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


Re: html entities and urls with spaces

Posted by Brendan Martens <br...@crosscomm.net>.
Hmmm, here are my jk settings:

JKWorkersFile	/etc/libapache2-mod-jk/workers.properties
JkLogFile	/var/log/apache2/mod_jk.log
JkLogLevel	info
JkShmFile	/var/log/apache2/mod_jk.shm
JkOptions	+ForwardURICompatUnparsed

The JK connector is the one from the mod_jk debian package. Could that  
be an issue if it was not compiled for the write version of tomcat?  
I'm not really sure how the jk connector builds work.

Brendan Martens
Server Administrator
CrossComm, Inc.
919.667.9432 ofc
919.688.7686 fax
www.crosscomm.net

On Sep 11, 2008, at 4:38 PM, Mark Thomas wrote:

> Brendan Martens wrote:
>> Hello,
>>
>> I am having some issues with tomcat not displaying pages or files  
>> with
>> spaces in them, it simply 404s. Something like this:
>>
>> pdf file on filesystem.pdf
>>
>> being accessed at:
>>
>> http://server/pdf%20file%20on%20filesystem.pdf
>>
>> fails to display.
>>
>> I am migrating this site from an older RHEL server where it works  
>> fine.
>> I am migrating to a Debian server with up to date Debian packages of
>> apache2, tomcat5, and java6.
>
> Wrong setting for JkOptions?
>
> Mark
>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>


Re: html entities and urls with spaces

Posted by Mark Thomas <ma...@apache.org>.
Brendan Martens wrote:
> Hello,
> 
> I am having some issues with tomcat not displaying pages or files with
> spaces in them, it simply 404s. Something like this:
> 
> pdf file on filesystem.pdf
> 
> being accessed at:
> 
> http://server/pdf%20file%20on%20filesystem.pdf
> 
> fails to display.
> 
> I am migrating this site from an older RHEL server where it works fine.
> I am migrating to a Debian server with up to date Debian packages of
> apache2, tomcat5, and java6.

Wrong setting for JkOptions?

Mark



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


[OT] Filesystems allowing spaces (was RE: html entities and urls with spaces)

Posted by Peter Crowther <Pe...@melandra.com>.
> From: André Warnier [mailto:aw@ice-sa.com]
> Whichever bright developer invented the first filesystem
> allowing spaces in filenames should be found and shot.

You'd have to go a long way back - UNIX has had them at least since I started using it*.  Besides, users love 'em - it's just us command-line types who have problems.

                - Peter

* I'm a latecomer - mid-1980s

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


Re: html entities and urls with spaces

Posted by André Warnier <aw...@ice-sa.com>.
Brendan Martens wrote:
>> most file systems cant read spaces in a filename so you should put in 
>> _ where you see spaces
> 
> Hmmm, not sure this is the issue, both filesystems can read and write 
> files with spaces.
> 
Whichever bright developer invented the first filesystem allowing spaces 
in filenames should be found and shot.

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


RE: html entities and urls with spaces

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Brendan Martens [mailto:brendan.martens@crosscomm.net]
> Subject: Re: html entities and urls with spaces
>
> Hmmm, not sure this is the issue, both filesystems can read and write
> files with spaces.

It's certainly not the issue - spaces in file names work fine on my Windows box with Tomcat.

> I really need to figure out a way to not rename all the files...

Your original message indicated you might be front-ending Tomcat with httpd; what happens if you send the URL with the %20 encoding direct to Tomcat?  I have no trouble doing so on my systems (but I don't have a Linux box available at the moment).

Try turning on Tomcat's RequestDumperValve in server.xml; perhaps your front end is decoding the URL, so all Tomcat sees is the part up to the first space.

 - 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 start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: html entities and urls with spaces

Posted by Brendan Martens <br...@crosscomm.net>.
> most file systems cant read spaces in a filename so you should put  
> in _ where you see spaces

Hmmm, not sure this is the issue, both filesystems can read and write  
files with spaces.



> should be renamed to
> $CATALINA_HOME/webapps/pdfApp/pdf_file_on_filesystem.pdf

I really need to figure out a way to not rename all the files... If I  
could I would not allow the spaces of course, but it's already done. :  
( So now I need to figure out how to make this work on the new server  
as well.


Brendan Martens

On Sep 10, 2008, at 8:32 PM, Martin Gainty wrote:

> Brendan
>
> most file systems cant read spaces in a filename so you should put  
> in _ where you see spaces
> e.g.
> http://localhost:8080/pdfApp/pdf%20file%20on%20filesystem.pdf
> should be renamed to
> $CATALINA_HOME/webapps/pdfApp/pdf_file_on_filesystem.pdf
>
> HTH
> Martin
> ______________________________________________
> Disclaimer and confidentiality note
> Everything in this e-mail and any attachments relates to the  
> official business of Sender. This transmission is of a confidential  
> nature and Sender does not endorse distribution to any party other  
> than intended recipient. Sender does not necessarily endorse content  
> contained within this transmission.
>
>
> > From: brendan.martens@crosscomm.net
> > To: users@tomcat.apache.org
> > Subject: html entities and urls with spaces
> > Date: Wed, 10 Sep 2008 17:41:56 -0400
> >
> > Hello,
> >
> > I am having some issues with tomcat not displaying pages or files  
> with
> > spaces in them, it simply 404s. Something like this:
> >
> > pdf file on filesystem.pdf
> >
> > being accessed at:
> >
> > http://server/pdf%20file%20on%20filesystem.pdf
> >
> > fails to display.
> >
> > I am migrating this site from an older RHEL server where it works
> > fine. I am migrating to a Debian server with up to date Debian
> > packages of apache2, tomcat5, and java6.
> >
> > I am using tomcat5 because the webapp had some odd html entity  
> issues
> > with tomcat5.5 and tomcat6 that I was not able to resolve, moving to
> > tomcat5 fixed the issues with entities in the page content itself. I
> > am not certain that the page content html entity issues and the urls
> > with spaces issues are related, but it seems like they may be?
> >
> > To check that this was a tomcat (and not an apache issue, as I am
> > JkMounting the site to tomcat ) issue I tested accessing items with
> > spaces with apache and that worked fine.
> >
> > Any one have any thoughts on this?
> >
> > Brendan Martens
> >
> >  
> ---------------------------------------------------------------------
> > To start a new topic, e-mail: users@tomcat.apache.org
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
>
> Want to do more with Windows Live? Learn “10 hidden secrets” from  
> Jamie. Learn Now