Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 787
  • Last Modified:

struts-example problem

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
CEHJ
Asked:
CEHJ
  • 5
  • 2
  • 2
2 Solutions
 
jimmackCommented:
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
 
CEHJAuthor Commented:
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
 
jimmackCommented:
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!

 
CEHJAuthor Commented:
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
 
kennethxuCommented:
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
 
CEHJAuthor Commented:
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
 
kennethxuCommented:
>> 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
 
CEHJAuthor Commented:
>>try a this command:
ps -ef | grep tomcat

There is no process called 'tomcat' just Java processes are created
0
 
CEHJAuthor Commented:
Deleting all working directories seemed to do the trick
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 5
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now