Re: ERR_SPDY_COMPRESSION_ERROR (http2)

2016-12-16 Thread Durga Srinivasu Karuturi
Do i need to post in any other forum?

Thanks,
Durga Srinivasu

On Thu, Dec 15, 2016 at 6:41 PM, Durga Srinivasu Karuturi <
durgasriniv...@gmail.com> wrote:

> Hi,
>
> Any pointers please?
>
> Thanks,
> Durga Srinivasu
>
> On Wed, Dec 14, 2016 at 10:15 PM, Durga Srinivasu Karuturi <
> durgasriniv...@gmail.com> wrote:
>
>> Hi,
>>
>> Recent chrome  [Mac - Sierra : Version  55.0.2883.87 (64-bit) ] we are 
>> seeing issues in http2 sites.
>>
>>
>> Initially we have seen problem with http2 table header size limit error and 
>> to fix this, we have upgraded tomcat 8.5.4 to 8.5.9 where tomcat has 
>> increased the header limit from 16K to 64K.
>>
>>
>> Now with latest tomcat 8.5.9 we are seeing  ERR_SPDY_COMPRESSION_ERROR while 
>> loading dojo libraries.
>>
>> Tried couple of steps (flush SPDY sokets etc) based on google search on this 
>> issue but nothing worked..
>>
>>
>> [image: Inline image 1]
>>
>> t=10513 [st= 1] -HTTP_TRANSACTION_SEND_REQUEST
>>
>> t=10513 [st= 1] +HTTP_TRANSACTION_READ_HEADERS  [dt=36]
>>
>> t=10549 [st=37]HTTP2_STREAM_ERROR
>>
>>--> description = "ABANDONED (stream_id=139):
>> https://10.104.118.174/webacs/lib/dijit/form/_ToggleButtonMixin.js.map;
>>
>>--> status = -363
>>
>>--> stream_id = 139
>>
>> t=10549 [st=37] -HTTP_TRANSACTION_READ_HEADERS
>>
>> * --> net_error = -363 (ERR_SPDY_COMPRESSION_ERROR)*
>>
>> t=10549 [st=37]   -URL_REQUEST_START_JOB
>>
>> *   --> net_error = -363 (ERR_SPDY_COMPRESSION_ERROR)*
>>
>> t=10549 [st=37]URL_REQUEST_DELEGATE  [dt=0]
>>
>> t=10549 [st=37] -REQUEST_ALIVE
>>
>>  --> net_error = -363 (ERR_SPDY_COMPRESSION_ERROR)
>>
>>
>> Initial content is downloaded (other JS files etc) but on some dojo 
>> libraries alone, we are this issue which make application home page load 
>> fails.
>>
>>
>> Firefox works!
>>
>>
>> We are having latest tomcat 8.5.9 already. Not sure where else problem now. 
>> We have not enabled any compression server side.
>>
>>
>> https://bugs.chromium.org/p/chromium/issues/detail?id=673315 (Chrome bugs i 
>> have raised)
>>
>> My guess is that the bug is in Tomcat, in that it does not send an HPACK 
>> dynamic table size update (so the dynamic table should be the default 4 kB) 
>> but uses a 64 kB dynamic table.
>> As soon as it references entries that are in fact already emitted, 
>> that's a compression error.
>> See https://www.ietf.org/mail-archive/web/httpbisa/current/msg27867.html 
>> for a discussion on how to interpret the specs.
>>
>> According to the chrome bug notes problem is with tome dynamic table size 
>> 64k. I don't know how to confirm this is as tomcat issue as well.
>>
>> Can somebody help here to trace the problem?
>>
>>
>>
>>
>>
>>
>


Re: How many instances Tomcat?

2016-12-16 Thread Mark Eggers
Edwin,

