Re: WebApp access to a LAN share

2011-10-16 Thread André Warnier

Léa Massiot wrote:

Hello,

Thank you for reading my post.

Here is my problem:
- I have two machines S and M on the same LAN.
- S is a Debian machine running a Tomcat server.
- And I have a WebApp W deployed on this Tomcat server.
- M is a Windows machine which hosts some files for W. 
- S and M belong to the same Samba domain.

- On M, the WebApp files are stored in a directory: C:\p1\p2\.
- p2 is a share.
- Somewhere in the WebApp Java code, I have declared a final to store the
files path.
  Here is what I wrote:
  public static final String s_path = //M/p2/;
- Now, when I manipulate the WebApp in such a way a file f.xml located in
C:\p1\p2\p3\ has to be opened and read, I get the following error:
  java.io.FileNotFoundException: /M/p2/p3/f.xml (No such file or directory)
My question is: how do I have to declare s_path to properly access, from S
(W), those files which are stored on M?
(I basically want to have the data on one machine and Tomcat on another
machine).


Without discussing the pros and cons of the underlying logic, the issue here is that Java 
(on S) does not understand that //M/p2/ means a network share in Microsoft notation.

(Only Windows understands that).
What you need to to is mounting that network share to a local (Linux) 
mountpoint on S.
Then in Java you access that mountpoint, not the original share.

This is quite Off-Topic regarding Tomcat and even Java, but here is an idea :

On the Linux machine,

1) create an empty directory /mnt/M/p2

2) in the file /etc/fstab, add the following line (all on one line):
//M/p2	/mnt/M/p2 cifs 
rw,username=xxx,password=yyy,uid=uuu,gid=ggg,dir_mode=0775,file_mode=0774 0 2


(xxx and yyy are the (Windows) user-id and password needed to access that share; uuu and 
ggg are a Linux user-id and group under which the remote files will look like under 
Linux). And you will need to get someone to help you with the other parameters, to adjust 
them to your needs.


3) under Linux, isssue the command mount -a. This will read the file /etc/fstab, and 
mount all the mountpoint that ar not already mounted (like the new one above).


After this, under Linux, whenever you access the directory /mnt/M/p2, you will see the 
files on the remote M nachine.

And in Java, you then access this the same way, as /mnt/M/p2.




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat 7 won't run as Windows service

2011-10-16 Thread Pid
On 15/10/2011 22:46, David Rush wrote:
 No, I did not uninstall the old service.  I'd like to be able to keep
 multiple Tomcat instances going at once.  Normally I do keep multiple
 instances, each installed as a service (on different ports with
 different service names), but they've always been of the exact same
 version.

It was not clear to me whether you were adding a service or replacing it.

 Would there be an issue with different Tomcat versions installed at once?

There shouldn't be.

 On my development box I did get the Tomcat Windows service to run after
 moving back to Java 6.
 
 But my last attempt to install and run a Windows service on our staging
 machine is now failing to run as a service as well, although I'm not
 getting the commons-daemon error like before.  Again I can run it fine
 from startup.bat, and can install the service, but starting the service
 fails.  Nothing notable in stdout or stderr logs, either.  Event viewer
 says The david2 Tomcat 7 service terminated with service-specific error
 0 (0x0).  Bah.
 
 What exactly is needed for the Tomcat bootstrapping to find the Java
 install that it's to use?  

The service wrappers, e.g tomcat7w.exe, have a control panel with
various tabs  properties therein.

You must either run that program with a parameter so it knows which
service to refer to, or make a copy with the same name as the service,
e.g. david7w.exe and then run it.

I thought that setting JAVA_HOME in
 setenv.bat was a way, but apparently that's not used when it runs as a
 service.

See above, and:

 http://tomcat.apache.org/tomcat-7.0-doc/windows-service-howto.html

Use the popup to select the Java version you wish to run.


p

Is it a matter of having JAVA_HOME set at the time that the
 service is created, and it keeps that value in the service
 configuration somehow?  Or does the JAVA_HOME env var have to be set in
 the environment of the service that's trying to run, every time it starts?
 
 David
 
 On 10/15/2011 10:31 AM, Pid wrote:
 On 14/10/2011 13:16, Konstantin Kolinko wrote:
 2011/10/14 David Rushda...@rushtone.com:
 I've been running Tomcat 6.0.18 for a long time, and am now trying to
 upgrade to 7.0.22 (64 bit .zip download).

 I can start Tomcat 7 with startup.bat and it's working fine.

 The script to install it as a service worked without complaint, and the
 service is there.
 Did you uninstall the old service first?


 p


 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 




