I _strongly_ recommend you start with the recently released 1.1.1. I think there's a bug in 1.0 that is obscuring a useful error message....

Anyway, there's at least one error I can see in your config.xml modification: specifying the class attribute doesn't work, you need to specify the gbeanInfo attribute.

It's not at all clear to me why you are replacing the tomcat engine. I think that in order to get anything except your valves hooked up to a new tomcat engine you would also have to modify or replace the connectors.

In any case, at least in 1.1.1, the first valve you want is already hooked up to the existing tomcat engine. I think all you need to do is add a gbean config for the second valve and a reference from the first valve to the second valve. I think it would look like this:


    <module name="geronimo/tomcat/${pom.currentVersion}/car">
        <!-- To disable accesslogging uncomment the following lines
        <gbean name="TomcatEngine">
            <reference name="TomcatValveChain" />
        </gbean>
-->
        <gbean name="FirstValve">
    <attribute name="initParams">
        prefix=apenootjes
        suffix=.txt
        pattern=common
    </attribute>
<!-- modify the reference to point to the second valve -->
           <reference name="NextValve">SecondValve</reference>
        </gbean>

<!-- this creates the second valve -->
<gbean name="geronimo/tomcat/1.1.1/car?ServiceModule=geronimo/ tomcat/1.1.1/car,j2eeType=GBean,name=SecondValve" gbeanInfo="org.apache.geronimo.tomcat.ValveGBean"> <attribute name="className">org.apache.catalina.valves.RemoteAddrValve</attribute>
    <attribute name="initParams">
        allow=127.0.0.1,10.0.0.*
        deny=*
    </attribute>
    </gbean>

        <gbean name="TomcatResources"/>
        <gbean name="TomcatWebConnector">
            <attribute name="host">${PlanServerHostname}</attribute>
            <attribute name="port">${PlanHTTPPortPrimary}</attribute>
<attribute name="redirectPort">${PlanHTTPSPortPrimary}</ attribute>
        </gbean>
        <gbean name="TomcatAJPConnector">
            <attribute name="host">${PlanServerHostname}</attribute>
            <attribute name="port">${PlanAJPPortPrimary}</attribute>
<attribute name="redirectPort">${PlanHTTPSPortPrimary}</ attribute>
        </gbean>
        <gbean name="TomcatWebSSLConnector">
            <attribute name="host">${PlanServerHostname}</attribute>
            <attribute name="port">${PlanHTTPSPortPrimary}</attribute>
        </gbean>
    </module>


If you can get it to work, would you consider writing up something and putting it on the wiki near
http://cwiki.apache.org/GMOxDOC11/apache-geronimo-v11-users-guide.html

?

Many thanks
david jencks

On Sep 24, 2006, at 2:14 AM, Rik wrote:

Hello,

Thanks for the responses,

I've tried geronimo 1.0 as included in SuSE 10.1 and Geronimo 1.1 from
geronimo.apache.org.
In version 1.0, I added the following lines to config.xml:

  <configuration name="geronimo/tomcat/1.0/car">
    <gbean name="TomcatResources">
    </gbean>
    <gbean name="TomcatWebConnector">
      <attribute name="host">0.0.0.0</attribute>
      <attribute name="port">8080</attribute>
      <attribute name="redirectPort">8443</attribute>
    </gbean>
    <gbean name="TomcatAJPConnector">
      <attribute name="host">0.0.0.0</attribute>
      <attribute name="port">8009</attribute>
      <attribute name="redirectPort">8443</attribute>
    </gbean>
    <gbean name="TomcatWebSSLConnector">
      <attribute name="host">0.0.0.0</attribute>
      <attribute name="port">8443</attribute>
    </gbean>
    <gbean
name="geronimo.server:J2EEApplication=null,J2EEModule=geronimo/ tomcat/1.0/ca
r,J2EEServer=geronimo,j2eeType=GBean,name=TomcatWebContainer">
      <attribute name="catalinaHome">var/catalina</attribute>
<!-- change 1 -->
      <reference name="EngineGBean">
        <name>tomcat_engine</name>
      </reference>
<!-- /change 1 -->
    </gbean>

<!-- change 2 -->
    <gbean gbeanInfo="org.apache.geronimo.tomcat.EngineGBean"
name="geronimo/tomcat/1.1/car?ServiceModule=geronimo/tomcat/1.1/ car,j2eeType
=GBean,name=tomcat_engine">
      <attribute
name="className">org.apache.geronimo.tomcat.TomcatEngine</attribute>
      <attribute name="initParams"></attribute>
      <reference name="EngineGBean">
        <name>TomcatEngine</name>
      </reference>

    <reference name="TomcatValveChain">
      <name>FirstValve</name>
    </reference>
    </gbean>

<gbean name="FirstValve" class="org.apache.geronimo.tomcat.ValveGBean">
    <attribute
