Solved

struts-example problem

Posted on 2003-10-25
9
770 Views
Last Modified: 2010-04-01
I downloaded  jakarta-struts-1.1 and deployed the applications that shipped with it but the struts-example application failed. The following is what I got. Any ideas? Thanks in advance.

(Permission denied)
type Status report
message /jakarta-tomcat-4.0.1/work/localhost/struts-example/index$jsp.java
(Permission denied)
description The requested resource
(/jakarta-tomcat-4.0.1/work/localhost/struts-example/index$jsp.java
(Permission denied)) is not available.

btw, are there any other TAs (apart from Java) where this question could be asked?

0
Comment
Question by:CEHJ
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
  • 2
9 Comments
 
LVL 15

Expert Comment

by:jimmack
ID: 9619406
Well, this looks like you don't have read access for the specified files (possibly even the directories).

Check the access rights (I'm assuming Linux/Unix from your forward slashes).

I believe the access rights you will need are those for the "user" that Tomcat runs with.  This is defined in tomcat4.conf (probably under /etc/tomcat4).

Hope this helps.

This is probably where you need to be asking the question.  Web Servers could be another option.
0
 
LVL 86

Author Comment

by:CEHJ
ID: 9619416
Well, the rights *were* inadequate originally but that's no longer the case. I wonder if there's a 'memory' of this inadequacy, and if so, why?
0
 
LVL 15

Assisted Solution

by:jimmack
jimmack earned 40 total points
ID: 9619458
I'm on the boundaries of my Linux knowledge here ;-), but there may be an issue with the permissions on the directory tree in addition to the files themselves (I realise that I might be inadequately explaining something that you know better than me here, but it's always worth checking ;-))

Are there any other clues that might shed further light on the errors (eg. from the log files).

I see your path reference include Tomcat 4.0.1.  Are you stuck with this, or could you use a newer build (there may have been a change in Tomcat that is relevant to this issue).  It's currently at 4.1.27.

Any changes you've made to the directory/file permissions should be taken into account when you restart Tomcat.

I have seen something about a similar problem being related to the browser cache (I can't quite see why myself, but there you go).

Just one last thing.  Why am I helping you in this TA.  I have enough trouble trying to get to questions before you in the Java Programming TA :-P

;-)
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 86

Author Comment

by:CEHJ
ID: 9619477
I'm going to stick with that Tomcat until 5 comes out

>>
I have seen something about a similar problem being related to the browser cache (I can't quite see why myself, but there you go).
>>

This is sounding like a good idea. Unlike the others, struts-example.war was copied with root ownership. There could well be still root-owned verstiges.

>>Why am I helping you in this TA.  I have enough trouble trying to get to questions before you in the Java Programming TA

LOL. Two heads better than one - AND i'm a Struts tyro ;-)
0
 
LVL 14

Accepted Solution

by:
kennethxu earned 85 total points
ID: 9620466
there is few things you need to check:
1. which user account is tomcat running on? try a this command:
ps -ef | grep tomcat
2. make sure your the war file and files and dirs under expended struts-example are readble to the account that tomcat is running on.
3. stop tomcat, clear tmp files and start tomcat will greatly help, command to clear tmp files ( you might need root permission to execute this)
rm -rf /jakarta-tomcat-4.0.1/work/*

This problem is most like caused by.
you started tomcat as user A, and tested the code, temp files are generated and owned by user A. you restarted tomcat as user B, B doesn't have adequate permission to access those temp files (need write access). and you see the error.

HTH
0
 
LVL 86

Author Comment

by:CEHJ
ID: 9620542
1. Should be OK since I start Tom with the shell script  (aliased) in a non-root account
2. Looks OK
3. Did this  earlier (or rather chowned them), as I noticed that root still owned a bit of stuff in $CATALINA_HOME/work/_

(dig that directory name ;-))

Maybe I should delete them instead of chowning them?

>>This problem is most like caused by...

Actually the bummer was that I managed to copy the struts-example.war over when it was owned by root. It was all downhill for struts-example after that.

Just out of interest, when I get out of Windoze, I'm going to look for any other root-owned files in the catalina tree.
0
 
LVL 14

Expert Comment

by:kennethxu
ID: 9620903
>> 1. Should be OK since I start Tom with the shell script  (aliased) in a non-root account
most likely, but not 100%, if an executable's setuid bit is set, it can be running as account other then the one invoked it. ps is the only way to find it out for sure.

>> Maybe I should delete them instead of chowning them?
its not a matter of who own it, but that fact that the account can actually read/write it. an account owns a file does imply it has permission to read/write it.

IN ADDITION, make sure the umask is set to 0xx (not 2xx) when you start tomcat.
0
 
LVL 86

Author Comment

by:CEHJ
ID: 9622752
>>try a this command:
ps -ef | grep tomcat

There is no process called 'tomcat' just Java processes are created
0
 
LVL 86

Author Comment

by:CEHJ
ID: 9623029
Deleting all working directories seemed to do the trick
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Auditing domain password hashes is a commonly overlooked but critical requirement to ensuring secure passwords practices are followed. Methods exist to extract hashes directly for a live domain however this article describes a process to extract u…
The goal of this blog is: - To define the incident management process - To go over the key elements of an incident management system - To look into incident alert management tools that integrate with ConnectWise.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question