A question regarding websocket implementation of Apache Tomcat 8.0.33

2016-05-11 Thread Tejas Nandanikar
I am using Apache Tomcat 8.0.33.
I was going through Java documentation about RemoteEndpoint.Basic
which says that sendText(String text) blocks until all of the message
has been transmitted.
But I noticed that when the client loses internet connection and
sendText() method is called on the server side, it doesn't thrown an
IOException immediately and the method returns normally.
IOException is thrown later and the onError() method is called. Is
this a normal behaviour? Shouldn't the sendText() method block until
all the message has been transmitted successfully or throw an
IOException immediately if there's any problem?

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



Re: Unable to retrieve X-Forwarded-For in Tomcat 8.0 access log

2016-05-11 Thread Igor Cicimov
On Thu, May 12, 2016 at 4:47 AM, Abhijit Das  wrote:

>
> down vote
>  <>favorite
>  <
> https://stackoverflow.com/questions/37170742/unable-to-retrieve-x-forwarded-for-in-tomcat-8-0-access-log#
> >
> I am injecting a header with a rewrite policy on my LB to pass
> X-Forwarded-For header. Have verified that this appears on all the pages in
> the RESPONSE Header.
>
> I have the following config in server.xml , yet i am not able to see the
> Remote IP/X-Forwarded-For either using %a or %h (I see Loadbalancer IP)
>
> What could be the issue?
>
>internalProxies="10\.202\.13\.198"
>   remoteIpHeader="X-Forwarded-For"
>   proxiesHeader="x-forwarded-by"
>   requestAttributesEnabled="true"
> />
>directory="logs"
>   prefix="localhost_access_log"
>   suffix=".txt"
>   pattern="%t %a %h %{Referer}i %l %S %{User-Agent}i %U %s %r
> %q %A %v %p %b %I %D"
>   requestAttributeEnabled="true"
>   resolveHosts="false"/>
> Log ::
>
> [11/May/2016:11:29:39 -0700] 10.202.13.198 10.202.13.198 https:///index.action
> - 04B3ADCF82A212C6ECD9679BF260732D Mozilla/5.0 (Macintosh; Intel Mac OS X
> 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.86
> Safari/537.36 /rest/mywork/latest/status/notification/count 200 GET
> /rest/mywork/latest/status/notification/count HTTP/1.1 10.202.10.17 443 72
> http-nio-8443-exec-17 13
>
> As you see : both %a and % h are : 10.202.13.198 10.202.13.198 (my LB IP)
>
>
> Snippet of my Resonse Header: showing my LB policy is injecting the
> X-Forwarded-For header.
>
> Cache-Control:private
> Content-Encoding:gzip
> Content-Type:application/json
> Date:Wed, 11 May 2016 17:58:55 GMT
> Expires:Wed, 31 Dec 1969 16:00:00 PST
> Server:Apache-Coyote/1.1
> Strict-Transport-Security:max-age=31536000; includeSubDomains
> Transfer-Encoding:chunked
> Vary:User-Agent
> X-AUSERNAME:admin
> X-App-Cluster-Node:4e77b660
> X-App-Cluster-Node-Name:app_prod_clus_node3
> X-Content-Type-Options:nosniff
> X-Forwarded-For:1.1.1.1
> X-Seraph-LoginReason:OK
>
>
Correct me if I've maybe misunderstood something but I have the same case
and I just chuck %{X-Forwarded-For}i in the pattern to capture the header.


Re: tomcat(7.0.56) is not releasing idle jdbc connections

2016-05-11 Thread Igor Cicimov
On 12 May 2016 9:00 am, "Igor Cicimov"  wrote:
>
>
> On 12 May 2016 12:16 am, "Niranjan Babu Bommu" 
wrote:
> >
> > I tried the same config on test stacks. numidle always "10" why it is
> > behaving differently in prod?
> >
> Are you sure your testing db config is identical to the prod one?
>
> >  >   auth="Container"
> >   type="javax.sql.DataSource"
> >   testWhileIdle="true"
> >   testOnBorrow="true"
> >   testOnReturn="false"
> >   fairQueue="false"
> >   validationQuery="SELECT 1"
> >   validationInterval="3"
> >   timeBetweenEvictionRunsMillis="3"
> >   maxActive="100"

Also according to your setup you can have up to 100 connections and since
this is a pool the connections will stay open and reused.

Regarding difference with test environment I assume it is simply because
you have different load ie much lower than prod hence less connections.

> >   maxIdle="10"
> >   minIdle="10"
> >   maxWait="1"
> >   initialSize="10"
> >   removeAbandonedTimeout="60"
> >   removeAbandoned="true"
> >   logAbandoned="true"
> >   minEvictableIdleTimeMillis="30"
> >   jmxEnabled="true"
> >
> >
jdbcInterceptors="ConnectionState;StatementFinalizer;ResetAbandonedTimer"
> >   username=""
> >   password=""
> >   driverClassName="com.mysql.jdbc.Driver"
> >
> >
url="jdbc:mysql:///?useServerPrepStmts=false&useOldAliasMetadataBehavior=true"/>
> >
> > On Wed, May 11, 2016 at 7:35 AM, Niranjan Babu Bommu <
> > niranjan.bo...@gmail.com> wrote:
> >
> > > Hi Mark
> > > I have included defined data source in this mail, do you want me to
> > > include complete server.xml?
> > >
> > > thanks
> > > Niranjan
> > >
> > > On Wed, May 11, 2016 at 7:19 AM, Mark Thomas  wrote:
> > >
> > >> On 11/05/2016 11:58, Niranjan Babu Bommu wrote:
> > >> > Hi,
> > >> >
> > >> > we are migrating prod servers to tomcat, since we are doing it
slowly we
> > >> > have found an issue in jdbc connection pool, tomcat is not
releasing
> > >> idle
> > >> > jdbc connections, even we have tried setting maxIdle="10" but
"NumIdle
> > >> 97"
> > >> > always. due to this threads are piling up in database.
> > >> >
> > >> > I'm including my config here, can someone please help me out, how
to
> > >> > minimize idle jdbc connections.
> > >>
> > >> Where have you added the configuration below?
> > >>
> > >> Mark
> > >>
> > >>
> > >> >
> > >> >  > >> >   auth="Container"
> > >> >   type="javax.sql.DataSource"
> > >> >   testWhileIdle="true"
> > >> >   testOnBorrow="true"
> > >> >   testOnReturn="false"
> > >> >   fairQueue="false"
> > >> >   validationQuery="SELECT 1"
> > >> >   validationInterval="3"
> > >> >   timeBetweenEvictionRunsMillis="3"
> > >> >   maxActive="100"
> > >> >   maxIdle="10"
> > >> >   minIdle="10"
> > >> >   maxWait="1"
> > >> >   initialSize="10"
> > >> >   removeAbandonedTimeout="60"
> > >> >   removeAbandoned="true"
> > >> >   logAbandoned="true"
> > >> >   minEvictableIdleTimeMillis="30"
> > >> >   jmxEnabled="true"
> > >> >
> > >> >
> > >>
jdbcInterceptors="ConnectionState;StatementFinalizer;ResetAbandonedTimer"
> > >> >   username=""
> > >> >   password=""
> > >> >   driverClassName="com.mysql.jdbc.Driver"
> > >> >
> > >> >
> > >>
url="jdbc:mysql:///?useServerPrepStmts=false&useOldAliasMetadataBehavior=true"/>
> > >> >
> > >> >
> > >>
> > >>
> > >> -
> > >> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> > >> For additional commands, e-mail: users-h...@tomcat.apache.org
> > >>
> > >>
> > >
> > >
> > > --
> > > *Thanks*
> > > *Niranjan*
> > > *+1 781.956.6900 <%2B1%20781.956.6900>*
> > >
> >
> >
> >
> > --
> > *Thanks*
> > *Niranjan*
> > *+1 781.956.6900*


Re: tomcat(7.0.56) is not releasing idle jdbc connections

2016-05-11 Thread Igor Cicimov
On 12 May 2016 12:16 am, "Niranjan Babu Bommu" 
wrote:
>
> I tried the same config on test stacks. numidle always "10" why it is
> behaving differently in prod?
>
Are you sure your testing db config is identical to the prod one?

>auth="Container"
>   type="javax.sql.DataSource"
>   testWhileIdle="true"
>   testOnBorrow="true"
>   testOnReturn="false"
>   fairQueue="false"
>   validationQuery="SELECT 1"
>   validationInterval="3"
>   timeBetweenEvictionRunsMillis="3"
>   maxActive="100"
>   maxIdle="10"
>   minIdle="10"
>   maxWait="1"
>   initialSize="10"
>   removeAbandonedTimeout="60"
>   removeAbandoned="true"
>   logAbandoned="true"
>   minEvictableIdleTimeMillis="30"
>   jmxEnabled="true"
>
> jdbcInterceptors="ConnectionState;StatementFinalizer;ResetAbandonedTimer"
>   username=""
>   password=""
>   driverClassName="com.mysql.jdbc.Driver"
>
>
url="jdbc:mysql:///?useServerPrepStmts=false&useOldAliasMetadataBehavior=true"/>
>
> On Wed, May 11, 2016 at 7:35 AM, Niranjan Babu Bommu <
> niranjan.bo...@gmail.com> wrote:
>
> > Hi Mark
> > I have included defined data source in this mail, do you want me to
> > include complete server.xml?
> >
> > thanks
> > Niranjan
> >
> > On Wed, May 11, 2016 at 7:19 AM, Mark Thomas  wrote:
> >
> >> On 11/05/2016 11:58, Niranjan Babu Bommu wrote:
> >> > Hi,
> >> >
> >> > we are migrating prod servers to tomcat, since we are doing it
slowly we
> >> > have found an issue in jdbc connection pool, tomcat is not releasing
> >> idle
> >> > jdbc connections, even we have tried setting maxIdle="10" but
"NumIdle
> >> 97"
> >> > always. due to this threads are piling up in database.
> >> >
> >> > I'm including my config here, can someone please help me out, how to
> >> > minimize idle jdbc connections.
> >>
> >> Where have you added the configuration below?
> >>
> >> Mark
> >>
> >>
> >> >
> >> >  >> >   auth="Container"
> >> >   type="javax.sql.DataSource"
> >> >   testWhileIdle="true"
> >> >   testOnBorrow="true"
> >> >   testOnReturn="false"
> >> >   fairQueue="false"
> >> >   validationQuery="SELECT 1"
> >> >   validationInterval="3"
> >> >   timeBetweenEvictionRunsMillis="3"
> >> >   maxActive="100"
> >> >   maxIdle="10"
> >> >   minIdle="10"
> >> >   maxWait="1"
> >> >   initialSize="10"
> >> >   removeAbandonedTimeout="60"
> >> >   removeAbandoned="true"
> >> >   logAbandoned="true"
> >> >   minEvictableIdleTimeMillis="30"
> >> >   jmxEnabled="true"
> >> >
> >> >
> >>
jdbcInterceptors="ConnectionState;StatementFinalizer;ResetAbandonedTimer"
> >> >   username=""
> >> >   password=""
> >> >   driverClassName="com.mysql.jdbc.Driver"
> >> >
> >> >
> >>
url="jdbc:mysql:///?useServerPrepStmts=false&useOldAliasMetadataBehavior=true"/>
> >> >
> >> >
> >>
> >>
> >> -
> >> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> >> For additional commands, e-mail: users-h...@tomcat.apache.org
> >>
> >>
> >
> >
> > --
> > *Thanks*
> > *Niranjan*
> > *+1 781.956.6900 <%2B1%20781.956.6900>*
> >
>
>
>
> --
> *Thanks*
> *Niranjan*
> *+1 781.956.6900*


Re: Unable to retrieve X-Forwarded-For in Tomcat 8.0 access log

2016-05-11 Thread Abhijit Das
RESOLVED … It should be injected in the REQUEST Header, I will now see if case 
matters. 


On May 11, 2016, at 12:07 PM, Abhijit Das  wrote:

Thanks for pointing out, but that didn’t work either .. (I also changed the 
policy on the LB to inject in lower case x-forwarded-for thinking if it was 
case sensitive?) .. Do i need a filter as well in web.xml ? 

The below Header is a RESPONSE header, where i am injecting x-forwarded-for 



mailto:ma...@apache.org>> wrote:

On 11/05/2016 19:47, Abhijit Das wrote:
> 
> down vote
> <>favorite
>   
> >
>
> I am injecting a header with a rewrite policy on my LB to pass 
> X-Forwarded-For header. Have verified that this appears on all the pages in 
> the RESPONSE Header.
> 
> I have the following config in server.xml , yet i am not able to see the 
> Remote IP/X-Forwarded-For either using %a or %h (I see Loadbalancer IP)
> 
> What could be the issue?
> 
>  internalProxies="10\.202\.13\.198"
>  remoteIpHeader="X-Forwarded-For"
>  proxiesHeader="x-forwarded-by"
>  requestAttributesEnabled="true"
>/>
>  directory="logs"
>  prefix="localhost_access_log"
>  suffix=".txt"
>  pattern="%t %a %h %{Referer}i %l %S %{User-Agent}i %U %s %r %q 
> %A %v %p %b %I %D"
>  requestAttributeEnabled="true"
typo  ^^^

You are missing an 's'

Mark


>  resolveHosts="false"/>
> Log ::
> 
> [11/May/2016:11:29:39 -0700] 10.202.13.198 10.202.13.198 
> https:///index.action  - 
> 04B3ADCF82A212C6ECD9679BF260732D Mozilla/5.0 (Macintosh; Intel Mac OS X 
> 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.86 
> Safari/537.36 /rest/mywork/latest/status/notification/count 200 GET 
> /rest/mywork/latest/status/notification/count HTTP/1.1 10.202.10.17 443 72 
> http-nio-8443-exec-17 13
> 
> As you see : both %a and % h are : 10.202.13.198 10.202.13.198 (my LB IP)
> 
> 
> Snippet of my Resonse Header: showing my LB policy is injecting the 
> X-Forwarded-For header.
> 
> Cache-Control:private
> Content-Encoding:gzip
> Content-Type:application/json
> Date:Wed, 11 May 2016 17:58:55 GMT
> Expires:Wed, 31 Dec 1969 16:00:00 PST
> Server:Apache-Coyote/1.1
> Strict-Transport-Security:max-age=31536000; includeSubDomains
> Transfer-Encoding:chunked
> Vary:User-Agent
> X-AUSERNAME:admin
> X-App-Cluster-Node:4e77b660
> X-App-Cluster-Node-Name:app_prod_clus_node3
> X-Content-Type-Options:nosniff
> X-Forwarded-For:1.1.1.1
> X-Seraph-LoginReason:OK
> 
> 
> 
> 
> 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org 

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






Re: Unable to retrieve X-Forwarded-For in Tomcat 8.0 access log

2016-05-11 Thread Abhijit Das
Thanks for pointing out, but that didn’t work either .. (I also changed the 
policy on the LB to inject in lower case x-forwarded-for thinking if it was 
case sensitive?) .. Do i need a filter as well in web.xml ? 

The below Header is a RESPONSE header, where i am injecting x-forwarded-for 



https://stackoverflow.com/questions/37170742/unable-to-retrieve-x-forwarded-for-in-tomcat-8-0-access-log#>
>
> I am injecting a header with a rewrite policy on my LB to pass 
> X-Forwarded-For header. Have verified that this appears on all the pages in 
> the RESPONSE Header.
> 
> I have the following config in server.xml , yet i am not able to see the 
> Remote IP/X-Forwarded-For either using %a or %h (I see Loadbalancer IP)
> 
> What could be the issue?
> 
>  internalProxies="10\.202\.13\.198"
>  remoteIpHeader="X-Forwarded-For"
>  proxiesHeader="x-forwarded-by"
>  requestAttributesEnabled="true"
>/>
>  directory="logs"
>  prefix="localhost_access_log"
>  suffix=".txt"
>  pattern="%t %a %h %{Referer}i %l %S %{User-Agent}i %U %s %r %q 
> %A %v %p %b %I %D"
>  requestAttributeEnabled="true"
typo  ^^^

You are missing an 's'

Mark


>  resolveHosts="false"/>
> Log ::
> 
> [11/May/2016:11:29:39 -0700] 10.202.13.198 10.202.13.198 
> https:///index.action - 04B3ADCF82A212C6ECD9679BF260732D Mozilla/5.0 
> (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) 
> Chrome/50.0.2661.86 Safari/537.36 
> /rest/mywork/latest/status/notification/count 200 GET 
> /rest/mywork/latest/status/notification/count HTTP/1.1 10.202.10.17 443 72 
> http-nio-8443-exec-17 13
> 
> As you see : both %a and % h are : 10.202.13.198 10.202.13.198 (my LB IP)
> 
> 
> Snippet of my Resonse Header: showing my LB policy is injecting the 
> X-Forwarded-For header.
> 
> Cache-Control:private
> Content-Encoding:gzip
> Content-Type:application/json
> Date:Wed, 11 May 2016 17:58:55 GMT
> Expires:Wed, 31 Dec 1969 16:00:00 PST
> Server:Apache-Coyote/1.1
> Strict-Transport-Security:max-age=31536000; includeSubDomains
> Transfer-Encoding:chunked
> Vary:User-Agent
> X-AUSERNAME:admin
> X-App-Cluster-Node:4e77b660
> X-App-Cluster-Node-Name:app_prod_clus_node3
> X-Content-Type-Options:nosniff
> X-Forwarded-For:1.1.1.1
> X-Seraph-LoginReason:OK
> 
> 
> 
> 
> 


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




Re: Unable to retrieve X-Forwarded-For in Tomcat 8.0 access log

2016-05-11 Thread Mark Thomas
On 11/05/2016 19:47, Abhijit Das wrote:
> 
> down vote
>  <>favorite
>  
> 
>   
> I am injecting a header with a rewrite policy on my LB to pass 
> X-Forwarded-For header. Have verified that this appears on all the pages in 
> the RESPONSE Header.
> 
> I have the following config in server.xml , yet i am not able to see the 
> Remote IP/X-Forwarded-For either using %a or %h (I see Loadbalancer IP)
> 
> What could be the issue?
> 
>internalProxies="10\.202\.13\.198"
>   remoteIpHeader="X-Forwarded-For"
>   proxiesHeader="x-forwarded-by"
>   requestAttributesEnabled="true"
> />
>directory="logs"
>   prefix="localhost_access_log"
>   suffix=".txt"
>   pattern="%t %a %h %{Referer}i %l %S %{User-Agent}i %U %s %r %q 
> %A %v %p %b %I %D"
>   requestAttributeEnabled="true"
typo  ^^^

You are missing an 's'

Mark


>   resolveHosts="false"/>
> Log ::
> 
> [11/May/2016:11:29:39 -0700] 10.202.13.198 10.202.13.198 
> https:///index.action - 04B3ADCF82A212C6ECD9679BF260732D Mozilla/5.0 
> (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) 
> Chrome/50.0.2661.86 Safari/537.36 
> /rest/mywork/latest/status/notification/count 200 GET 
> /rest/mywork/latest/status/notification/count HTTP/1.1 10.202.10.17 443 72 
> http-nio-8443-exec-17 13
> 
> As you see : both %a and % h are : 10.202.13.198 10.202.13.198 (my LB IP)
> 
> 
> Snippet of my Resonse Header: showing my LB policy is injecting the 
> X-Forwarded-For header.
> 
> Cache-Control:private
> Content-Encoding:gzip
> Content-Type:application/json
> Date:Wed, 11 May 2016 17:58:55 GMT
> Expires:Wed, 31 Dec 1969 16:00:00 PST
> Server:Apache-Coyote/1.1
> Strict-Transport-Security:max-age=31536000; includeSubDomains
> Transfer-Encoding:chunked
> Vary:User-Agent
> X-AUSERNAME:admin
> X-App-Cluster-Node:4e77b660
> X-App-Cluster-Node-Name:app_prod_clus_node3
> X-Content-Type-Options:nosniff
> X-Forwarded-For:1.1.1.1
> X-Seraph-LoginReason:OK
> 
> 
> 
> 
> 


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



Unable to retrieve X-Forwarded-For in Tomcat 8.0 access log

2016-05-11 Thread Abhijit Das

down vote
 <>favorite
 


I am injecting a header with a rewrite policy on my LB to pass X-Forwarded-For 
header. Have verified that this appears on all the pages in the RESPONSE Header.

I have the following config in server.xml , yet i am not able to see the Remote 
IP/X-Forwarded-For either using %a or %h (I see Loadbalancer IP)

What could be the issue?



Log ::

[11/May/2016:11:29:39 -0700] 10.202.13.198 10.202.13.198 https:///index.action 
- 04B3ADCF82A212C6ECD9679BF260732D Mozilla/5.0 (Macintosh; Intel Mac OS X 
10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.86 
Safari/537.36 /rest/mywork/latest/status/notification/count 200 GET 
/rest/mywork/latest/status/notification/count HTTP/1.1 10.202.10.17 443 72 
http-nio-8443-exec-17 13

As you see : both %a and % h are : 10.202.13.198 10.202.13.198 (my LB IP)


Snippet of my Resonse Header: showing my LB policy is injecting the 
X-Forwarded-For header.

Cache-Control:private
Content-Encoding:gzip
Content-Type:application/json
Date:Wed, 11 May 2016 17:58:55 GMT
Expires:Wed, 31 Dec 1969 16:00:00 PST
Server:Apache-Coyote/1.1
Strict-Transport-Security:max-age=31536000; includeSubDomains
Transfer-Encoding:chunked
Vary:User-Agent
X-AUSERNAME:admin
X-App-Cluster-Node:4e77b660
X-App-Cluster-Node-Name:app_prod_clus_node3
X-Content-Type-Options:nosniff
X-Forwarded-For:1.1.1.1
X-Seraph-LoginReason:OK






tomcat jaas custom error message in error page

2016-05-11 Thread Shushant Arora
Hi

I have a web application deployed on tomcat.
I have used custom login module of JAAS for authentication and provided
login and error page in web.xml.

I want to access message of login exception which I threw in login module
into error page - so that custom message can be displayed to user. How to
achieve this?

Thanks!


Re: tomcat(7.0.56) is not releasing idle jdbc connections

2016-05-11 Thread Niranjan Babu Bommu
I'm re-posting my ds



On Wed, May 11, 2016 at 10:16 AM, Niranjan Babu Bommu <
niranjan.bo...@gmail.com> wrote:

> I tried the same config on test stacks. numidle always "10" why it is
> behaving differently in prod?
>
>auth="Container"
>   type="javax.sql.DataSource"
>   testWhileIdle="true"
>   testOnBorrow="true"
>   testOnReturn="false"
>   fairQueue="false"
>   validationQuery="SELECT 1"
>   validationInterval="3"
>   timeBetweenEvictionRunsMillis="3"
>   maxActive="100"
>   maxIdle="10"
>   minIdle="10"
>   maxWait="1"
>   initialSize="10"
>   removeAbandonedTimeout="60"
>   removeAbandoned="true"
>   logAbandoned="true"
>   minEvictableIdleTimeMillis="30"
>   jmxEnabled="true"
>
> jdbcInterceptors="ConnectionState;StatementFinalizer;ResetAbandonedTimer"
>   username=""
>   password=""
>   driverClassName="com.mysql.jdbc.Driver"
>
> url="jdbc:mysql:///?useServerPrepStmts=false&useOldAliasMetadataBehavior=true"/>
>
> On Wed, May 11, 2016 at 7:35 AM, Niranjan Babu Bommu <
> niranjan.bo...@gmail.com> wrote:
>
>> Hi Mark
>> I have included defined data source in this mail, do you want me to
>> include complete server.xml?
>>
>> thanks
>> Niranjan
>>
>> On Wed, May 11, 2016 at 7:19 AM, Mark Thomas  wrote:
>>
>>> On 11/05/2016 11:58, Niranjan Babu Bommu wrote:
>>> > Hi,
>>> >
>>> > we are migrating prod servers to tomcat, since we are doing it slowly
>>> we
>>> > have found an issue in jdbc connection pool, tomcat is not releasing
>>> idle
>>> > jdbc connections, even we have tried setting maxIdle="10" but "NumIdle
>>> 97"
>>> > always. due to this threads are piling up in database.
>>> >
>>> > I'm including my config here, can someone please help me out, how to
>>> > minimize idle jdbc connections.
>>>
>>> Where have you added the configuration below?
>>>
>>> Mark
>>>
>>>
>>> >
>>> > >> >   auth="Container"
>>> >   type="javax.sql.DataSource"
>>> >   testWhileIdle="true"
>>> >   testOnBorrow="true"
>>> >   testOnReturn="false"
>>> >   fairQueue="false"
>>> >   validationQuery="SELECT 1"
>>> >   validationInterval="3"
>>> >   timeBetweenEvictionRunsMillis="3"
>>> >   maxActive="100"
>>> >   maxIdle="10"
>>> >   minIdle="10"
>>> >   maxWait="1"
>>> >   initialSize="10"
>>> >   removeAbandonedTimeout="60"
>>> >   removeAbandoned="true"
>>> >   logAbandoned="true"
>>> >   minEvictableIdleTimeMillis="30"
>>> >   jmxEnabled="true"
>>> >
>>> >
>>> jdbcInterceptors="ConnectionState;StatementFinalizer;ResetAbandonedTimer"
>>> >   username=""
>>> >   password=""
>>> >   driverClassName="com.mysql.jdbc.Driver"
>>> >
>>> >
>>> url="jdbc:mysql:///?useServerPrepStmts=false&useOldAliasMetadataBehavior=true"/>
>>> >
>>> >
>>>
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>>
>>>
>>
>>
>> --
>> *Thanks*
>> *Niranjan*
>> *+1 781.956.6900 <%2B1%20781.956.6900>*
>>
>
>
>
> --
> *Thanks*
> *Niranjan*
> *+1 781.956.6900 <%2B1%20781.956.6900>*
>



-- 
*Thanks*
*Niranjan*
*+1 781.956.6900*


Re: tomcat(7.0.56) is not releasing idle jdbc connections

2016-05-11 Thread Niranjan Babu Bommu
I tried the same config on test stacks. numidle always "10" why it is
behaving differently in prod?



On Wed, May 11, 2016 at 7:35 AM, Niranjan Babu Bommu <
niranjan.bo...@gmail.com> wrote:

> Hi Mark
> I have included defined data source in this mail, do you want me to
> include complete server.xml?
>
> thanks
> Niranjan
>
> On Wed, May 11, 2016 at 7:19 AM, Mark Thomas  wrote:
>
>> On 11/05/2016 11:58, Niranjan Babu Bommu wrote:
>> > Hi,
>> >
>> > we are migrating prod servers to tomcat, since we are doing it slowly we
>> > have found an issue in jdbc connection pool, tomcat is not releasing
>> idle
>> > jdbc connections, even we have tried setting maxIdle="10" but "NumIdle
>> 97"
>> > always. due to this threads are piling up in database.
>> >
>> > I'm including my config here, can someone please help me out, how to
>> > minimize idle jdbc connections.
>>
>> Where have you added the configuration below?
>>
>> Mark
>>
>>
>> >
>> > > >   auth="Container"
>> >   type="javax.sql.DataSource"
>> >   testWhileIdle="true"
>> >   testOnBorrow="true"
>> >   testOnReturn="false"
>> >   fairQueue="false"
>> >   validationQuery="SELECT 1"
>> >   validationInterval="3"
>> >   timeBetweenEvictionRunsMillis="3"
>> >   maxActive="100"
>> >   maxIdle="10"
>> >   minIdle="10"
>> >   maxWait="1"
>> >   initialSize="10"
>> >   removeAbandonedTimeout="60"
>> >   removeAbandoned="true"
>> >   logAbandoned="true"
>> >   minEvictableIdleTimeMillis="30"
>> >   jmxEnabled="true"
>> >
>> >
>> jdbcInterceptors="ConnectionState;StatementFinalizer;ResetAbandonedTimer"
>> >   username=""
>> >   password=""
>> >   driverClassName="com.mysql.jdbc.Driver"
>> >
>> >
>> url="jdbc:mysql:///?useServerPrepStmts=false&useOldAliasMetadataBehavior=true"/>
>> >
>> >
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>
>>
>
>
> --
> *Thanks*
> *Niranjan*
> *+1 781.956.6900 <%2B1%20781.956.6900>*
>



-- 
*Thanks*
*Niranjan*
*+1 781.956.6900*


Re: Multipart form submission does not work over SSL HTTP2 on Tomcat 9

2016-05-11 Thread Thad Humphries
I am getting a null returned from HttpServletRequest.getParts() HTTP/2 and
multipart (see http://bit.ly/1TzXd9k). This happens in my own code, as well
as when I try to upload a *.WAR though the manager/html web page. Other
than configuring the connector and the upgrade protocol (see below), what
must be done?



  
  

  



On Tue, Mar 22, 2016 at 5:32 PM, Violeta Georgieva 
wrote:

> Hi,
>
> 2016-03-19 23:21 GMT+02:00 Ajay Verma :
> >
> > Hello,
> > I'm trying to get multipart forms working in Tomcat 9 over HTTP2 (with
> TLS enabled).
> >
> > The SSL Connector configuration in server.xml (Tomcat 9) is given
> below protocol="org.apache.coyote.http11.Http11AprProtocol"  maxThreads="150"
> SSLEnabled="true">
> > 
> > 
> >  > certificateFile="conf/2_toeflmadeeasy.com.crt"  />
> >   Multipart form submission does not work (the form
> variable values are not retrieved on server in the servlet) with above
> connector.The sample multipart form html code is given below name="multiPartForm" method="post" enctype="multipart/form-data">
> >  name="form_submission_type" value="test">
> > File 1:
> > File 2:
> > 
> > 
> > I am trying to get form parameters by using the
> getParameter("form_submission_type") method on HttpServletRequest, and it
> returns null under HTTP2. If I remove the line  className="org.apache.coyote.http2.Http2Protocol" />) it works. But now I
> am not on HTTP2.
> >
> > Anyone have any ideas how I can get it to work on HTTP2?
>
> Is it possible for you to test your configuration with the manager
> application that comes with Tomcat distribution?
> It uses multipart.
>
> I tested it on my side and the manager application is working with HTTP/2
> and multipart.
>
> Regards,
> Violeta
>
> > Thanks in advance for any suggestions and comments.
> > Ajay
>



-- 
"Hell hath no limits, nor is circumscrib'd In one self-place; but where we
are is hell, And where hell is, there must we ever be" --Christopher
Marlowe, *Doctor Faustus* (v. 121-24)


Re: tomcat(7.0.56) is not releasing idle jdbc connections

2016-05-11 Thread Niranjan Babu Bommu
Hi Mark
I have included defined data source in this mail, do you want me to include
complete server.xml?

thanks
Niranjan

On Wed, May 11, 2016 at 7:19 AM, Mark Thomas  wrote:

> On 11/05/2016 11:58, Niranjan Babu Bommu wrote:
> > Hi,
> >
> > we are migrating prod servers to tomcat, since we are doing it slowly we
> > have found an issue in jdbc connection pool, tomcat is not releasing idle
> > jdbc connections, even we have tried setting maxIdle="10" but "NumIdle
> 97"
> > always. due to this threads are piling up in database.
> >
> > I'm including my config here, can someone please help me out, how to
> > minimize idle jdbc connections.
>
> Where have you added the configuration below?
>
> Mark
>
>
> >
> >  >   auth="Container"
> >   type="javax.sql.DataSource"
> >   testWhileIdle="true"
> >   testOnBorrow="true"
> >   testOnReturn="false"
> >   fairQueue="false"
> >   validationQuery="SELECT 1"
> >   validationInterval="3"
> >   timeBetweenEvictionRunsMillis="3"
> >   maxActive="100"
> >   maxIdle="10"
> >   minIdle="10"
> >   maxWait="1"
> >   initialSize="10"
> >   removeAbandonedTimeout="60"
> >   removeAbandoned="true"
> >   logAbandoned="true"
> >   minEvictableIdleTimeMillis="30"
> >   jmxEnabled="true"
> >
> > jdbcInterceptors="ConnectionState;StatementFinalizer;ResetAbandonedTimer"
> >   username=""
> >   password=""
> >   driverClassName="com.mysql.jdbc.Driver"
> >
> >
> url="jdbc:mysql:///?useServerPrepStmts=false&useOldAliasMetadataBehavior=true"/>
> >
> >
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


-- 
*Thanks*
*Niranjan*
*+1 781.956.6900*


Re: tomcat(7.0.56) is not releasing idle jdbc connections

2016-05-11 Thread Mark Thomas
On 11/05/2016 11:58, Niranjan Babu Bommu wrote:
> Hi,
> 
> we are migrating prod servers to tomcat, since we are doing it slowly we
> have found an issue in jdbc connection pool, tomcat is not releasing idle
> jdbc connections, even we have tried setting maxIdle="10" but "NumIdle 97"
> always. due to this threads are piling up in database.
> 
> I'm including my config here, can someone please help me out, how to
> minimize idle jdbc connections.

Where have you added the configuration below?

Mark


> 
>auth="Container"
>   type="javax.sql.DataSource"
>   testWhileIdle="true"
>   testOnBorrow="true"
>   testOnReturn="false"
>   fairQueue="false"
>   validationQuery="SELECT 1"
>   validationInterval="3"
>   timeBetweenEvictionRunsMillis="3"
>   maxActive="100"
>   maxIdle="10"
>   minIdle="10"
>   maxWait="1"
>   initialSize="10"
>   removeAbandonedTimeout="60"
>   removeAbandoned="true"
>   logAbandoned="true"
>   minEvictableIdleTimeMillis="30"
>   jmxEnabled="true"
> 
> jdbcInterceptors="ConnectionState;StatementFinalizer;ResetAbandonedTimer"
>   username=""
>   password=""
>   driverClassName="com.mysql.jdbc.Driver"
> 
> url="jdbc:mysql:///?useServerPrepStmts=false&useOldAliasMetadataBehavior=true"/>
> 
> 


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



tomcat(7.0.56) is not releasing idle jdbc connections

2016-05-11 Thread Niranjan Babu Bommu
Hi,

we are migrating prod servers to tomcat, since we are doing it slowly we
have found an issue in jdbc connection pool, tomcat is not releasing idle
jdbc connections, even we have tried setting maxIdle="10" but "NumIdle 97"
always. due to this threads are piling up in database.

I'm including my config here, can someone please help me out, how to
minimize idle jdbc connections.




-- 
*Thanks*
*Niranjan*