Persistent Context Configuration

2014-05-18 Thread Tim Gustafson
Hi,

I have a web application that I've deployed on three different virtual
hosts.  Each virtual host requires different configuration data
(specifically, AWS credentials and options that the web application
uses to access AWS services).  In the future, there may be many more
deployments, each with their own set of AWS credentials and options.

I've tried putting these options as parameters in
conf/Catalina/name/ROOT.xml files which works except that file is
deleted each time the web application is redeployed.

Where is the proper place to put virtual-host-specific configuration
options such that they can be easily read from within the web
application and persist across redeployments?  I can't put them in the
WAR file directly because the same WAR file will be re-used by
multiple virtual-hosts, so I need something that I can put in
server.xml or something similar.

Thanks in advance for any help you can give.  :)

-- 

Tim Gustafson
t...@tgustafson.com

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



Re: jsf validator not found when using maven tomcat 7 plugin

2014-05-18 Thread Burghard Britzke

Am 18.05.2014 um 02:35 schrieb Dafinoiu Iulian cicoron...@yahoo.com:

 
 
 Hey guys,
 
 
 I'm developing a web application using latest version of spring 3.2 and 
 latest version of jsf 2.2 (on Mac Mavericks). I defined a custom validator 
 and give it an id using the faces exception annotation. If I run the 
 application from Netbeans with the same tomcat version it works fine, if I 
 run it from command line using mvn package tomcat7:run, the app starts and I 
 get the javax.faces exception that my custom validator is not defined. 
 
 Do you know if I have to do something different when running from maven?
 
 Thank you,
 Iulian

which javax.faces exception do you get? ValidatorException? 


signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: Session fixation Tomcat 7

2014-05-18 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Akash,

On 5/8/14, 9:56 PM, Akash Jain wrote:
 Hi,
 
 I am trying to resolve session fixation issue with tomcat 7.0.52
 
 We have a Spring MVC application running on it, and the Auth method
 is provided by another application which writes cookie, and we use
 the cookie value to check whether the user is valid or not.
 
 My application URL patterns are / - Home page /login - Redirect to
 another application to ask user to authenticate /myaccess/user***
 -- All authenticated URL's
 
 Context path= docBase=myapplication 
 sessionCookieName=mycookiename 
 sessionCookieDomain=application.mydomain.com 
 sessionCookiePath=/
 
 As I cannot use org.apache.catalina.authenticator.FormAuthenticator
 here.
 
 How can i prevent the session fixation ?

If you are managing the authentication yourself, then you'll have to
handle (mitigate) session fixation yourself, too. You can invalidate
and create a new session in the same request, if you want.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJTeNMIAAoJEBzwKT+lPKRYje4P/i1LD+r06I1VuI6jtFAzM/0k
Ow/HyXyyFRIq3zz1+LUQ8ys2PEROTw+E7q3NzLvBb8e6Vngc2vWBoRq7jps1r4Jq
h/5Cd4k7DI5V5dlPFph7nHNXwKbGgRtCamvhwC/fQFlZxwvGTOfAyxeYLT42k3zF
x3HkesQSI9F4hfy9VzQ8977cTICUI8bz5pUksRccN9uFJ5A1V18vdjDEJ7hWkS8K
V5lPr0VlZ9XzNOZ9conQYoZnuOzvl9l73QECTJi8jSPeVHGGEFcQmVE2KCxExx4u
qqN0twycISY/TrLxt74WkiJseljzr+QXZUjFHIlaepU62/pVmOwBQHs9bs1e7jHo
YNSY/8g+W0nKvLexgULJw1FBpxlq2LcTtkRzPDPEuTp0OlE583bPufxd+LaoLwL3
uWEtkhMSNiMsChyCigBsaZZVhkY8DzmSQ2SYpZmGx3suyJmllt/yiET+vc2uRAxn
6iBKvrSrwzDnqwpMpeowpU69n5v12+yRNts5PCOksLJ61TDV59C2AvUE3CWJI417
M163/01GEF9yux5/7cm7jYJpEDdqS3+y1vLC4E9I7BXkpLuuPmVAUcbl7VPVl12X
h5wZsbdFX9xZsIoDPkLlZv8+0ugp/BlLwVqNRNfnNusLQl4OHF/hlj1eWIDBQsEJ
G8FbWFqolK+tUemVOO1v
=UHeH
-END PGP SIGNATURE-

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



Re: Persistent Context Configuration

2014-05-18 Thread Mark Eggers

On 5/18/2014 12:39 AM, Tim Gustafson wrote:

Hi,