On 12/16/2016 1:35 PM, Edwin Quijada wrote:
> 
> 
> 
>  From: Daniel Savard
>  Sent: Friday, December 16, 2016 9:01 PM To:
> Tomcat Users List Subject: Re: How many instances Tomcat?
> 
> 2016-12-16 14:48 GMT-05:00 Edwin Quijada
> :
> 
>> Hi! I have 2 different projects in the same server. My server has
>> 16GB Ram and 8 core so I am not sure if I need to up 2 instance of
>> Tomcat or just one instace and Tomcat server both projects.
>> 
>> 
>> What is the best configuration ? I have too ApacheWeb Sserver like
>> proxy and SSL and virtual server.
>> 
>> 
>> Any cluees or ideas? Pro and cons about each solution
>> 
>> 
>> TIA
>> 
>> 
> It depends on the application. On some of my servers, the
> application provider recommend a limit on the number of concurrent
> connections per instance. I am even not sure it is justified,
> however, since we get support from this provider we have to conform
> to its directives. However, something good about having more than one
> instance is you can shutdown the application without interrupting the
> service.
> 
> For ressources consumption, you need to look at what your specific 
> applications need and what kind of workload you expect. Giving the
> amount of RAM and the number of cores is useless. I run 9 instances
> of Tomcat on a single server with 16 GB of RAM and 2 cores.
> 
> OK, sounds good.! So I think use two instances is not a problem. I
> wanna use apache webserver in front of these Tomcats with virtual
> servers but I dont know if will be a good idea because I use
> websockets and I dont know if websockets can pass throught webserver
> to tomcat
> 
> 

I believe Apache HTTPD 2.4 has a mod_proxy_wstunnel that may work:

https://httpd.apache.org/docs/2.4/mod/mod_proxy_wstunnel.html

I have not tried this, with or without Tomcat.

. . . just my two cents
/mde/



signature.asc
Description: OpenPGP digital signature


Re: How many instances Tomcat?

2016-12-16 Thread Edwin Quijada




From: Daniel Savard 
Sent: Friday, December 16, 2016 9:01 PM
To: Tomcat Users List
Subject: Re: How many instances Tomcat?

2016-12-16 14:48 GMT-05:00 Edwin Quijada :

> Hi!
> I have 2 different projects in the same server. My server has 16GB Ram and
> 8 core so I am not sure if I need to up 2 instance of Tomcat or just one
> instace and Tomcat server both projects.
>
>
> What is the best configuration ? I have too ApacheWeb Sserver like proxy
> and SSL and virtual server.
>
>
> Any cluees or ideas? Pro and cons about each solution
>
>
> TIA
>
>
It depends on the application. On some of my servers, the application
provider recommend a limit on the number of concurrent connections per
instance. I am even not sure it is justified, however, since we get support
from this provider we have to conform to its directives. However, something
good about having more than one instance is you can shutdown the
application without interrupting the service.

For ressources consumption, you need to look at what your specific
applications need and what kind of workload you expect. Giving the amount
of RAM and the number of cores is useless. I run 9 instances of Tomcat on a
single server with 16 GB of RAM and 2 cores.

OK, sounds good.! So I think use two instances is not a problem. I wanna use 
apache webserver in front of these Tomcats with virtual servers but I dont know 
if will be a good idea because I use websockets and I dont know if websockets 
can pass throught webserver to tomcat



Re: How many instances Tomcat?

2016-12-16 Thread Daniel Savard
2016-12-16 14:48 GMT-05:00 Edwin Quijada :

> Hi!
> I have 2 different projects in the same server. My server has 16GB Ram and
> 8 core so I am not sure if I need to up 2 instance of Tomcat or just one
> instace and Tomcat server both projects.
>
>
> What is the best configuration ? I have too ApacheWeb Sserver like proxy
> and SSL and virtual server.
>
>
> Any cluees or ideas? Pro and cons about each solution
>
>
> TIA
>
>
It depends on the application. On some of my servers, the application
provider recommend a limit on the number of concurrent connections per
instance. I am even not sure it is justified, however, since we get support
from this provider we have to conform to its directives. However, something
good about having more than one instance is you can shutdown the
application without interrupting the service.

For ressources consumption, you need to look at what your specific
applications need and what kind of workload you expect. Giving the amount
of RAM and the number of cores is useless. I run 9 instances of Tomcat on a
single server with 16 GB of RAM and 2 cores.

Regards,
-
Daniel Savard


Re: Runtime Cloning of DataSource for Different DB?

2016-12-16 Thread Jerry Malcolm

On 6/27/2016 4:35 PM, Jerry Malcolm wrote:

Mark,

On 6/27/2016 1:07 PM, Mark Thomas wrote:

On 27/06/2016 17:44, Jerry Malcolm wrote:


I'm assuming that context.lookup(...) simply locates the "jdbc/myDB"
 tag in the context.xml file, pulls all of the parms out of
that tag, creates a DataSource object utilizing the parms, and returns
it.If that's the case, couldn't I create a variation/subclass of 
the

