RE: Logging makes a grown man cry

2013-12-03 Thread Dale Ogilvie
Currently we use tomcat configured as out-of-the-box for logging (no
log4j) and log4j.jar and config in the app war file.

We found issues with trying to have log4j in catalina/lib.

That said, it would be nice to use log4j for tomcat, however we found
that the two configurations collided in our slf4j setup. 

Dale

-Original Message-
From: Tomcat Random [mailto:tomcat.ran...@gmail.com] 
Sent: Wednesday, 4 December 2013 7:12 a.m.
To: Tomcat Users List
Subject: Logging makes a grown man cry

So, all I want is to have:

1. one log file that rolls daily (a new file each day), with the date
appended, that catches my own logging code in the app, based on a global
logging level value that I can change (DEBUG, or INFO, or ERROR etc) as
needed.

2. Another log file that rolls daily and consolidates any other output
of the server and app (or two separate files) and also has a logging
level value that can be changed globally.

3. Get rid of the empty localhost. file.

MTIA,
Alec

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



Re: Transfer-Encoding: chunked not working

2013-12-03 Thread C. Benson Manica
Also, if HTTP 1.1 weren't enabled for some reason, wouldn't the default
simply be to serve the entire content, rather than the first 16384 bytes?


On Tue, Dec 3, 2013 at 4:44 PM, C. Benson Manica  wrote:

> connectionTimeout="2"
>redirectPort="8443" />
>
> sure looks like 1.1 to me.
>
>
> On Tue, Dec 3, 2013 at 4:38 PM, Martin Gainty  wrote:
>
>> chunked only works on HTTP 1.1 connections
>> display $CATALINA_HOME/conf/server.xml
>>
>> Martin--
>>
>>
>>
>>
>>
>> > Date: Tue, 3 Dec 2013 15:55:22 -0800
>> > Subject: Transfer-Encoding: chunked not working
>> > From: cbman...@gmail.com
>> > To: users@tomcat.apache.org
>> >
>> > Tomcat 7.0.47, OSX 10.8. Fresh install via homebrew. I'm running a web
>> app
>> > with Tomcat that is returning the header "Transfer-Encoding: chunked"
>> and
>> > seemingly exactly one 16384-byte chunk of content that is longer than
>> that.
>> > Consequently the page that should be transferred is not rendered by the
>> > user agent (Chrome in this case). AFAICT it's Tomcat that isn't sending
>> all
>> > the chunks properly. Why might it not be doing that? What else might be
>> the
>> > problem?
>> >
>> > --
>> > C. Benson Manica
>> > cbman...@gmail.com
>>
>>
>
>
>
> --
> C. Benson Manica
> cbman...@gmail.com
>



-- 
C. Benson Manica
cbman...@gmail.com


Re: Transfer-Encoding: chunked not working

2013-12-03 Thread C. Benson Manica


sure looks like 1.1 to me.


On Tue, Dec 3, 2013 at 4:38 PM, Martin Gainty  wrote:

> chunked only works on HTTP 1.1 connections
> display $CATALINA_HOME/conf/server.xml
>
> Martin--
>
>
>
>
>
> > Date: Tue, 3 Dec 2013 15:55:22 -0800
> > Subject: Transfer-Encoding: chunked not working
> > From: cbman...@gmail.com
> > To: users@tomcat.apache.org
> >
> > Tomcat 7.0.47, OSX 10.8. Fresh install via homebrew. I'm running a web
> app
> > with Tomcat that is returning the header "Transfer-Encoding: chunked" and
> > seemingly exactly one 16384-byte chunk of content that is longer than
> that.
> > Consequently the page that should be transferred is not rendered by the
> > user agent (Chrome in this case). AFAICT it's Tomcat that isn't sending
> all
> > the chunks properly. Why might it not be doing that? What else might be
> the
> > problem?
> >
> > --
> > C. Benson Manica
> > cbman...@gmail.com
>
>



-- 
C. Benson Manica
cbman...@gmail.com


RE: Transfer-Encoding: chunked not working

2013-12-03 Thread Martin Gainty
chunked only works on HTTP 1.1 connections
display $CATALINA_HOME/conf/server.xml

Martin-- 


  


> Date: Tue, 3 Dec 2013 15:55:22 -0800
> Subject: Transfer-Encoding: chunked not working
> From: cbman...@gmail.com
> To: users@tomcat.apache.org
> 
> Tomcat 7.0.47, OSX 10.8. Fresh install via homebrew. I'm running a web app
> with Tomcat that is returning the header "Transfer-Encoding: chunked" and
> seemingly exactly one 16384-byte chunk of content that is longer than that.
> Consequently the page that should be transferred is not rendered by the
> user agent (Chrome in this case). AFAICT it's Tomcat that isn't sending all
> the chunks properly. Why might it not be doing that? What else might be the
> problem?
> 
> -- 
> C. Benson Manica
> cbman...@gmail.com
  

Transfer-Encoding: chunked not working

2013-12-03 Thread C. Benson Manica
Tomcat 7.0.47, OSX 10.8. Fresh install via homebrew. I'm running a web app
with Tomcat that is returning the header "Transfer-Encoding: chunked" and
seemingly exactly one 16384-byte chunk of content that is longer than that.
Consequently the page that should be transferred is not rendered by the
user agent (Chrome in this case). AFAICT it's Tomcat that isn't sending all
the chunks properly. Why might it not be doing that? What else might be the
problem?

-- 
C. Benson Manica
cbman...@gmail.com


Re: wifi access to tomcat on wired mc

2013-12-03 Thread Dave Pawson
Yes, 192.168,1.xxx

http://dpawson.co.uk
xslt xsl-fo docbook FAQ


On 3 Dec 2013, at 19:29, Leo Donahue - OETX  
wrote:

>> -Original Message-
>> From: Dave Pawson [mailto:dave.paw...@gmail.com]
>> Subject: Re: wifi access to tomcat on wired mc
>>> 
>>> But you can't use the IP of your wired Tomcat box in a URL with port 8081 
>>> to get Tomcat to respond from your Windows 7 wireless laptop?  It just 
>>> times out?
>> 
>> Not that it times out, just that I can't get any data back using http, 
>> from browser.
>>   telnet ipAddress port also reports  'could not open connection'
>> 
>> 
>>> But if you make the same request from the other wired computer, that same 
>>> URL works fine?
>> 
>> No. I believe I corrected myself. From the wired windows box I cannot get 
>> access.
> 
> This is where the Linux people step in.  I'm assuming that all three of your 
> computers are on the same domain/workgroup?
> 
> -
> 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: Logging makes a grown man cry

2013-12-03 Thread Konstantin Kolinko
2013/12/3 Tomcat Random :
> Environment is RHEL6, Tomcat 7.0.42. There is only one webapp.
>
> I'm trying to implement log4j as per the instructions here (skipping step
> 5):
> http://tomcat.apache.org/tomcat-7.0-doc/logging.html#Using_Log4j
>
> Since I'm not using the Manager, I've removed the relevant logging lines
> from CATALINA_HOME/lib/log4j.properties, so it looks like this:
>
> _
> log4j.rootLogger=INFO, CATALINA
> (...)

> 1., 2.

Either filter by category names, or bundle its own
classloader-specific Log4J configuration with your own web application
(a WEB-INF/classes/log4j.properties file).


Seriously, the Log4J documentation and mailing lists are elsewhere,
http://logging.apache.org/log4j/1.2/mail-lists.html

I'd be best to ask newbie questions there, even though this mailing
list has a log of knowledgeable people that may occasionally help you.

>
> 3. Get rid of the empty localhost. file.
>

The configuration snippet that you provided does not have a "cluster"
appender. Thus it does not matches your list of log files.

Best regards,
Konstantin Kolinko

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



Re: Logging Best Practices on RHEL

2013-12-03 Thread Konstantin Kolinko
2013/11/30 Christopher Schultz :
>
> On 11/27/13, 5:00 PM, Tomcat Random wrote:
>
>> "I find java.logging to be... frankly frustrating to configure."
>> Totally agree, I feel like the Tomcat logging.properties file is
>> weirdly clunky.
>
> Yes. That's because out of the box it uses java.util.logging, or
> actually an adaptation of it. That choice was probably made to limit
> the number of 3rd-party (though log4j is ASF) libraries required to
> run Tomcat. Since java.util.logging comes with the JRE... may we wsll
> use it.
>

1) java.util.logging is always there, regardless of whether you use it
or not. Even if you do not use it, you need to know that it exists and
to be able to configure it.

An empty conf/logging.properties file (mentioned in the "Log4J"
section of the logging guide) is one of such explicit configurations.

2) Pure java.util.logging is frustrating at places.

First, it is hard to configure (from API point of view).

Tomcat's ClassLoaderLogManager solves this and makes it usable in
multi-classloader environments. Internally it is not pretty, using
ThreadLocals to pass information that cannot be passed via APIs, but
it fills the gap.

Note that ClassLoaderLogManager allows to use any 3-rd party
java.util.logging libraries. The default configuration uses
JRE-provided classes (e.g. ConsoleHandler).

A Syslog JUL handler should exist somewhere, and from quick googling
it does exist:

[1] 
http://stackoverflow.com/questions/2311697/is-there-a-robust-java-util-logging-handler-implementation-of-syslog
[2] http://code.google.com/p/agafua-syslog/


Second, it is hard to use java.util.logging APIs from the code that
generates log information.
The java.util.logging API is too generic and too limited in places.

E.g. there exists java.util.logging.Logger.warning(String)  method,
but there is no warning(String, Throwable) method.  One can call the
Logger.log(Level,...) method, but essentially, one needs an adapter
that provides more friendly interface.

Apache Tomcat uses Apache Commons Logging as an adapter here. The
commons logging classes are renamed into a different package, to avoid
conflict if a web application uses the same library.


3) Personally, my logging experience started with Log4J 1. It was when
Java 1.3 was the current version and java.util.logging did not exist.

I do not use Log4J nowadays (all my needs are covered by JULI and
Apache Commons Logging), but I still like to use their terminology
like "categories" and "appenders".

Best regards,
Konstantin Kolinko

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



RE: org.apache.catalina.filters.CorsFilter

2013-12-03 Thread spring
> > Just wanna now why the class is not loadable as
> > org.apache.catalina.filters.CorsFilter but as
> > com.apache.catalina.filters.CorsFilter (different dir in 
> classes of course).
> 
> Because Tomcat prevents web applications from replacing 
> container classes.

Ah, so we do have special rules for org.apache.catalina.filters.* (and other
tomcat packages/classes).

Thank you.


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



RE: wifi access to tomcat on wired mc

2013-12-03 Thread Leo Donahue - OETX
>-Original Message-
>From: Dave Pawson [mailto:dave.paw...@gmail.com]
>Subject: Re: wifi access to tomcat on wired mc
>>
>> But you can't use the IP of your wired Tomcat box in a URL with port 8081 to 
>> get Tomcat to respond from your Windows 7 wireless laptop?  It just times 
>> out?
>
>Not that it times out, just that I can't get any data back using http, 
>from browser.
>telnet ipAddress port also reports  'could not open connection'
>
>
>> But if you make the same request from the other wired computer, that same 
>> URL works fine?
>
>No. I believe I corrected myself. From the wired windows box I cannot get 
>access.

This is where the Linux people step in.  I'm assuming that all three of your 
computers are on the same domain/workgroup?

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



Re: wifi access to tomcat on wired mc

2013-12-03 Thread Dave Pawson
On 3 December 2013 17:48, Leo Donahue - OETX
 wrote:

> Reading back over your previous posts, you said you can ping the Linux box 
> from Windows 7 (aka your wireless laptop?):
> " ...ping works from both wired/wireless to the 'main' wired machine 
> containing the tomcat server"

Yes

>
> But you can't use the IP of your wired Tomcat box in a URL with port 8081 to 
> get Tomcat to respond from your Windows 7 wireless laptop?  It just times out?

 Not that it times out, just that I can't get any data back using