signature.asc
Description: OpenPGP digital signature


Re: Session across Realm and Servlet

2011-10-16 Thread Pid
On 16/10/2011 05:57, sailendra karthik wrote:
 On 10/16/11, sailendra karthik karthiksailen...@gmail.com wrote:
 On 10/15/11, Pid p...@pidster.com wrote:
 On 14/10/2011 22:36, sailendra karthik wrote:
 I need to maintain a session object between Realm and Servlet.

 I have written a CustomRealm and every thing working fine and now it
 is required to send an object to servlets (possibly by
 HttpRequestServlet ) But i know/think Servlet is not yet Initiated.

 So how it is possible to access HttpRequestServlet and set some
 session attribute in my Custom Realm which extends RealmBase.

 Or else it should be a different Procedure.

 Waiting for some clue.

 This is clear, but so are we.  Which version of Tomcat for example?


 p





 Tomcat 6.0.22

 
 As you asked about version of Tomcat,
 
   Is it possible in some tomcat version, if yes, can you tell me that
 version and which portion in
   that tomcat version(like few classes) makes it possible.

You are trying, for some reason, to force a Realm and a Servlet to
interact directly.  Don't do this.

What is the real problem, why do you need a custom realm implementation?

For what purpose are you setting an object in the session?


p





signature.asc
Description: OpenPGP digital signature


Re: WebApp access to a LAN share

2011-10-16 Thread Brian Burch

On 15/10/11 23:27, Caldarale, Charles R wrote:

From: Brian Burch [mailto:br...@pingtoo.com]
Subject: Re: WebApp access to a LAN share



Well, for a start a webapp is not normally allowed to access
files outside its own container...


Unless you've configured Tomcat to use a security manager, that's simply false; 
webapps run under the same userid and access rights that all of Tomcat does.  
Even if you have a security manager, it's fairly trivial to configure it to 
allow a given webapp to access whatever it needs to.


You can get outside that container with a context.xml docbase
element, but I can see that won't work for you because you are
talking as if you have/need most of your webapp within the container.


This has nothing to do with what the OP was asking; what you're describing is 
how to locate a _webapp_ outside of the Tomcat directory structure, not just 
data the webapp wants to access.


The only way I know to access data outside the container
(under linux) is to define a linux symlink from inside the
container to a directory path outside the container.


I think you're confusing client access to resources on the server with webapp 
access to data files; they are completely independent.

  - Chuck


I was trying to be helpful, but was also in a hurry, so I didn't analyse 
the question closely enough.


Just for the record, my comments were based on an experience several 
years ago. Tomcat 5.x was running under sun jdk 1.4.x. It was running as 
root, was NOT chrooted, and yet my webapp could not access files outside 
the container until I did the symlink trick.


I accept all you say above, but I wasn't dreaming. Perhaps I was 
inadvertently hindered by a SecurityManager as you suggest, but there is 
no benefit in discussing or analysing that historical problem further.


Thanks for preventing me from causing unwanted confusion.

Brian

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Session across Realm and Servlet

2011-10-16 Thread sailendra karthik
On Sun, Oct 16, 2011 at 2:25 PM, Pid p...@pidster.com wrote:

 On 16/10/2011 05:57, sailendra karthik wrote:
  On 10/16/11, sailendra karthik karthiksailen...@gmail.com wrote:
  On 10/15/11, Pid p...@pidster.com wrote:
  On 14/10/2011 22:36, sailendra karthik wrote:
  I need to maintain a session object between Realm and Servlet.
 
  I have written a CustomRealm and every thing working fine and now it
  is required to send an object to servlets (possibly by
  HttpRequestServlet ) But i know/think Servlet is not yet Initiated.
 
  So how it is possible to access HttpRequestServlet and set some
  session attribute in my Custom Realm which extends RealmBase.
 
  Or else it should be a different Procedure.
 
  Waiting for some clue.
 
  This is clear, but so are we.  Which version of Tomcat for example?
 
 
  p
 
 
 
 
 
  Tomcat 6.0.22
 
 
  As you asked about version of Tomcat,
 
