I upgraded my grails application to grails 2.3.2 from 2.2.4. I had previously used _Events.groovy eventConfigureTomcat() closure to establish an ajp connection from apache httpd mod_jk. When upgrading, I found that this is no longer supported, but the recommended approach is to implement org.grails.plugins.tomcat.ForkedTomcatCustomizer customize() method where I could establish ajp connector. See grails docs and search on ForkedTomcatConnector.
My problem is that the code is never invoked.
I implemented the ForkedTomcatCustomizer in the /src/groovy directory. Here is the code:
package org.grails.plugins.tomcat
import grails.util.Environment
import org.apache.catalina.connector.Connector
import org.apache.catalina.startup.Tomcat
/**
* Forked tomcat customizer adds ajp connect to support apache ajp in dev env
* from within IDE
*/
class ForkedTomcatCustomizer
{
void customize(Tomcat tomcat)
{
println("In the ForkedTomcatCustomizer.customize() method")
if (Environment.getCurrent() == Environment.DEVELOPMENT)
{
def ajpConnector = new Connector("org.apache.coyote.ajp.AjpProtocol")
ajpConnector.port = 8009
ajpConnector.protocol = "AJP/1.3"
ajpConnector.redirectPort = 8443
ajpConnector.enableLookups = false
ajpConnector.setProperty("redirectPort", "8443")
ajpConnector.setProperty("protocol", "AJP/1.3")
ajpConnector.setProperty("enableLookups", "false")
tomcat.service.addConnector ajpConnector
println "Added ajp connector"
}
}
}
Anyone seen / resolved this?