http, from browser.
telnet ipAddress port also reports  'could not open connection'


> But if you make the same request from the other wired computer, that same URL 
> works fine?

No. I believe I corrected myself. From the wired windows box I cannot get
access.
[May be of  use. I can 'share' a directory, using Samba. No idea what
protocol that uses. ]


>
> Sorry for making you repeat all of this.  One of your previous posts confused 
> me as to whether you could or could not do this.

My apologies. I profess mostly ignorance of internet protocols.


>
> From your wireless Windows 7 laptop, can you see a file share on the other 
> wired (non-Linux) box?  I'm just trying to rule out your network and/or your 
> vendor provided hardware.

OK. More trial (and learning).
>From the laptop I can 'share' (windows wise) with the wired windows box.
ditto I can 'see' the shared (samba) directory on the linux box.

HTH




-- 
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk

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



Re: Pooled Connections Lost After 10 Minutes (600 seconds)

2013-12-03 Thread Tomcat Random
Thanks, that's good to know, especially about the validationInterval
setting. The idea of not validating every single time seems more reasonable.

-Alec


On Tue, Dec 3, 2013 at 12:32 PM, Daniel Mikusa wrote:

> On Dec 3, 2013, at 12:14 PM, Tomcat Random 
> wrote:
>
> > I considered using a validation query but it seemed like extra overhead
> > when the default behavior was not, um, behaving in the default way.
>
> The overhead is typically minimal.  Running "SELECT 1" or some other very
> simply query is not likely to bring your database to it's knees.  It might
> add a small amount of latency as the pool will need to execute the query
> before it give the connection to your application, but that's likely to be
> dwarfed by whatever your application does with the connection after it gets
> it.
>
> If you are concerned you can do a couple things to make the process even
> more lightweight.
>
> 1.) With MySQL and use "/* ping */ SELECT 1" as the validation query.
>  This is a special case with the MySQL JDBC driver that uses even less
> resources.
>
> 2.) You can use the tomcat-jdbc connection pool which has a
> validationInterval setting.  This will ensure that the validation query is
> only executed one time during the specified time interval.
>
> ...or you can go without a validation query, but it's not something I
> would recommend and not something I see done very often.  The minimal
> overhead is usually worth knowing that you get a valid connection from the
> pool.
>
> Dan
>
> >
> > On Tue, Dec 3, 2013 at 7:24 AM, Daniel Mikusa 
> wrote:
> >
> >> On Dec 2, 2013 10:09 PM, "Neven Cvetkovic" 
> >> wrote:
> >>>
> >>> On Dec 2, 2013 12:47 PM, "Tomcat Random" 
> >> wrote:
> 
>  Neven, thank you.
> 
>  It was right there in my.cnf: 'wait_timeout=600'
> 
> >>>
> >>> You're welcome :)
> >>>
> >>> I am curious why tomcat didn't renew expired (terminated) idle
> >> connections
> >>> though.
> >>
> >> It wouldn't know that the connections have been disconnected, since they
> >> were disconnected server side.  If the user added a validation query
> then
> >> it could detect and remove the closed connections.
> >>
> >> Dan
> >>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: META-INF/context.xml & connection pool

2013-12-03 Thread Tomcat Random
The short answer is jars that are particular to a webapp can go in
WEB-INF/lib, however since database access is fairly common, your jdbc jars
and db specific driver jars should go above the webapp directory into
$TOMCAT_HOME/lib.

However, AFAIK some jars need to be in $TOMCAT_HOME/lib due to loading
order. The only problem you would encounter is it won't work, so you could
test it and see.

-Alec


On Thu, Nov 28, 2013 at 12:04 PM, Jose María Zaragoza
wrote:

> Hello:
>
> I'm using Tomcat 6.0.23
> Yes, I know is an old release
>
> Anyway, I would like to use tomcat-jdbc connection pool JAR
>
> So, I 've stored a context.xml into META-INF folder in my WAR, as
>
> 
>
>   factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
>  driverClassName="org.postgresql.Driver"
>  initialSize="0"  maxActive="100" maxIdle="20" maxWait="1" mindIdle="0"
>  name="datasource/ddbb" password="" removeAbandoned="true"
>  url="jdbc:postgresql://localhost:5433/ddbb?LoginTimeout=3"
>  username="uu" validationQuery="SELECT 1" testOnBorrow="true" />
>
> 
>
> My question is
>
> should I store JAR ( tomcat-jdbc-x.x.x.jar & tomcat-juli-x.x.x.jar )
> into WEB-INF/lib folder in WAR
> or into $TOMCAT_HOME/lb folder ?
>
> Could there be a problem by store them into the own WAR ( WEB-INF/lib ) ?
>
>
> Thanks and regards
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Logging makes a grown man cry

2013-12-03 Thread Tomcat Random
Environment is RHEL6, Tomcat 7.0.42. There is only one webapp.

I'm trying to implement log4j as per the instructions here (skipping step
5):
http://tomcat.apache.org/tomcat-7.0-doc/logging.html#Using_Log4j

Since I'm not using the Manager, I've removed the relevant logging lines
from CATALINA_HOME/lib/log4j.properties, so it looks like this:

_
log4j.rootLogger=INFO, CATALINA

# Define all the appenders
log4j.appender.CATALINA=org.apache.log4j.DailyRollingFileAppender
log4j.appender.CATALINA.File=${catalina.base}/logs/catalina.
log4j.appender.CATALINA.Append=true
log4j.appender.CATALINA.Encoding=UTF-8
# Roll-over the log once per day
log4j.appender.CATALINA.DatePattern='.'-MM-dd'.log'
log4j.appender.CATALINA.layout = org.apache.log4j.PatternLayout
log4j.appender.CATALINA.layout.ConversionPattern = %d [%t] %-5p %c- %m%n