Is it possible in some tomcat version, if yes, can you tell me that
  version and which portion in
that tomcat version(like few classes) makes it possible.

 You are trying, for some reason, to force a Realm and a Servlet to
 interact directly.  Don't do this.

 What is the real problem, why do you need a custom realm implementation?

 For what purpose are you setting an object in the session?


 p

 Real Problem :-

  In my Custom Realm Implementation iam autheticating some user and allowing
him to access my webapps(servlets or filters) (my application)
  This authentication session i need it to be reused in my webapp(to avoid
another authentication)  if it is an authorized session.
  So for this purpose i want to set an object in the session and reuse that
object(connection Object) at my servlets level.

How can i over come this


Re: Session across Realm and Servlet

2011-10-16 Thread Pid
On 16/10/2011 12:01, sailendra karthik wrote:
 On Sun, Oct 16, 2011 at 2:25 PM, Pid p...@pidster.com wrote:
 
 On 16/10/2011 05:57, sailendra karthik wrote:
 On 10/16/11, sailendra karthik karthiksailen...@gmail.com wrote:
 On 10/15/11, Pid p...@pidster.com wrote:
 On 14/10/2011 22:36, sailendra karthik wrote:
 I need to maintain a session object between Realm and Servlet.

 I have written a CustomRealm and every thing working fine and now it
 is required to send an object to servlets (possibly by
 HttpRequestServlet ) But i know/think Servlet is not yet Initiated.

 So how it is possible to access HttpRequestServlet and set some
 session attribute in my Custom Realm which extends RealmBase.

 Or else it should be a different Procedure.

 Waiting for some clue.

 This is clear, but so are we.  Which version of Tomcat for example?


 p





 Tomcat 6.0.22


 As you asked about version of Tomcat,

   Is it possible in some tomcat version, if yes, can you tell me that
 version and which portion in
   that tomcat version(like few classes) makes it possible.

 You are trying, for some reason, to force a Realm and a Servlet to
 interact directly.  Don't do this.

 What is the real problem, why do you need a custom realm implementation?

 For what purpose are you setting an object in the session?


 p

 Real Problem :-

   In my Custom Realm Implementation iam autheticating some user and allowing
 him to access my webapps(servlets or filters) (my application)

What's wrong with the existing realms?

   This authentication session i need it to be reused in my webapp(to avoid
 another authentication)  if it is an authorized session.

What's wrong with the existing container functionality?

   So for this purpose i want to set an object in the session and reuse that
 object(connection Object) at my servlets level.

What kind of object?


p

 How can i over come this
 




signature.asc
Description: OpenPGP digital signature


Re: WebApp access to a LAN share

2011-10-16 Thread Stefan Mayr

Am 16.10.2011 10:31, schrieb André Warnier:

Léa Massiot wrote:

Hello,

Thank you for reading my post.

Here is my problem:
- I have two machines S and M on the same LAN.
- S is a Debian machine running a Tomcat server.
- And I have a WebApp W deployed on this Tomcat server.
- M is a Windows machine which hosts some files for W. - S and M
belong to the same Samba domain.
- On M, the WebApp files are stored in a directory: C:\p1\p2\.
- p2 is a share.
- Somewhere in the WebApp Java code, I have declared a final to
store the
files path.
Here is what I wrote:
public static final String s_path = //M/p2/;
- Now, when I manipulate the WebApp in such a way a file f.xml
located in
C:\p1\p2\p3\ has to be opened and read, I get the following error:
java.io.FileNotFoundException: /M/p2/p3/f.xml (No such file or directory)
My question is: how do I have to declare s_path to properly access,
from S
(W), those files which are stored on M?
(I basically want to have the data on one machine and Tomcat on another
machine).


Without discussing the pros and cons of the underlying logic, the issue
here is that Java (on S) does not understand that //M/p2/ means a
network share in Microsoft notation.
(Only Windows understands that).
What you need to to is mounting that network share to a local (Linux)
mountpoint on S.
Then in Java you access that mountpoint, not the original share.

This is quite Off-Topic regarding Tomcat and even Java, but here is an
idea :

On the Linux machine,

1) create an empty directory /mnt/M/p2