Context object that modifies the url parm that it found in the resource
tag and puts the desired db name into the url before constructing the
DataSource?

Sure.

You need to implement the appropriate factory and then specify your
factory class explicitly in the Resource element using the factory
attribute.

You probably want to start here for ideas on how to code up your 
factory:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/factory/ 



or for a more specific example:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/dbcp/dbcp2/BasicDataSourceFactory.java?view=annotate 




Mark




Mark,
It's been several months since we corresponded on this thread.  I've 
been working on other aspects of the project. But the time has arrived 
that I have to get this working.  Refresher I want to have one 
generic  .   When I need an 
instance, I pass a dbname to the factory and it builds the correct URL 
substituting the desired dbName into the URL.


I have coded a subclass of BasicDataSourceFactory that has a new 
getInstance( databaseName ) method on it.  All I'm doing there is 
getting the URL property from the common/generic  tag and 
appending databaseName to the URL, then calling the parent 
createDataSource( properties ) method.  I believe that will do what I 
need.  Plus it compiles successfully.


Where I'm falling apart now is defining the resource tag(s) and 
successfully coding the request to get an instance.   Normally when I 
reference a "" tag in my code [ ds = 
(DataSource)envContext.lookup( dataSourceName );  ] the lookup 
apparently uses the default datasourcefactory and returns a datasource.  
Fine.  But now I want to tell it use my subclass factory instead, and I 
need to pass a parameter (the db name) in. So I 'think' I need to get an 
instance of MyDataSourceFactory, then call my new method on it.  But how 
do I tell "envContext.lookup()" that I want to use my own factory and my 
own custom method (with the additional parameter) to get the instance 
from the factory?  Or do I use "envContext.lookup() to lookup and 
give me an instance of my FACTORY, and then simply call my method on my 
factory to get the ds?  Either way, I'm hitting wall on how to do it.


Thanks.

Jerry



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



How many instances Tomcat?

2016-12-16 Thread Edwin Quijada
Hi!
I have 2 different projects in the same server. My server has 16GB Ram and 8 
core so I am not sure if I need to up 2 instance of Tomcat or just one instace 
and Tomcat server both projects.


What is the best configuration ? I have too ApacheWeb Sserver like proxy and 
SSL and virtual server.


Any cluees or ideas? Pro and cons about each solution


TIA



Re: Problem configuring a resource link after Fixed CVE-2016-6797

2016-12-16 Thread Mark Thomas
On 16 December 2016 09:12:24 GMT+00:00, Per Newgro  wrote:
>Hello,
>
>i've just updated my debian server with a update for tomcat
>7.0.28-4+deb7u6 to 7.0.28-4+deb7u7.

Do you see the same problem with the latest 7.0.x obtained directly from the 
ASF?

Mark