log4j.appender.LOCALHOST=org.apache.log4j.DailyRollingFileAppender
log4j.appender.LOCALHOST.File=${catalina.base}/logs/localhost.
log4j.appender.LOCALHOST.Append=true
log4j.appender.LOCALHOST.Encoding=UTF-8
log4j.appender.LOCALHOST.DatePattern='.'-MM-dd'.log'
log4j.appender.LOCALHOST.layout = org.apache.log4j.PatternLayout
log4j.appender.LOCALHOST.layout.ConversionPattern = %d [%t] %-5p %c- %m%n

log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.Encoding=UTF-8
log4j.appender.CONSOLE.layout = org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern = %d [%t] %-5p %c- %m%n

# Configure which loggers log to which appenders
log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost]=INFO,
LOCALHOST
_

On restart, my (deleted-beforehand) logs directory looks like this:

/logs/catalina.
/logs/catalina.2013-12-03.log
/logs/catalina.out
/logs/cluster.2013-12-03.log
/logs/localhost.
/logs/localhost_access_log.2013-12-03.txt
_

Ok, so this isn't what I want. First there are three "catalina*" files.
Each has different aspects of my app and/or server.

The "catalina." file has info about NIO, the deltamanager, as well as my
application logging code (e.g.,logger.warn("hello world");).

"catalina.2013-12-03.log" has a few lines about starting and stopping the
server like:
"A valid shutdown command was received via the shutdown port. Stopping the
Server instance."

"catalina.out" has spymemcached logging info (I haven't changed the
spymemcached  system property yet to log4j so that might be why).

"cluster.2013-12-03.log" is behaving normally. "localhost." is empty. And
the daily access log is good.

So, all I want is to have:

1. one log file that rolls daily (a new file each day), with the date
appended, that catches my own logging code in the app, based on a global
logging level value that I can change (DEBUG, or INFO, or ERROR etc) as
needed.

2. Another log file that rolls daily and consolidates any other output of
the server and app (or two separate files) and also has a logging level
value that can be changed globally.

3. Get rid of the empty localhost. file.

MTIA,
Alec


Re: org.apache.catalina.filters.CorsFilter

2013-12-03 Thread Mark Thomas
On 03/12/2013 17:41, spr...@gmx.eu wrote:
>> Exactly where?  The full path is needed here.
> 
> TOMCAT/webapps/myapp/WEB-INF/classes/org/apache/catalina/filters/CorsFilter.
> class
> 
>> Rather than mucking about with an old Tomcat version, just 
>> throw away the 3rd-party repackaged crap and install the 
>> current one from tomcat.apache.org; it will make everyone's 
>> life simpler.
> 
> Just wanna now why the class is not loadable as
> org.apache.catalina.filters.CorsFilter but as
> com.apache.catalina.filters.CorsFilter (different dir in classes of course).

Because Tomcat prevents web applications from replacing container classes.

Mark


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



RE: wifi access to tomcat on wired mc

2013-12-03 Thread Leo Donahue - OETX
>-Original Message-
>From: Dave Pawson [mailto:dave.paw...@gmail.com]
>Subject: Re: wifi access to tomcat on wired mc
>>
>> ISP > | inside your house | > your ISP provided wifi /router > 
>> your
>computers?
>
>The latter.
>
>router to linux (tomcat) is wired.
>router to windows laptop box is wifi
>router to windows box also wired.
>

Reading back over your previous posts, you said you can ping the Linux box from 
Windows 7 (aka your wireless laptop?):
" ...ping works from both wired/wireless to the 'main' wired machine containing 
the tomcat server"

But you can't use the IP of your wired Tomcat box in a URL with port 8081 to 
get Tomcat to respond from your Windows 7 wireless laptop?  It just times out?
But if you make the same request from the other wired computer, that same URL 
works fine?

Sorry for making you repeat all of this.  One of your previous posts confused 
me as to whether you could or could not do this.

From your wireless Windows 7 laptop, can you see a file share on the other 
wired (non-Linux) box?  I'm just trying to rule out your network and/or your 
vendor provided hardware.


RE: org.apache.catalina.filters.CorsFilter

2013-12-03 Thread spring
> Exactly where?  The full path is needed here.

TOMCAT/webapps/myapp/WEB-INF/classes/org/apache/catalina/filters/CorsFilter.
class

> Rather than mucking about with an old Tomcat version, just 
> throw away the 3rd-party repackaged crap and install the 
> current one from tomcat.apache.org; it will make everyone's 
> life simpler.

Just wanna now why the class is not loadable as
org.apache.catalina.filters.CorsFilter but as
com.apache.catalina.filters.CorsFilter (different dir in classes of course).


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



Re: Pooled Connections Lost After 10 Minutes (600 seconds)

2013-12-03 Thread Daniel Mikusa
On Dec 3, 2013, at 12:14 PM, Tomcat Random  wrote:

> I considered using a validation query but it seemed like extra overhead
> when the default behavior was not, um, behaving in the default way.

The overhead is typically minimal.  Running "SELECT 1" or some other very 
simply query is not likely to bring your database to it's knees.  It might add 
a small amount of latency as the pool will need to execute the query before it 
give the connection to your application, but that's likely to be dwarfed by 
whatever your application does with the connection after it gets it.

If you are concerned you can do a couple things to make the process even more 
lightweight.

1.) With MySQL and use "/* ping */ SELECT 1" as the validation query.  This is 
a special case with the MySQL JDBC driver that uses even less resources.

2.) You can use the tomcat-jdbc connection pool which has a validationInterval 
setting.  This will ensure that the validation query is only executed one time 
during the specified time interval.  

...or you can go without a validation query, but it's not something I would 
recommend and not something I see done very often.  The minimal overhead is 
usually worth knowing that you get a valid connection from the pool.

Dan

> 
> On Tue, Dec 3, 2013 at 7:24 AM, Daniel Mikusa  wrote:
> 
>> On Dec 2, 2013 10:09 PM, "Neven Cvetkovic" 
>> wrote:
>>> 
>>> On Dec 2, 2013 12:47 PM, "Tomcat Random" 
>> wrote:
 
 Neven, thank you.
 
 It was right there in my.cnf: 'wait_timeout=600'
 