I have a web application that I've deployed on three different virtual
hosts.  Each virtual host requires different configuration data
(specifically, AWS credentials and options that the web application
uses to access AWS services).  In the future, there may be many more
deployments, each with their own set of AWS credentials and options.

I've tried putting these options as parameters in
conf/Catalina/name/ROOT.xml files which works except that file is
deleted each time the web application is redeployed.

Where is the proper place to put virtual-host-specific configuration
options such that they can be easily read from within the web
application and persist across redeployments?  I can't put them in the
WAR file directly because the same WAR file will be re-used by
multiple virtual-hosts, so I need something that I can put in
server.xml or something similar.

Thanks in advance for any help you can give.  :)

For virtual host-specific context configurations, place a 
context.xml.default in:


$CATALINA_BASE/conf/[engine-name]/[host-name]

See the following:

http://tomcat.apache.org/tomcat-7.0-doc/config/context.html

. . . just my two cents
/mde/

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



Re: jsf validator not found when using maven tomcat 7 plugin

2014-05-18 Thread Dafinoiu Iulian
Hey,

No, I get 

javax.faces.FacesException Expression error: Named object customXmlValidator 
not found

even though is defined perfectly, otherwise it wouldn't have worked when I run 
it from my IDE or manually with any server. Just when I run it using the maven 
tomcat connector, I get this error

Thank you,
Iulian




 From: Burghard Britzke b...@charmides.in-berlin.de
To: Tomcat Users List users@tomcat.apache.org; Dafinoiu Iulian 
cicoron...@yahoo.com 
Sent: Sunday, May 18, 2014 10:50 AM
Subject: Re: jsf validator not found when using maven tomcat 7 plugin
 



Am 18.05.2014 um 02:35 schrieb Dafinoiu Iulian cicoron...@yahoo.com:

 
 
 Hey guys,
 
 
 I'm developing a web application using latest version of spring 3.2 and 
 latest version of jsf 2.2 (on Mac Mavericks). I defined a custom validator 
 and give it an id using the faces exception annotation. If I run the 
 application from Netbeans with the same tomcat version it works fine, if I 
 run it from command line using mvn package tomcat7:run, the app starts and I 
 get the javax.faces exception that my custom validator is not defined. 
 
 Do you know if I have to do something different when running from maven?
 
 Thank you,
 Iulian

which javax.faces exception do you get? ValidatorException? 

Re: Application monitoring

2014-05-18 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Mark,

On 5/17/14, 10:58 AM, Mark Eggers wrote:
 Chris,
 
 On 5/16/2014 8:46 AM, Christopher Schultz wrote:
 -BEGIN PGP SIGNED MESSAGE- Hash: SHA256
 
 Mark,
 
 On 5/14/14, 1:41 PM, Mark Eggers wrote:
 On Wed, 14 May 2014 12:28:46 -0400, David kerber wrote:
 
 I am working on a small Tomcat servlet to monitor other 
 tomcat-based applications running on the same physical
 machine, and am trying to figure out the best way to
 communicate between the monitoring app, and the monitored
 apps.
 
 My setup has several tomcat instances of a single
 application, each running from its own directory, and
 listening on its own TCP port.  So there is no direct
 communication between the instances.
 
 I'm trying to monitor various data about the application,
 not about tomcat itself or the JVM. So I want to collect such
 things as the number of requests it has processed, the last
 data received, etc, and not things like memory and cpu usage.
 It is my app, so I can (and expect to need to) add methods or
 servlets to return the information I want to collect.
 
 My question is, what is the best way to make the request to
 get the data?  Would  URL request from the monitoring app to
 the monitored app be appropriate, and then parse the response
 out for display in a browser?  If so, what java class is
 likely to be useful for this communication?  I will have all
 the information needed to connect to the application instance
 (server, port, etc), but want it to be portable across OS
 types.
 
 Thanks!
 
 http://wiki.apache.org/tomcat/FAQ/Monitoring
 
 In particular, item 3. Unfortunately, the sample code seems to
 be missing . . .
 
 Which is item 3? I'd be happy to fix whatever is missing.
 
 - -chris
 
 Example Application Exposing Internals Using JMX
 
 at the bottom of the page goes nowhere. More accurately, it goes to
 a placeholder page.

Aah. NevenCvetkovic added that link, not me, so I dunno what he was
expecting to put there.