2) in the file /etc/fstab, add the following line (all on one line):
//M/p2 /mnt/M/p2 cifs
rw,username=xxx,password=yyy,uid=uuu,gid=ggg,dir_mode=0775,file_mode=0774 0
2

(xxx and yyy are the (Windows) user-id and password needed to access
that share; uuu and ggg are a Linux user-id and group under which the
remote files will look like under Linux). And you will need to get
someone to help you with the other parameters, to adjust them to your
needs.

3) under Linux, isssue the command mount -a. This will read the file
/etc/fstab, and mount all the mountpoint that ar not already mounted
(like the new one above).

After this, under Linux, whenever you access the directory /mnt/M/p2,
you will see the files on the remote M nachine.
And in Java, you then access this the same way, as /mnt/M/p2.



So machine M is essentially a fileserver that is accessed by 
application W.


I see two options:
1. Abstract it on OS level: Linux machine S mounts the fileshare into 
the local directory /M/p2 via CIFS/SMBFS. Details were just outlined by 
André
2. Solve it in your application using jCIFS (or another component) to 
access a remote Windows fileshare


Independent recommendation: make s_path a configuration variable. 
Hardcoded paths are no good idea


- Stefan

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Session across Realm and Servlet

2011-10-16 Thread Chema
   In my Custom Realm Implementation iam autheticating some user and
 allowing
 him to access my webapps(servlets or filters) (my application)
  This authentication session i need it to be reused in my webapp(to avoid
 another authentication)  if it is an authorized session.
  So for this purpose i want to set an object in the session and reuse that
 object(connection Object) at my servlets level.

 How can i over come this



You can use a Filter and check if remote user is setted.
I do it this way to load user info into user http session


Re: WebApp access to a LAN share

2011-10-16 Thread Léa Massiot

Hello everyone and thank you very much for your fast answers.

@Brian and @Chuck
I did configure the WebApp context.xml file to let my WebApp access files
elsewhere on my hard disk (S hard disk for now). 
You are helpful. Thank you.

@p
Yeah... well, in the end, I'll have to put everything on the same machine.
So, for now, I am just interested in the communication between Unix and
Windows on the same LAN.

@awarnier
Very true, thank you. Mounting looks like a good idea. Thanks for detailing
the steps.
I'll try this as soon as I can (I just do not have S at hand right now).

@Stefan
Totally agree with the configuration variable recommendation.

Thank you all again. I'll come back as soon as possible to let you know how
it worked.
Best regards,
--
Léa
-- 
View this message in context: 
http://old.nabble.com/WebApp-access-to-a-LAN-share-tp32658680p32661603.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: filters on j_security_check

2011-10-16 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Chema,

On 10/15/2011 4:18 PM, Chema wrote:
 This is one of the reasons I switched to SecurityFilter: there is
 a
 
 FlexibleRealmInterface that passes-in the HttpServletRequest that
 was used to attempt authentication. That allows you to get nice
 things like the ip address of the request for logging.
 
 
 I'm interested on what are talking about , where I can find info 
 about SecurityFilter ? I've used Spring Security for reasons like
 you but I want try another options

Frankly, if you're using Spring Security, I'd stick with it. I myself
am thinking of making the switch.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk6bC1QACgkQ9CaO5/Lv0PCQOgCfaFI5mg1TtXUa8OK3aWQfo/S1
Cu0AnRYPLLjdLF6v/G4hlFxSQbYDfvD4
=ZyEQ
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: filters on j_security_check

2011-10-16 Thread Chema



 Frankly, if you're using Spring Security, I'd stick with it. I myself
 am thinking of making the switch.


Yes, I tried it and like it , but I need Single Sign On support and the
solutions what Spring Security offers are complicated to implement by me


RE: Classloaders in catalina.properties

2011-10-16 Thread spring
 Because, while the functionality remains, it's no longer the default.
 See:
 
  http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html

Ah ok, thx.

But why is this no longer documented?


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Classloaders in catalina.properties

2011-10-16 Thread Mark Thomas
On 16/10/2011 20:11, spr...@gmx.eu wrote:
 Because, while the functionality remains, it's no longer the default.
 See:

  http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html
 
 Ah ok, thx.
 
 But why is this no longer documented?

Generally, using the shared class loader is a bad idea and there is
little need to add things to the server class loader.

Patches welcome.

Mark

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Session across Realm and Servlet