>>> 
>>> You're welcome :)
>>> 
>>> I am curious why tomcat didn't renew expired (terminated) idle
>> connections
>>> though.
>> 
>> It wouldn't know that the connections have been disconnected, since they
>> were disconnected server side.  If the user added a validation query then
>> it could detect and remove the closed connections.
>> 
>> Dan
>> 


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



Re: wifi access to tomcat on wired mc

2013-12-03 Thread Dave Pawson
On 3 December 2013 17:18, Leo Donahue - OETX
 wrote:

> Would it maybe be possible to give us a line diagram of your request from 
> your windows box through your hardware to your Tomcat on Linux?
>
> For example, you are using a vendor supplied wireless router?  I am sure my 
> ISP blocks all 8080 type traffic to my cable modem and I wouldn't put it past 
> them to enable something like that in the hardware I would rent from them 
> (which I don't).
>
> Is your diagram something like this:

> Or is it this:
>
> ISP > | inside your house | > your ISP provided wifi /router > 
> your computers?

The latter.

router to linux (tomcat) is wired.
router to windows laptop box is wifi
router to windows box also wired.

HTH



-- 
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk

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



Re: Logging Best Practices on RHEL

2013-12-03 Thread Tomcat Random
Chris, thanks. That's good to know since I just implemented 1.2.17.


On Mon, Dec 2, 2013 at 5:27 PM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Alec,
>
> On 12/2/13, 3:48 PM, Tomcat Random wrote:
> > Thanks Chris, Are you using log4j 1.x or 2.beta?
>
> I've been using 1.x for quite a long time. I haven't looked much into
> the new version. I'd be surprised if it's a mind-blowing upgrade. :)
>
> - -chris
>
> > On Fri, Nov 29, 2013 at 6:06 PM, Christopher Schultz <
> > ch...@christopherschultz.net> wrote:
> >
> > Alec,
> >
> > On 11/27/13, 5:00 PM, Tomcat Random wrote:
>  Thanks Dave, I'll take a look at it.
> 
>  Chris, thanks as well. Out of curiosity, do either of you
>  know if/how you'd consolidate logging for things like say
>  clustering. I have clustering configured for two physical
>  servers each running an instance of tomcat. I have logging
>  configured as per the clustering docs, and it works, but I'm
>  not clear on how it would be reported by log4j, instead of
>  JULI.
> >
> > For my money, I'd use log4j's syslog appender and use syslog to
> > aggregate everything on a single server. I'd have no idea where to
> > begin to use JULI for that, but I'm sure that's more because I have
> > a greater familiarity with log4j.
> >
>  "I find java.logging to be... frankly frustrating to
>  configure." Totally agree, I feel like the Tomcat
>  logging.properties file is weirdly clunky.
> >
> > Yes. That's because out of the box it uses java.util.logging, or
> > actually an adaptation of it. That choice was probably made to
> > limit the number of 3rd-party (though log4j is ASF) libraries
> > required to run Tomcat. Since java.util.logging comes with the
> > JRE... may we wsll use it.
> >
> > -chris
> >>
> >> -
> >>
> >>
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> >> For additional commands, e-mail: users-h...@tomcat.apache.org
> >>
> >>
> >
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.15 (Darwin)
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQIcBAEBCAAGBQJSnQleAAoJEBzwKT+lPKRYm5sP/1kmwvayu1pRI/F247WYv6B3
> bsLJo2jEFiWINxpvkhIAgqPHAwBIwGKoepWdnZFtQVzXxbxy5yCzP0P9eFOCBbUk
> KDSrEdHK+eu+Py6BoSntvT7wtpV/7pzzGDDR1v0CzyHjuy0OV60NUv5F2zDsukp/
> ls/9pi0WO5ncns4BShj/eu51IDTyZUQP6k8wamTqRx4HaFWdMGdYbrNTq3jtuP+p
> gpwTjO45bE1PGE8BthRzOE4v11cNpJhS6spNaK/Qy61EaTSXfGAtg0ZSQbcx1HK9
> r4lJZ0CQVL2oXWVat0cN9Ipy5q82Zw8PTfXUF66Vrx/1qdsSXdS4ceFwe2DaVLUn
> xIOrb0zd8PKXyGIRvlmLuVNX/vioYFF43T5SNlj51rIFhQ7oeu/F+tvqRqztdC8g
> snkLWa4vHGNwmbhy6FepP6CXmXCiWgtU0UzP1S6yFsWlVgR+dJJ/4rVtOhwh3/T0
> I7KdPYWwmoJYvULA7GDbtsR9zrN42wdSSFXdhrg5STImA5+O8lky6xO5UEWvvSuw
> NWLzhb+cGDkrdvKtyPzGtH4EJayItUlYXMDjG6xwla6LHxi27FD3gV+uJxVlgoVU
> yxRMcdG1f2Z087Gl/XNCkhy7TmO4RDIUqL/9wwjOSfD1SvVMa8B9SyY6+qz7f8ag
> bOpbUovSflMUfKCfz8KR
> =DCTU
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


RE: wifi access to tomcat on wired mc

2013-12-03 Thread Leo Donahue - OETX
>-Original Message-
>From: Dave Pawson [mailto:dave.paw...@gmail.com]
>Subject: Re: wifi access to tomcat on wired mc
>
>Yes... (as far as I know - unloaded Zonealarm altogether. Still nothing).
>I have a wifi / router in the game too. It's not a commercial one, it was 
>provided
>by the ISP, so no passthrough ip lists...
>I am suspicious of that.
>

Would it maybe be possible to give us a line diagram of your request from your 
windows box through your hardware to your Tomcat on Linux?

