Solved

struts-example problem

Posted on 2003-10-25
9
763 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
  • 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
 
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
logging jar 1 104
Apache server configuration 7 79
maven project in eclipse 11 57
spring example errors 33 200
HOW TO: Upload an ISO image to a VMware datastore for use with VMware vSphere Hypervisor 6.5 (ESXi 6.5) using the vSphere Host Client, and checking its MD5 checksum signature is correct.  It's a good idea to compare checksums, because many installat…
In this article, I will show you HOW TO: Create your first Windows Virtual Machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, the Windows OS we will install is Windows Server 2016.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

706 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now