2011-10-16 Thread sailendra karthik
On Sun, Oct 16, 2011 at 5:16 PM, Chema demablo...@gmail.com wrote:

In my Custom Realm Implementation iam autheticating some user and
  allowing
  him to access my webapps(servlets or filters) (my application)
   This authentication session i need it to be reused in my webapp(to avoid
  another authentication)  if it is an authorized session.
   So for this purpose i want to set an object in the session and reuse
 that
  object(connection Object) at my servlets level.
 
  How can i over come this
 


 You can use a Filter and check if remote user is setted.
 I do it this way to load user info into user http session


As you said that can work using Filters,
But the requirement is that it needs Tomcat level authentication.

 or else i dont know whether i completely misunderstood the concept of
realms.


Service not starting due to java.lang.NoSuchMethodError

2011-10-16 Thread Ricardo Martin
Hi there

I have a Centos 5.7 server with JRE 1.6.0u27, tomcat 6.0.33  postgresql
9.1.  Every time I start the tomcat service it fails with the following
message in the log:

java.lang.NoSuchMethodError:
org.apache.naming.NamingContextBindingsEnumeration.init(Ljava/util/Iterato
r;Ljavax/naming/Context;)V
at
org.apache.naming.NamingContext.listBindings(NamingContext.java:391)

This is a fresh install.  Is there I have missing?

Thanks for your help, Ricardo



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Service not starting due to java.lang.NoSuchMethodError

2011-10-16 Thread Caldarale, Charles R
 From: Ricardo Martin [mailto:rmar...@chamsyspr.com] 
 Subject: Service not starting due to java.lang.NoSuchMethodError

 I have a Centos 5.7 server with JRE 1.6.0u27, tomcat 6.0.33 
 postgresql 9.1.

How was Tomcat installed?  Is it a real Tomcat downloaded ftom 
tomcat.apache.org, or a 3rd-party repackaged version?

 java.lang.NoSuchMethodError:
 org.apache.naming.NamingContextBindingsEnumeration.
 init(Ljava/util/Iterator;Ljavax/naming/Context;)V
 at
 org.apache.naming.NamingContext.listBindings(NamingContext.java:391)

That certainly appears to be a broken Tomcat installation.  Suggest you remove 
what you've got, then reinstall from tomcat.apache.org.

 - 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 unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Service not starting due to java.lang.NoSuchMethodError

2011-10-16 Thread Ricardo Martin
Thanks Charles.

It was actually a real Tomcat version downloaded from tomcat.apache.org.
The only detail I forgot to mention (not sure if it's important), is that
this Centos 5.7 is installed in a virtual space using VMware Player.
 
Ricardo


-Original Message-
From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] 
Sent: Sunday, October 16, 2011 7:25 PM
To: Tomcat Users List
Subject: RE: Service not starting due to java.lang.NoSuchMethodError

 From: Ricardo Martin [mailto:rmar...@chamsyspr.com] 
 Subject: Service not starting due to java.lang.NoSuchMethodError

 I have a Centos 5.7 server with JRE 1.6.0u27, tomcat 6.0.33 
 postgresql 9.1.

How was Tomcat installed?  Is it a real Tomcat downloaded ftom
tomcat.apache.org, or a 3rd-party repackaged version?

 java.lang.NoSuchMethodError:
 org.apache.naming.NamingContextBindingsEnumeration.
 init(Ljava/util/Iterator;Ljavax/naming/Context;)V
 at
 org.apache.naming.NamingContext.listBindings(NamingContext.java:391)

That certainly appears to be a broken Tomcat installation.  Suggest you
remove what you've got, then reinstall from tomcat.apache.org.

 - 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 unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: appbase directory deleted partically

2011-10-16 Thread Osamu Ochiai
Thanks.

I mean that the directories other than WEB-INF directory  were deleted.

Thanks again.

Osamu Ochiai



From:   Pid p...@pidster.com
To: Tomcat Users List users@tomcat.apache.org
Date:   2011/10/16 01:15
Subject:Re: appbase directory deleted partically



On 14/10/2011 04:07, Osamu Ochiai wrote:
 Hello
 
 The problem:
  Tomcat started successfully but the deployed webapp did not 
work 
 because the appbase directory was deleted partially.
  Maybe the directory was deletedby mistake without 
user's 
 intention.
 
 Can Tomcat delete appbase directory  except in the case of 