For example, you are using a vendor supplied wireless router?  I am sure my ISP 
blocks all 8080 type traffic to my cable modem and I wouldn't put it past them 
to enable something like that in the hardware I would rent from them (which I 
don't).

Is your diagram something like this:

ISP > | inside your house | > your ISP provided wifi /router > 
switch maybe or other router of your own (?) > your computers?

Or is it this:

ISP > | inside your house | > your ISP provided wifi /router > your 
computers?

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



Re: Pooled Connections Lost After 10 Minutes (600 seconds)

2013-12-03 Thread Tomcat Random
I considered using a validation query but it seemed like extra overhead
when the default behavior was not, um, behaving in the default way.

-Alec


On Tue, Dec 3, 2013 at 7:24 AM, Daniel Mikusa  wrote:

> On Dec 2, 2013 10:09 PM, "Neven Cvetkovic" 
> wrote:
> >
> > On Dec 2, 2013 12:47 PM, "Tomcat Random" 
> wrote:
> > >
> > > Neven, thank you.
> > >
> > > It was right there in my.cnf: 'wait_timeout=600'
> > >
> >
> > You're welcome :)
> >
> > I am curious why tomcat didn't renew expired (terminated) idle
> connections
> > though.
>
> It wouldn't know that the connections have been disconnected, since they
> were disconnected server side.  If the user added a validation query then
> it could detect and remove the closed connections.
>
> Dan
>


Re: wifi access to tomcat on wired mc

2013-12-03 Thread Dave Pawson
On 3 December 2013 14:46, Christopher Schultz
 wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Chuck,
>
> On 12/3/13, 9:39 AM, Caldarale, Charles R wrote:
>>> From: Leo Donahue - OETX [mailto:leodona...@mail.maricopa.gov]
>>> Subject: RE: wifi access to tomcat on wired mc
>>
>>> Have you tried disabling the windows firewall altogether to rule
>>> it out as the problem?
>>
>> The OP may well have more than one firewall active on the Windows
>> box, if I interpreted his previous postings correctly.
>
> +1
>
> Also iptables on the Linux box, but I'm still confused as to what
> exactly does and does not work. It seems the OP gives conflicting
> information with every additional post.

Confusion leading to conflicting?
I.e. I don't know what is / isn't getting in the way.
Window to Linux (tomcat)

1. I believe windows firewall is switched off (Zonealarm does that
on request)
2. Zonealarm firewall. Not exactly clear how to get that to pass through
... AFAIK that just needs incoming ip:8080 ( main tc port) - no others.
outgoing 'this machine' to ip address
3. British Telecom router (unable to find anything to set)
4. Fedora Linux. There is a firewall. No ideas on iptables.

Hence my confusion?

regards




-- 
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk

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



Re: wifi access to tomcat on wired mc

2013-12-03 Thread Dave Pawson
On 3 December 2013 14:21, Leo Donahue - OETX
 wrote:
>>-Original Message-
>>From: Dave Pawson [mailto:dave.paw...@gmail.com]
>>Subject: Re: wifi access to tomcat on wired mc
>>
>>Thanks Chuck.
>>Back to playing with Windows firewalls.
>>
>
> Have you tried disabling the windows firewall altogether to rule it out as 
> the problem?
>
> Leo

Hi Leo

Yes... (as far as I know - unloaded Zonealarm altogether. Still nothing).
I have a wifi / router in the game too. It's not a commercial one,
it was provided by the ISP, so no passthrough ip lists...
I am suspicious of that.

regards






-- 
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk

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



RE: wifi access to tomcat on wired mc

2013-12-03 Thread Leo Donahue - OETX
>-Original Message-
>From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com]
>Subject: RE: wifi access to tomcat on wired mc
>
>> From: Leo Donahue - OETX [mailto:leodona...@mail.maricopa.gov]
>> Subject: RE: wifi access to tomcat on wired mc
>
>> Have you tried disabling the windows firewall altogether to rule it out as 
>> the
>problem?
>
>The OP may well have more than one firewall active on the Windows box, if I
>interpreted his previous postings correctly.
>
> - Chuck

Yes, I forgot to mention also disabling his "zone alarm" product.

Leo

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



Re: wifi access to tomcat on wired mc

2013-12-03 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Chuck,

On 12/3/13, 9:39 AM, Caldarale, Charles R wrote:
>> From: Leo Donahue - OETX [mailto:leodona...@mail.maricopa.gov] 
>> Subject: RE: wifi access to tomcat on wired mc
> 
>> Have you tried disabling the windows firewall altogether to rule
>> it out as the problem?
> 
> The OP may well have more than one firewall active on the Windows
> box, if I interpreted his previous postings correctly.

+1

Also iptables on the Linux box, but I'm still confused as to what
exactly does and does not work. It seems the OP gives conflicting
information with every additional post.

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

iQIcBAEBCAAGBQJSne7VAAoJEBzwKT+lPKRYcNgP/3VIIKUphETcF5Y3qm0XHv1C
cryHusGuj1Dsn9vtC44MFoPUjNXrIVb3igaZztD/PrB+tur6kqcnN6n9ILQgRbxn
athEuiSJtFY+CKzf57aUKyraoYmqXbyFDTeXlpG/amyfXzGpbe2Hr849TdFE0RE6
NrpawNf2du8adNxUzy2jUwQpAOxBsrn5UENrr6EB4AzQEGRSEVFM1My0HKIth6dK
c4fe2hF7TbwBJQezXdaQ1OrbgT/wy2Fn9WzGGdQdkkwb09KhF7Ry1YJQYxDHMS5E
X+D81bZ3eVkEVDDLF2i2MX/IVMZBn0X1oiF8b8rWnG6T66UZCkMAaxDpo/JHgGoF
6qowtgpC4RQBJUIi7CPDy/lMhaAYDXQ1qyPClINuT7z1OUbPnOW3/hhgXvFwNVK+
jtDlmofqRMsqc/kSxAUhSrvVEsqACHDfq/GmVFoTPCkm/53IKcATBF2J2cLWVT0X
b+2ojJf6IdUJ0xow3wFEveHA+YCncVlvoqM5wbb3mveFz4qsZOCdvv94ou9Rilua
bmrz62HlUBALQAjUu+h3Ol/3gnnfrGc0DF67cfat5yptoEOdLuNQpC7IN6wK1I/a
e1M9t4K6m6Oj6Wo6yMepsqUfjwXwRYSD7RvabtR20depRnkQ6Ks4TCJSHCdfOosk
CtYRYuqTmqa/9Cp9I8BA
=otwK
-END PGP SIGNATURE-

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