name="className">org.apache.catalina.valves.AccessLogValve</attribute>
    <attribute name="initParams">
        prefix=apenootjes
        suffix=.txt
        pattern=common
    </attribute>
    <reference name="NextValve">
        <name>SecondValve</name>
    </reference>
</gbean>

<gbean name="SecondValve" class="org.apache.geronimo.tomcat.ValveGBean">
    <attribute
name="className">org.apache.catalina.valves.RemoteAddrValve</ attribute>
    <attribute name="initParams">
        allow=127.0.0.1,10.0.0.*
        deny=*
    </attribute>
</gbean>
<!-- /change 2 -->
  </configuration>


Booting Geronimo Kernel (in Java 1.4.2_11)...
10:42:39,551 ERROR [GBeanInstanceState] Error while starting; GBean is now
in the FAILED state:
objectName="geronimo.server:J2EEApplication=null,J2EEModule=geronimo/j 2ee-sy stem/1.0/ car,J2EEServer=geronimo,j2eeType=AttributeStore,name=AttributeManag
er"
java.lang.NullPointerException
        at
org.apache.geronimo.system.configuration.GBeanOverride.<init> (GBeanOverride.
java:128)
        at
org.apache.geronimo.system.configuration.ConfigurationOverride.<init>( Config
urationOverride.java:51)
        at
org.apache.geronimo.system.configuration.ServerOverride.<init> (ServerOverrid
e.java:41)
        at
org.apache.geronimo.system.configuration.LocalAttributeManager.load (LocalAtt
ributeManager.java:323)
        at
org.apache.geronimo.system.configuration.LocalAttributeManager.doStart (Local
AttributeManager.java:419)
        at
org.apache.geronimo.gbean.runtime.GBeanInstance.createInstance (GBeanInstance
.java:936)
        at
org.apache.geronimo.gbean.runtime.GBeanInstanceState.attemptFullStart( GBeanI
nstanceState.java:325)
        at
org.apache.geronimo.gbean.runtime.GBeanInstanceState.start (GBeanInstanceStat
e.java:110)
        at
org.apache.geronimo.gbean.runtime.GBeanInstanceState.startRecursive (GBeanIns
tanceState.java:132)
        at
org.apache.geronimo.gbean.runtime.GBeanInstance.startRecursive (GBeanInstance
.java:537)
        at
org.apache.geronimo.kernel.basic.BasicKernel.startRecursiveGBean (BasicKernel
.java:208)
        at
org.apache.geronimo.kernel.config.Configuration.startRecursiveGBeans (Configu
ration.java:315)
        at
org.apache.geronimo.kernel.config.Configuration$$FastClassByCGLIB$ $7f4b4a9b.
invoke(<generated>)
        at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
        at
org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke (FastMethodInvoker
.java:38)
        at
org.apache.geronimo.gbean.runtime.GBeanOperation.invoke (GBeanOperation.java:
118)
        at
org.apache.geronimo.gbean.runtime.GBeanInstance.invoke (GBeanInstance.java:83
5)
        at
org.apache.geronimo.kernel.basic.BasicKernel.invoke (BasicKernel.java:178)
        at
org.apache.geronimo.kernel.basic.BasicKernel.invoke (BasicKernel.java:173) at org.apache.geronimo.system.main.Daemon.doStartup (Daemon.java:286) at org.apache.geronimo.system.main.Daemon.<init> (Daemon.java:82) at org.apache.geronimo.system.main.Daemon.main(Daemon.java: 404)
Server Startup failed


________________________________

From: David Jencks [mailto:[EMAIL PROTECTED]
Sent: Sunday, September 24, 2006 12:37 AM
To: [email protected]
Subject: Re: Tomcat Valves in Geronimo



On Sep 23, 2006, at 3:05 PM, Rik wrote:


                Hello All,

                I've been quite impressed with certain features of Geronimo,
notably the pleasant, simple admin console and the speed of installing and restarting applications. However I have been unsuccessful in my attempts to
configure the version of Tomcat embedded in the release.

        
Thanks for the complement!

It might not be easy to change the tomcat version. Knowing which geronimo release you are working with would be helpful in thinking about what you might do. Out of curiousity why do you want to change the tomcat version?


                        I have been trying to configure tomcat valves; the
JDBCAccessLogValve and RemoteAddrValve. I found some examples on the IBM website and in the geronimo documentation, but couldn't get them to work.

        
This should definitely work without changing which tomcat you are using. Did you get errors or just no effect? Showing what you did to install them
and the results would be helpful.

thanks
david jencks


                        Embarrassingly I've not been successful trying to
compile the sources from the trunk either, which keeps compaining about
missing resources. I'm pretty sure I've followed the directions in the
documentation.

        Is there someone who has the time to walk this newbie through the
configuration and building process?

                Thanks,

                Rick


        


Reply via email to