webapp 
 WAR. updated (deploy)?
 
 The environment:
 Tomcat6.0.29, Java SE6, Windows7


The appBase directory was partially deleted?  What does that mean, the
contents of it were deleted or the directory itself?


p


[添付ファイル signature.asc は Osamu Ochiai/Japan/IBM が削除しました] 


Re: Configuration for both protected and public URLs in a web application

2011-10-16 Thread Yogesh Shankarappa
On Sat, Oct 15, 2011 at 11:49 AM, Brian Burch br...@pingtoo.com wrote:

 On 15/10/11 14:47, Yogesh Shankarappa wrote:

 Thanks for your response. I tried your suggestion, unfortunately it did
 not
 work.
 There must be a solution for this as most web applications have both
 public
 and
 protected URLs.


 *public URLs*
 security-constraint
 web-resource-collection
 web-resource-name**Unprotected/web-resource-**name
 url-pattern/public/welcome.**html/url-pattern
 /web-resource-collection
 /security-constraint


 Thanks in advance.


 Thanks
 Yogesh



 Try to do like this for public urls Put an empty auth-constraint Tag

  *public URLs*
 security-constraint
 web-resource-collection
 web-resource-name**Unprotected/web-resource-**name
 url-pattern/public/welcome.**html/url-pattern
 /web-resource-collection
  auth-constraint /
 /security-constraint




 Reference:- http://java.dzone.com/**articles/understanding-web-**
 security http://java.dzone.com/articles/understanding-web-security

 --**--**
 -



 Here is an extract from a web.xml that does what you want... it is the
 presence of a security constraint WITHOUT an auth constraint AT ALL that
 denotes public, unauthenticated access.

 (Note... don't forget to permit access to the webapp base url if you have
 turned off directory browsing and you want the default servlet to redirect
 to your welcome page).

  security-constraint
   display-nameFree Access/display-name
   web-resource-collection
   web-resource-nameunauthed users can GET only/web-resource-name
 !-- Define the context-relative URLs to be unprotected --
 !-- must unprotect base url to permit redirect to welcome! --
 url-pattern//url-pattern
 url-pattern/myAccessControl.**html/url-pattern
 url-pattern/myError.jsp/**url-pattern
 http-methodGET/http-method
   /web-resource-collection
   !-- absence of auth-constraint means anyone at all can access this
 area --
   user-data-constraint
 transport-guarantee**CONFIDENTIAL/transport-**guarantee
   /user-data-constraint
  /security-constraint

  security-constraint
   display-nameRestricted Access/display-name
   web-resource-collection
 web-resource-nameProtected web application/web-resource-**name
!-- Define the context-relative URL(s) to be protected --
url-pattern/*/url-pattern
!-- no list of http methods, so ALL methods are protected --
 /web-resource-collection
 auth-constraint
   !-- Only someone authenticated with one of these roles can access
 this area --
   role-namemanager/role-name
   role-namefamily/role-name
 /auth-constraint
  /security-constraint

 Hope this sorts out your problem - when I had something similar it drove me
 nuts reading the servlet specs and the tomcat docs to work out exactly how
 to do it.

 Brian


Thanks for your help, Brian. It worked !!!


Yogesh


Re: appbase directory deleted partically

2011-10-16 Thread Konstantin Kolinko
2011/10/17 Osamu Ochiai ooch...@jp.ibm.com:
 Thanks.

 I mean that the directories other than WEB-INF directory  were deleted.

 Thanks again.

 Osamu Ochiai




Do not top-post.

Look at Context attributes such as antiJARLocking

Unixes allow to delete files that are still open for reading/writing,
Windows does not and thus there exists a trick enabled by above
attribute.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Service not starting due to java.lang.NoSuchMethodError

2011-10-16 Thread Konstantin Kolinko
2011/10/17 Ricardo Martin rmar...@chamsyspr.com:
 Thanks Charles.

 It was actually a real Tomcat version downloaded from tomcat.apache.org.
 The only detail I forgot to mention (not sure if it's important), is that
 this Centos 5.7 is installed in a virtual space using VMware Player.

 Ricardo


Something is screwed in your installation, and we do not know what.
(You are not providing enough details).

Maybe you did not specify CATALINA_HOME and CATALINA_BASE variables
when starting Tomcat, or they had wrong values.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org