RE: wifi access to tomcat on wired mc

2013-12-03 Thread Caldarale, Charles R
> From: Leo Donahue - OETX [mailto:leodona...@mail.maricopa.gov] 
> Subject: RE: wifi access to tomcat on wired mc

> Have you tried disabling the windows firewall altogether to rule it out as 
> the problem?

The OP may well have more than one firewall active on the Windows box, if I 
interpreted his previous postings correctly.

 - 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: wifi access to tomcat on wired mc

2013-12-03 Thread Leo Donahue - OETX
>-Original Message-
>From: Dave Pawson [mailto:dave.paw...@gmail.com]
>Subject: Re: wifi access to tomcat on wired mc
>
>Thanks Chuck.
>Back to playing with Windows firewalls.
>

Have you tried disabling the windows firewall altogether to rule it out as the 
problem?

Leo

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



Re: Pooled Connections Lost After 10 Minutes (600 seconds)

2013-12-03 Thread Daniel Mikusa
On Dec 2, 2013 10:09 PM, "Neven Cvetkovic" 
wrote:
>
> On Dec 2, 2013 12:47 PM, "Tomcat Random"  wrote:
> >
> > Neven, thank you.
> >
> > It was right there in my.cnf: 'wait_timeout=600'
> >
>
> You're welcome :)
>
> I am curious why tomcat didn't renew expired (terminated) idle connections
> though.

It wouldn't know that the connections have been disconnected, since they
were disconnected server side.  If the user added a validation query then
it could detect and remove the closed connections.

Dan


Re: Exception in CoyoteAdapter class

2013-12-03 Thread Mark Thomas
On 03/12/2013 10:25, at.silk wrote:
> Hi,
> 
> I contact you to talk about an exception we receive in a Tomcat class. Few 
> days ago we get an error in an application integrated with Tomcat. We have 
> tried to get information about it but we don't find any solution, so we would 
> like to know if you are aware about this issue. 
> 
> First we describe our scenario:
> 1. User logs in the portal and remain static for more than 30 minutes (30 
> minutes is session expiration time).
> 2. Afterwards, he refreshes the webpage and session has been expired.
> 3. During the page reloading, an error occurs while executing the 
> "parseSessionSslId" method because the "SSLSupport.SESSION_ID_KEY" is empty.
> 4. A blank page is displayed because the error is not caught.

How is that possible? If there is no SSL session the client should not
be able to send a request to Tomcat since that would mean that the HTTPS
connection had not been established. Since this code is only triggered
when parsing a request from the client this error should never be observed.

Mark


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



Exception in CoyoteAdapter class

2013-12-03 Thread at.silk
Hi,

I contact you to talk about an exception we receive in a Tomcat class. Few days 
ago we get an error in an application integrated with Tomcat. We have tried to 
get information about it but we don't find any solution, so we would like to 
know if you are aware about this issue. 

First we describe our scenario:
1. User logs in the portal and remain static for more than 30 minutes (30 
minutes is session expiration time).
2. Afterwards, he refreshes the webpage and session has been expired.
3. During the page reloading, an error occurs while executing the 
"parseSessionSslId" method because the "SSLSupport.SESSION_ID_KEY" is empty.
4. A blank page is displayed because the error is not caught.

The exception produced during step 3 belongs to this section:
 [org\apache\catalina\connector\CoyoteAdapter.java]
  Method parseSessionSslId:

request.setRequestedSessionId(request.getAttribute(SSLSupport.SESSION_ID_KEY).toString());
request.setRequestedSessionSSL(true);

This is our context:
- Tomcat version: 7.0.25
- OS: Linux distribution
- Liferay 6.1GA1 portal integrated with Tomcat
- We don't negotiate user session by the sessionid with the cookie but with the 
certificate.

Our server.xml configuration file contains the following connectors:



Conclusion:
The exception is raised when the session id is empty due to we have an expired 
session. We have compiled this code section with a try catch and now our 
application does not receive the error, and we can see our page displayed, 
obviously with session expired.

Do you think this could be due to some local configuration or is it a general 
issue?
Is there the possibility to contemplate this case to be protected when 
sessionId is null?

Thanks and kind regards,
AT silk.

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



Re: Same realm for three different countries

2013-12-03 Thread André Warnier

Stefan Frei wrote:

do you see a entry point where to start ?
i already have a customRealm


I would look at the problem in a different way, and set up 3 virtual hosts, one for each 
country.  Then it is just a configuration change, nothing in the code.





2013/12/2 Christopher Schultz :

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Stefani,

On 12/2/13, 2:23 PM, Stefan Frei wrote:

tomcat 7.0.42

debian

I have the same webapplication responsible for providing services
fro three different countries.

Therefore 3 slightly different database schemes exist on my mysql
instance.

one for ch(switzerland), one for de(germany) and one for
at(austria).

now my auth-realm which extends RealmBase should be able to decide
to which schema to connect to, depending on the requested url.

for example requests to webapp.ch should use the table users in
schema ch.

how am i able to read out httprequest or session in the realm to
identify for which country the request is destined?

The short answer is that you can't, at least with Tomcat's stock Realm
implementations.

You can hack your own Realm, but you'll also need to hack around a bit
more, since the Realm itself doesn't get any access to the servlet
request information.

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

