tomcat8-maven-plugin
Hi All, I know that there's no tomcat8-maven-plugin (yet) and using tomcat8 with tomcat7-maven-plugin like this: plugin groupIdorg.apache.tomcat.maven/groupId artifactIdtomcat7-maven-plugin/artifactId version2.2/version dependencies dependency groupIdorg.apache.tomcat.embed/groupId artifactIdtomcat-embed-core/artifactId version${tomcat8.version}/version /dependency dependency groupIdorg.apache.tomcat/groupId artifactIdtomcat-util/artifactId version${tomcat8.version}/version /dependency dependency groupIdorg.apache.tomcat/groupId artifactIdtomcat-coyote/artifactId version${tomcat8.version}/version /dependency dependency groupIdorg.apache.tomcat/groupId artifactIdtomcat-api/artifactId version${tomcat8.version}/version /dependency dependency groupIdorg.apache.tomcat/groupId artifactIdtomcat-jdbc/artifactId version${tomcat8.version}/version /dependency dependency groupIdorg.apache.tomcat/groupId artifactIdtomcat-dbcp/artifactId version${tomcat8.version}/version /dependency dependency groupIdorg.apache.tomcat/groupId artifactIdtomcat-servlet-api/artifactId version${tomcat8.version}/version /dependency dependency groupIdorg.apache.tomcat/groupId artifactIdtomcat-jsp-api/artifactId version${tomcat8.version}/version /dependency dependency groupIdorg.apache.tomcat/groupId artifactIdtomcat-jasper/artifactId version${tomcat8.version}/version /dependency dependency groupIdorg.apache.tomcat/groupId artifactIdtomcat-jasper-el/artifactId version${tomcat8.version}/version /dependency dependency groupIdorg.apache.tomcat/groupId artifactIdtomcat-el-api/artifactId version${tomcat8.version}/version /dependency dependency groupIdorg.apache.tomcat/groupId artifactIdtomcat-catalina/artifactId version${tomcat8.version}/version /dependency dependency groupIdorg.apache.tomcat/groupId artifactIdtomcat-tribes/artifactId version${tomcat8.version}/version /dependency dependency groupIdorg.apache.tomcat/groupId artifactIdtomcat-catalina-ha/artifactId version${tomcat8.version}/version /dependency dependency groupIdorg.apache.tomcat/groupId artifactIdtomcat-annotations-api/artifactId version${tomcat8.version}/version /dependency dependency groupIdorg.apache.tomcat/groupId artifactIdtomcat-juli/artifactId version${tomcat8.version}/version /dependency dependency groupIdorg.apache.tomcat.embed/groupId artifactIdtomcat-embed-logging-juli/artifactId version${tomcat8.version}/version /dependency dependency groupIdorg.apache.tomcat.embed/groupId artifactIdtomcat-embed-logging-log4j/artifactId version${tomcat8.version}/version /dependency /dependencies /plugin doesn't work. The error is when mvn tomcat7:run is executed is: [ERROR] Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:run (default-cli) on project webapp: Execution default-cli of goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:run failed: An API incompatibility was encountered while executing org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:run: java.lang.NoSuchMethodError: org.apache.catalina.startup.Tomcat.setDefaultRealm(Lorg/apache/catalina/Realm;)V Is there anyway to get around this? Thanks.
Tomcat Connection Pool Problems with XtraBackup
I'm trying to workout a managed backup scheme on a MySQL production database with XtraBackup. According to our DBA, XtraBackup doesn't lock the database, but issues a series of SHOW TABLE STATUS commands and then works on the file system level. Still, just as XtraBackup runs my logs start to blow up with connection pool errors: Error getting database connection:[http-nio-8080-exec-5] Timeout: Pool empty. Unable to fetch a connection in 10 seconds, none available[size:100; busy:100; idle:0; lastwait:1]. There's some suggestion that turning off 'innodb-stats-on-metadata' might help so we're trying that. At the same time I want to confirm my connection pool settings are good: Resource name=jdbc/mydatabase_master auth=Container type=javax.sql.DataSource factory=org.apache.tomcat.jdbc.pool.DataSourceFactory testWhileIdle=true testOnBorrow=true testOnReturn=false validationQuery=SELECT 1 validationInterval=3 timeBetweenEvictionRunsMillis=3 maxActive=100 minIdle=10 maxWait=1 initialSize=10 removeAbandonedTimeout=60 removeAbandoned=true minEvictableIdleTimeMillis=3 jdbcInterceptors=org.apache.tomcat.jdbc.pool.interceptor.ConnectionState; org.apache.tomcat.jdbc.pool.interceptor.StatementFinalizer username=db_user password=mypassword driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://my.ip:3306/my_database / For everything besides the backup, this configuration works very well. For most of our traffic, the connection pool size hovers around the initialSize. It seems like setting the maxActive higher will just spawn new connections in the pool that are hanging. Anything strike you as...too tight for lack of a better description, that would force the pool to continuously add connections when the backup runs? Anything else seem like it could be tweaked in relation to XtraBackup? TIA, John
Custom Realm
Hi, I have some specific requirements for security and I have been trying to right a custom realm, that reads information from the database. 1. I have added a datasource in the global naming resources section in the server.xml 2. I have packaged the realm class in a JAR file and copied it the server lib 3. I have included a context.xml in the WAR META-INF, that declares the realm from (2) In the constructor of the realm class, I try to look up the datasource, 1. If I use new InitialContext().lookup, I get a name not found exception. 2. If I try to get the global naming context, by calling getServer from RealBase, getServer returns a null reference. This is the entry in server.xml Resource name=MyDS auth=Container type=javax.sql.DataSource driverClassName=oracle.jdbc.OracleDriver factory=org.apache.tomcat.jdbc.pool.DataSourceFactory url=jdbc:oracle:thin:@10.211.55.7:1521:xe username=meeraj password=password maxTotal=20 maxIdle=10 maxWaitMillis=-1 accessToUnderlyingConnectionAllowed=true/ This is the entry in the context.xml Realm className=com.ss.security.provider.DatabaseRealm digest=SHA1/ This is the constructor of the Realm class public DatabaseRealm() throws NamingException { Context context = null; try { context = new InitialContext(); template = new SimpleJdbcTemplate((DataSource) context.lookup(MyDS)); } finally { if (context != null) context.close(); } } Any pointers will be highly appreciated. Many thanks -- *Meeraj Kunnumpurath* *Director and Executive PrincipalService Symphony Ltd00 44 7702 693597mee...@servicesymphony.com mee...@servicesymphony.com*