Page 1 of 1

Tomcat error 403 with deployed solution.

PostPosted: Thu Oct 16, 2014 4:18 pm
by alan.bourke
Servoy 6.1.6, web-client only. Deployed on Windows Server 2008 R2.

Users need to be able to view/download PDFs from the server.
Code: Select all
plugins.file.writefile
does not work I suspect because the server is behind a NAT router. This is borne out by
Code: Select all
plugins.it2be_tools.server().IP
always returning a 192.168 IP address.

Anyway when a user clicks to view the PDF I am copying the PDF to a folder location that I created: C:\Users\abourke\apps\Servoy\application_server\server\webapps\ROOT\pdfdownloads.

The copying part works fine.

I then use
Code: Select all
application.showURL(newURL)
to view the PDF in the browser (what happens of course depends on the browser's PDF handling).

... where newUrl would be like
Code: Select all
http://99.99.99.99:8080/pdfdownloads/7305E3FA-52CB-47F9-BEF4-9CB5DFB4C367/IIN606505.PDF
for example.

This results in Tomcat throwing 403 - Forbidden

This works fine on dev machine.

How do I grant permissions to allow read access to that pdfdownloads folder?

Thanks

Re: Tomcat error 403 with deployed solution.

PostPosted: Fri Oct 17, 2014 12:33 pm
by alan.bourke
Is this a Tomcat configuration thing? Anyone?

Re: Tomcat error 403 with deployed solution.

PostPosted: Fri Oct 17, 2014 3:11 pm
by Harjo
are you 100% sure that when you get the forbidden error that the folder(s) and file(s) are in the ROOT?

pdfdownloads/7305E3FA-52CB-47F9-BEF4-9CB5DFB4C367/IIN606505.PDF


You must be sure that user where Servoy runs under, has (full) access rights, to the Servoy folder.

Re: Tomcat error 403 with deployed solution.

PostPosted: Fri Oct 17, 2014 3:51 pm
by alan.bourke
Well, that's relative to ROOT, i.e. the actual path on the server is:

D:\Servoy\application_server\server\webapps\ROOT\pdfdownloads/7305E3FA-52CB-47F9-BEF4-9CB5DFB4C367/IIN606505.PDF

Re: Tomcat error 403 with deployed solution.

PostPosted: Fri Oct 17, 2014 4:54 pm
by Harjo
yup I know, but i's not quite clear... what you say works, and what does'nt work....
in case of the live app server, is the file created in the ROOT folder, yes or no?
So is it a writefile issue? or a read issue in Tomcat?

Re: Tomcat error 403 with deployed solution.

PostPosted: Fri Oct 17, 2014 5:07 pm
by alan.bourke
Harjo,

On the live app server, the file is created successfully by WriteFile as:

D:\Servoy\application_server\server\webapps\ROOT\pdfdownloads\7305E3FA-52CB-47F9-BEF4-9CB5DFB4C367\IIN606505.PDF

So when you say 'in the ROOT' folder, it is in a subdirectory below the ROOT location called pdfdownloads\7305E3FA-52CB-47F9-BEF4-9CB5DFB4C367

All that part is fine. It's the fact that when I then do:

application.showURL('http://99.99.99.99:8080/pdfdownloads/7305E3FA-52CB-47F9-BEF4-9CB5DFB4C367/IIN606505.PDF')

... I get a HTTP 403. Obviously the IP address there is not the real one, but the one that's used is correct.

Which leads me to believe it is a Tomcat issue?

The Windows permissions to the folder in question seem correct.

Re: Tomcat error 403 with deployed solution.

PostPosted: Mon Oct 20, 2014 12:49 pm
by alan.bourke
I've made sure the Servoy server is running under an administrator account. Still won't work.

From reading other posts this should be simple. Can anyone help at all ?

Re: Tomcat error 403 with deployed solution.

PostPosted: Wed Dec 31, 2014 5:47 pm
by jcompagner
if you are on that server
and you do localhost:8080/pdfdownloads/7305E3FA-52CB-47F9-BEF4-9CB5DFB4C367/IIN606505.PDF

it doesnt work?