iQIcBAEBCAAGBQJSnQpPAAoJEBzwKT+lPKRYOV0QAJ0ZkCM4eFRrEOX5dbJyXgYK
evyIEKju8jd6N3rbOfWx3XKua0Nau0H18Yb6gCrQc94OGyHTJFP1gfPkDL4eTaHu
FXQJvWgrNUjHHifXaNmcATef6GeHhchSply6KbP0s8uYjINgS3eGCUJmk6mS0ZU+
W7VMIXE184kaQcOYJ6OIFwFhGkEuMEajRa7iGkWxQYxhi9VCXgb8a0hZ9uLO00rm
Nt/J54G2aE32UTNhEti0sBIwJC9pnddsV9WWv84jSBN/FhKNf5fHc7CskpB9wRGR
mwSHFhiKpZv60MnswiN9DO2vvCkNBhSE7XSaj/aBsw6aOkxV8w4zE+FbogoFDZZU
yDqY/kY4LH5tAfddx+9w7shtLsYlgpC8NjF5KMURuJuhw8TOvd3+vzzRq2gEB2Zs
iseOnfGAvwd1EVZacaMgmaCbqCFcsUvAFx2j4/f5CX1CcPOQT4hE7Tu+UCTbIzGA
JY3NduFCWR1k9qG07wGtyAP2osz6C9seDYI059Vu5YsOT7V8NpsTROKi+34kMjs4
wI1J3TqYaJ/2WHMKGvH1r8+2LUg7R5PPBuUrQ4eanU5t1fKmzr7f8VDrOtW1PLW/
TYg/R9LfX88+u5/L6LqUomC7+mJ1dkihDmel6yM4bgEna6vV2kbw4ro/CCQWvJOj
MlrsH8tRc7Ven339Wj0S
=Ps8Q
-END PGP SIGNATURE-

-
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





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



Re: Same realm for three different countries

2013-12-03 Thread Stefan Frei
Hello
thanks for your all help.
I think the solution is possible with the username.

when i use "firstname.lastn...@webapp.ch" i can evaluate that in the
realm and the changes i have to made are not that hard.


Cheers

Stefan

2013/12/3 Martin Gainty :
> $CATALINA_HOME/src>grep -S -l locale *Realm*.*
> ---Nichts---
>
>
>
> Im going to take agree with Chris
>
> 2 options:
> 1)Make a 'Enhancement Request' to introduce localisation parameter for 
> Realm
> 2)code the localisation parameter into CustomRealm yourself and submit a patch
>
>
>
> http://tomcat.apache.org/bugreport.html#How_to_submit_patches_and_enhancement_requests
>
>
>
> Viel Gluck!
> Martin
> __
> Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
>
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
> sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
> oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich 
> dem Austausch von Informationen und entfaltet keine rechtliche 
> Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen 
> wir keine Haftung fuer den Inhalt uebernehmen.
>
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
> destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
> l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci 
> est interdite. Ce message sert à l'information seulement et n'aura pas 
> n'importe quel effet légalement obligatoire. Étant donné que les email 
> peuvent facilement être sujets à la manipulation, nous ne pouvons accepter 
> aucune responsabilité pour le contenu fourni.
>
>
>
>
>> Date: Mon, 2 Dec 2013 23:40:59 +0100
>> Subject: Re: Same realm for three different countries
>> From: stefan.a.f...@gmail.com
>> To: users@tomcat.apache.org
>>
>> do you see a entry point where to start ?
>> i already have a customRealm
>>
>> 2013/12/2 Christopher Schultz :
>> > -BEGIN PGP SIGNED MESSAGE-
>> > Hash: SHA256
>> >
>> > Stefani,
>> >
>> > On 12/2/13, 2:23 PM, Stefan Frei wrote:
>> >> tomcat 7.0.42
>> >>
>> >> debian
>> >>
>> >> I have the same webapplication responsible for providing services
>> >> fro three different countries.
>> >>
>> >> Therefore 3 slightly different database schemes exist on my mysql
>> >> instance.
>> >>
>> >> one for ch(switzerland), one for de(germany) and one for
>> >> at(austria).
>> >>
>> >> now my auth-realm which extends RealmBase should be able to decide
>> >> to which schema to connect to, depending on the requested url.
>> >>
>> >> for example requests to webapp.ch should use the table users in
>> >> schema ch.
>> >>
>> >> how am i able to read out httprequest or session in the realm to
>> >> identify for which country the request is destined?
>> >
>> > The short answer is that you can't, at least with Tomcat's stock Realm
>> > implementations.
>> >
>> > You can hack your own Realm, but you'll also need to hack around a bit
>> > more, since the Realm itself doesn't get any access to the servlet
>> > request information.
>> >
>> > - -chris
>> > -BEGIN PGP SIGNATURE-
>> > Version: GnuPG v1.4.15 (Darwin)
>> > Comment: GPGTools - http://gpgtools.org
>> > Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>> >
>> > iQIcBAEBCAAGBQJSnQpPAAoJEBzwKT+lPKRYOV0QAJ0ZkCM4eFRrEOX5dbJyXgYK
>> > evyIEKju8jd6N3rbOfWx3XKua0Nau0H18Yb6gCrQc94OGyHTJFP1gfPkDL4eTaHu
>> > FXQJvWgrNUjHHifXaNmcATef6GeHhchSply6KbP0s8uYjINgS3eGCUJmk6mS0ZU+
>> > W7VMIXE184kaQcOYJ6OIFwFhGkEuMEajRa7iGkWxQYxhi9VCXgb8a0hZ9uLO00rm
>> > Nt/J54G2aE32UTNhEti0sBIwJC9pnddsV9WWv84jSBN/FhKNf5fHc7CskpB9wRGR
>> > mwSHFhiKpZv60MnswiN9DO2vvCkNBhSE7XSaj/aBsw6aOkxV8w4zE+FbogoFDZZU
>> > yDqY/kY4LH5tAfddx+9w7shtLsYlgpC8NjF5KMURuJuhw8TOvd3+vzzRq2gEB2Zs
>> > iseOnfGAvwd1EVZacaMgmaCbqCFcsUvAFx2j4/f5CX1CcPOQT4hE7Tu+UCTbIzGA
>> > JY3NduFCWR1k9qG07wGtyAP2osz6C9seDYI059Vu5YsOT7V8NpsTROKi+34kMjs4
>> > wI1J3TqYaJ/2WHMKGvH1r8+2LUg7R5PPBuUrQ4eanU5t1fKmzr7f8VDrOtW1PLW/
>> > TYg/R9LfX88+u5/L6LqUomC7+mJ1dkihDmel6yM4bgEna6vV2kbw4ro/CCQWvJOj
>> > MlrsH8tRc7Ven339Wj0S
>> > =Ps8Q
>> > -END PGP SIGNATURE-
>> >
>> > -
>> > 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
>>
>

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