I should probably link to my ApacheCon presentation if I'm not going
to take some time to update the wiki itself.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJTeSWGAAoJEBzwKT+lPKRYyFYP/iBJGwEDqWRCu8Lv5Bt/OTzr
W4GOxbLV5Kkp6GBE+XaUWbwo+Mpz2+NkrtJ6HBjSpG8AtONDxH98GDGe2RWaV0d9
1pVGhRzBMOHnohVjJ+3s4KK0fKrzO/fmSYu/qgZBlGwZy/8Pw3tWMmXwFP5uOSDK
Q7qchK54Na7WWvEd3hoOCz9tSXUX+VU+rCxHKlLDaH6f4oDsnXaA/DWWSxIGuuBj
7+TUBp43Rg/WDDBnrlBjdaTqpXvrdQ81Ys+nXJIeeJucOpKDaQi3MBhOt9jYnU3L
VhHzLdS3pZGhx9kM+4TBaA2Hr3wbEn6RhF50EEgJSwqYqbxu6ZC/GBwNBPy9m0Yx
wOKSoHO1UVHxa9nAv5ovhP5tvDdN66CxlcekHUhFev6QnPS+pdpQYQxisbWpr1HH
p0QJjRqWpACqyLygEuYgaZ7kZbIF3PXh9BEDadvqcMjwVvJB1JGB6aU1e0FEkt67
YryB4iUTAcZ0aKut0BJdv3Hf0EYBzR7xo7Ug5jQVtNhVYG3pSHT1gJEG3r107uNH
Hgl554cYTNWGaLBQJs27BfxT7K2LnXld4aTTgKGfnsEwRFaOzHN0f32ZC76cAoY0
dO2fEtzxALD6fGgSbv1LRohum04lHr7kztUU21TDfvhBjou/v+wcQ3BK05YQLf5O
Rf6Ux+9kPA29Rae5X/nW
=Wogo
-END PGP SIGNATURE-

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



Re: Application monitoring

2014-05-18 Thread Mark Eggers

On 5/18/2014 2:26 PM, Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Mark,

On 5/17/14, 10:58 AM, Mark Eggers wrote:

Chris,

On 5/16/2014 8:46 AM, Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE- Hash: SHA256

Mark,

On 5/14/14, 1:41 PM, Mark Eggers wrote:

On Wed, 14 May 2014 12:28:46 -0400, David kerber wrote:


I am working on a small Tomcat servlet to monitor other
tomcat-based applications running on the same physical
machine, and am trying to figure out the best way to
communicate between the monitoring app, and the monitored
apps.

My setup has several tomcat instances of a single
application, each running from its own directory, and
listening on its own TCP port.  So there is no direct
communication between the instances.

I'm trying to monitor various data about the application,
not about tomcat itself or the JVM. So I want to collect such
things as the number of requests it has processed, the last
data received, etc, and not things like memory and cpu usage.
It is my app, so I can (and expect to need to) add methods or
servlets to return the information I want to collect.

My question is, what is the best way to make the request to
get the data?  Would  URL request from the monitoring app to
the monitored app be appropriate, and then parse the response
out for display in a browser?  If so, what java class is
likely to be useful for this communication?  I will have all
the information needed to connect to the application instance
(server, port, etc), but want it to be portable across OS
types.

Thanks!


http://wiki.apache.org/tomcat/FAQ/Monitoring

In particular, item 3. Unfortunately, the sample code seems to
be missing . . .


Which is item 3? I'd be happy to fix whatever is missing.

- -chris


Example Application Exposing Internals Using JMX

at the bottom of the page goes nowhere. More accurately, it goes to
a placeholder page.


Aah. NevenCvetkovic added that link, not me, so I dunno what he was
expecting to put there.

I should probably link to my ApacheCon presentation if I'm not going
to take some time to update the wiki itself.

- -chris


That might be a good thing.

Now that I have some time, I might sit down and a) go through your 
presentation, b) write some sample applications, and c) write a wiki 
article on the results of a) and b).


I need to go back and clean up some of the stuff I posted on the wiki as 
well - the articles are getting rather dated.


/mde/


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



Re: Persistent Context Configuration

2014-05-18 Thread Tim Gustafson
 For virtual host-specific context configurations, place a
 context.xml.default in:

 $CATALINA_BASE/conf/[engine-name]/[host-name]

 See the following:

 http://tomcat.apache.org/tomcat-7.0-doc/config/context.html

That did the trick; thanks!

-- 

Tim Gustafson
t...@tgustafson.com

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



Re: Application monitoring

2014-05-18 Thread Neven Cvetkovic
  Which is item 3? I'd be happy to fix whatever is missing.
 
  - -chris
 
  Example Application Exposing Internals Using JMX
 
  at the bottom of the page goes nowhere. More accurately, it goes to
  a placeholder page.

 Aah. NevenCvetkovic added that link, not me, so I dunno what he was
 expecting to put there.


Chris thanks for the reminder, I will fix the missing page with the example
I wrote, back then.

I thought I have published that already.