martes, abril 03, 2007

Weird problems with Apache2 and Tomcat

I am using Tomcat and Apache working together through mod_jk. I am using Debian, so I have to stick to the configuration and the already built-in packages, which are mod_jk2 packages, although you can have mod_jk.so library (kind of weird, for being honest).

I was getting a strange message when cycling Apache:

Forcing reload of web server: Apache2[Tue Apr 03 13:05:58 2007] [error] env.createBean2(): Error getting factory for [workers.tomcat_home] (null)
[Tue Apr 03 13:05:58 2007] [error] config.update(): Can't create workers.tomcat_home
[Tue Apr 03 13:05:58 2007] [error] env.createBean2(): Error getting factory for [workers.java_home] (null)
[Tue Apr 03 13:05:58 2007] [error] config.update(): Can't create workers.java_home
[Tue Apr 03 13:05:58 2007] [error] env.createBean2(): Error getting factory for [ps] (null)
[Tue Apr 03 13:05:58 2007] [error] config.update(): Can't create ps
[Tue Apr 03 13:05:58 2007] [error] env.createBean2(): Error getting factory for [worker.list] (null)
[Tue Apr 03 13:05:58 2007] [error] config.update(): Can't create worker.list
[Tue Apr 03 13:05:58 2007] [error] env.createBean2(): Error getting factory for [worker.worker1.port] (null)
[Tue Apr 03 13:05:58 2007] [error] config.update(): Can't create worker.worker1.port
[Tue Apr 03 13:05:58 2007] [error] env.createBean2(): Error getting factory for [worker.worker1.host] (null)
[Tue Apr 03 13:05:58 2007] [error] config.update(): Can't create worker.worker1.host
[Tue Apr 03 13:05:58 2007] [error] env.createBean2(): Error getting factory for [worker.worker1.type] (null)
[Tue Apr 03 13:05:58 2007] [error] config.update(): Can't create worker.worker1.type
[Tue Apr 03 13:05:58 2007] [error] env.createBean2(): Error getting factory for [worker.worker1.lbfactor] (null)
[Tue Apr 03 13:05:58 2007] [error] config.update(): Can't create worker.worker1.lbfactor
[Tue Apr 03 13:05:58 2007] [error] env.createBean2(): Error getting factory for [worker.loadbalancer.type] (null)
[Tue Apr 03 13:05:58 2007] [error] config.update(): Can't create worker.loadbalancer.type
[Tue Apr 03 13:05:58 2007] [error] env.createBean2(): Error getting factory for [worker.loadbalancer.balanced_workers] (null)
[Tue Apr 03 13:05:58 2007] [error] config.update(): Can't create worker.loadbalancer.balanced_workers
[Tue Apr 03 13:05:58 2007] [error] env.createBean2(): Error getting factory for [worker.inprocess.type] (null)
[Tue Apr 03 13:05:58 2007] [error] config.update(): Can't create worker.inprocess.type
[Tue Apr 03 13:05:58 2007] [error] env.createBean2(): Error getting factory for [worker.inprocess.class_path] (null)
[Tue Apr 03 13:05:58 2007] [error] config.update(): Can't create worker.inprocess.class_path
[Tue Apr 03 13:05:58 2007] [error] env.createBean2(): Error getting factory for [worker.inprocess.cmd_line] (null)
[Tue Apr 03 13:05:58 2007] [error] config.update(): Can't create worker.inprocess.cmd_line
[Tue Apr 03 13:05:58 2007] [error] env.createBean2(): Error getting factory for [worker.inprocess.jvm_lib] (null)
[Tue Apr 03 13:05:58 2007] [error] config.update(): Can't create worker.inprocess.jvm_lib
[Tue Apr 03 13:05:58 2007] [error] env.createBean2(): Error getting factory for [worker.inprocess.stdout] (null)
[Tue Apr 03 13:05:58 2007] [error] config.update(): Can't create worker.inprocess.stdout
[Tue Apr 03 13:05:58 2007] [error] env.createBean2(): Error getting factory for [worker.inprocess.stderr] (null)
[Tue Apr 03 13:05:58 2007] [error] config.update(): Can't create worker.inprocess.stderr
[Tue Apr 03 13:05:58 2007] [notice] mod_jk2: Unrecognized option config.file /etc/apache2/workers.properties
[Tue Apr 03 13:06:01 2007] [error] env.createBean2(): Error getting factory for [workers.tomcat_home] (null)
[Tue Apr 03 13:06:01 2007] [error] config.update(): Can't create workers.tomcat_home
[Tue Apr 03 13:06:01 2007] [error] env.createBean2(): Error getting factory for [workers.java_home] (null)
[Tue Apr 03 13:06:01 2007] [error] config.update(): Can't create workers.java_home
[Tue Apr 03 13:06:01 2007] [error] env.createBean2(): Error getting factory for [ps] (null)
[Tue Apr 03 13:06:01 2007] [error] config.update(): Can't create ps
[Tue Apr 03 13:06:01 2007] [error] env.createBean2(): Error getting factory for [worker.list] (null)
[Tue Apr 03 13:06:01 2007] [error] config.update(): Can't create worker.list
[Tue Apr 03 13:06:01 2007] [error] env.createBean2(): Error getting factory for [worker.worker1.port] (null)
[Tue Apr 03 13:06:01 2007] [error] config.update(): Can't create worker.worker1.port
[Tue Apr 03 13:06:01 2007] [error] env.createBean2(): Error getting factory for [worker.worker1.host] (null)
[Tue Apr 03 13:06:01 2007] [error] config.update(): Can't create worker.worker1.host
[Tue Apr 03 13:06:01 2007] [error] env.createBean2(): Error getting factory for [worker.worker1.type] (null)
[Tue Apr 03 13:06:01 2007] [error] config.update(): Can't create worker.worker1.type
[Tue Apr 03 13:06:01 2007] [error] env.createBean2(): Error getting factory for [worker.worker1.lbfactor] (null)
[Tue Apr 03 13:06:01 2007] [error] config.update(): Can't create worker.worker1.lbfactor
[Tue Apr 03 13:06:01 2007] [error] env.createBean2(): Error getting factory for [worker.loadbalancer.type] (null)
[Tue Apr 03 13:06:01 2007] [error] config.update(): Can't create worker.loadbalancer.type
[Tue Apr 03 13:06:01 2007] [error] env.createBean2(): Error getting factory for [worker.loadbalancer.balanced_workers] (null)
[Tue Apr 03 13:06:01 2007] [error] config.update(): Can't create worker.loadbalancer.balanced_workers
[Tue Apr 03 13:06:01 2007] [error] env.createBean2(): Error getting factory for [worker.inprocess.type] (null)
[Tue Apr 03 13:06:01 2007] [error] config.update(): Can't create worker.inprocess.type
[Tue Apr 03 13:06:01 2007] [error] env.createBean2(): Error getting factory for [worker.inprocess.class_path] (null)
[Tue Apr 03 13:06:01 2007] [error] config.update(): Can't create worker.inprocess.class_path
[Tue Apr 03 13:06:01 2007] [error] env.createBean2(): Error getting factory for [worker.inprocess.cmd_line] (null)
[Tue Apr 03 13:06:01 2007] [error] config.update(): Can't create worker.inprocess.cmd_line
[Tue Apr 03 13:06:01 2007] [error] env.createBean2(): Error getting factory for [worker.inprocess.jvm_lib] (null)
[Tue Apr 03 13:06:01 2007] [error] config.update(): Can't create worker.inprocess.jvm_lib
[Tue Apr 03 13:06:01 2007] [error] env.createBean2(): Error getting factory for [worker.inprocess.stdout] (null)
[Tue Apr 03 13:06:01 2007] [error] config.update(): Can't create worker.inprocess.stdout
[Tue Apr 03 13:06:01 2007] [error] env.createBean2(): Error getting factory for [worker.inprocess.stderr] (null)
[Tue Apr 03 13:06:01 2007] [error] config.update(): Can't create worker.inprocess.stderr
[Tue Apr 03 13:06:01 2007] [notice] mod_jk2: Unrecognized option config.file /etc/apache2/workers.properties

In the end, The key was the last line, there is an apache2 module configuration under /etc/apache2/mods-enable/jk2.conf where you can see the following lines:

# To enable mod_jk2, customize workers2.properties* from
# /usr/share/doc/libapache2-mod-jk2/examples and copy it to
# /etc/apache2/workers2.properties. Then uncomment the following line:
#JkSet config.file /etc/apache2/workers.properties

As can be seen, if you uncomment (which I did) the last line, it means that you activate mod_jk2. Anyway, by default it uses the worker.properties because it is configured to do so in /usr/lib/apache-tomcat/auto/conf/mod_jk.conf

So double check any configuration, I passed several hours figuring out what was actually happening, since I thought it was a JVM issue.

Finally, some quoting on the website that pointed me out to the right place to look at:

http://www.open-xchange.org/oxwiki/OXDebianSargeFromPackage