>
>In the release notes
>(https://packages.qa.debian.org/t/tomcat7/news/20161201T223017Z.html) i
>found
>
>>   * Fixed CVE-2016-6797: The ResourceLinkFactory did not limit web
>application
>> access to global JNDI resources to those resources explicitly
>linked to the
>> web application. Therefore, it was possible for a web application
>to access
>> any global JNDI resource whether an explicit ResourceLink had
>been
>> configured or not.
>
>I configured the the resource and resource link as described in the
>tomcat-howtos. So far it worked.
>But after the update my webapp can not determine the appropriate
>datasource.
>
>I couldn't find any advice in the web how to configure the resource
>accordingly.
>Can someone please give me an advice how to solve this. Thanks
>Per
>
>
>conf/server.xml
> 
>   
>   
>   
> 
>type="org.apache.catalina.UserDatabase"
>  description="User database that can be updated and saved"
>  factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
>   pathname="conf/tomcat-users.xml" />
>
>type="javax.sql.DataSource"
>   description="Foo Datasource"
>   username="foo" password="bar"
>   url="jdbc:sqlserver://11.211.255.3;databaseName=FOO;"
> driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
>   intitalSize="5" maxWait="5000"
>   maxActive="120" maxIdle="5"
>   validationQuery="select 1"
>   poolPrepareStatements="true" />
>   
>
>
>
>webapps/foo/META-INF/context.xml
>
>
>virtualClasspath="${catalina.base}/conf/application/foo" />
>
>type="javax.sql.DataSource"/>
>
>
>webapps/foo/WEB-INF/web.xml
>
>
>DB Connection
>jdbc/foo
>javax.sql.DataSource
>
>Container
>
>
>Spring configuration
>   public @Bean(destroyMethod="") DataSource applicationDb(
>   @Value("${database.driver}") String driverClassName,
>   @Value("${database.url}") String url,
>   @Value("${database.username}") String username,
>   @Value("${database.password}") String password) throws
>NamingException {
>   InitialContext ctx = new InitialContext();
>   DataSource ds = (DataSource) 
> ctx.lookup("java:comp/env/jdbc/foo");
>// this logs a BasicDataSource instance
>   LOG.debug("Datasource=" + ds);
>   return ds == null ? devDataSource(driverClassName, url, 
> username,
>password) : ds;
>   }
>
>Exception stack
>at
>org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:343)
>at
>org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:318)
>at
>org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637)
>at
>org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
>... 40 more
>Dez 16, 2016 10:08:06 AM org.apache.catalina.core.StandardContext
>listenerStart
>SCHWERWIEGEND: Exception sending context initialized event to listener
>instance of class org.springframework.web.context.ContextLoaderListener
>org.springframework.beans.factory.BeanCreationException: Error creating
>bean with name 'supportedLocaleDao': Injection of persistence
>dependencies failed; nested exception is
>org.springframework.beans.factory.BeanCr
>eationException: Error creating bean with name
>'applicationEntityManagerFactory' defined in class
>de.itcompany.config.AppctxJeeHb: Invocation of init method failed;
>nested exception is org.hibernate.HibernateExcepti
>on: Unable to determine appropriate DataSource to use
>at
>org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessPropertyValues(PersistenceAnnotationBeanPostProcessor.java:357)
>at
>org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214)
>at
>org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)
>at
>org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
>at
>org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
>at

Problem configuring a resource link after Fixed CVE-2016-6797

2016-12-16 Thread Per Newgro
Hello,

i've just updated my debian server with a update for tomcat 7.0.28-4+deb7u6 to 
7.0.28-4+deb7u7.

In the release notes 
(https://packages.qa.debian.org/t/tomcat7/news/20161201T223017Z.html) i found

>   * Fixed CVE-2016-6797: The ResourceLinkFactory did not limit web application
> access to global JNDI resources to those resources explicitly linked to 
> the
> web application. Therefore, it was possible for a web application to 
> access
> any global JNDI resource whether an explicit ResourceLink had been
> configured or not.

I configured the the resource and resource link as described in the 
tomcat-howtos. So far it worked.
But after the update my webapp can not determine the appropriate datasource.

I couldn't find any advice in the web how to configure the resource accordingly.
Can someone please give me an advice how to solve this. Thanks
Per


conf/server.xml
 
   
   
   
 
 

 
   



webapps/foo/META-INF/context.xml







webapps/foo/WEB-INF/web.xml


DB Connection
jdbc/foo
javax.sql.DataSource

Container


Spring configuration
public @Bean(destroyMethod="") DataSource applicationDb(
@Value("${database.driver}") String driverClassName,
@Value("${database.url}") String url,
@Value("${database.username}") String username,
@Value("${database.password}") String password) throws 
NamingException {
InitialContext ctx = new InitialContext();
DataSource ds = (DataSource) 
ctx.lookup("java:comp/env/jdbc/foo");
// this logs a BasicDataSource instance
LOG.debug("Datasource=" + ds);
return ds == null ? devDataSource(driverClassName, url, 
username, password) : ds;
}

Exception stack
at 
org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:343)
at 
org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:318)
at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637)
at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
... 40 more
Dez 16, 2016 10:08:06 AM org.apache.catalina.core.StandardContext listenerStart
SCHWERWIEGEND: Exception sending context initialized event to listener instance 
of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean 
with name 'supportedLocaleDao': Injection of persistence dependencies failed; 
nested exception is org.springframework.beans.factory.BeanCr
eationException: Error creating bean with name 
'applicationEntityManagerFactory' defined in class 
de.itcompany.config.AppctxJeeHb: Invocation of init method failed; nested 
exception is org.hibernate.HibernateExcepti
on: Unable to determine appropriate DataSource to use
at 
org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessPropertyValues(PersistenceAnnotationBeanPostProcessor.java:357)
at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214)
at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)
at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at 
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at 
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at 
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772)
at 
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839)
at 
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538)
at 
org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:446)
at 
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:328)
at