geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From toby cabot <t...@caboteria.org>
Subject adding dependency jars to a GBean at run-time?
Date Tue, 05 Jun 2007 20:46:29 GMT
Hi Folks,

In my application of Geronimo I need to add a third-party log4j
appender to send log messages as SNMP traps.  I can add the jars I
need to the j2ee-system pom.xml and build a custom Geronimo image, but
it would be better if I could do everything at run-time so I could use
an unmolested Geronimo.

Is there a way to add dependency jars to a configuration at run-time?
For example, could I add something to config.xml so that my jars would
get added to the j2ee-system classpath?  I tried adding the following
to var/config/config.xml (based on some other :

    <module name="org.apache.geronimo.configs/j2ee-system/2.0-SNAPSHOT/car">
        <gbean name="org.apache.geronimo.configs/j2ee-system/2.0-SNAPSHOT/car?ServiceModule=org.apache.geronimo.configs/j2ee-system/2.0-SNAPSHOT/car,j2eeType=SystemLog,name=Logger">
            <attribute name="configFileName">/path/to/my/log4j.xml</attribute>
            <attribute name="defaultEnvironment">
                <environment xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2">
                 <dependencies>
                  <dependency>
                      <groupId>westhawk</groupId>
                      <artifactId>snmp</artifactId>
                      <type>jar</type>
                      <version>5.1</version>
                  </dependency>
                  <dependency>
                      <groupId>mycode</groupId>
                      <artifactId>log</artifactId>
                      <type>jar</type>
                      <version>1.0</version>
                  </dependency>
                 </dependencies>
               </environment>
            </attribute>
        </gbean>
    </module>

This partially worked - Geronimo used my log4j.xml file.  It didn't
add the jars to the classpath, though.  The jars are in the repository
and they're added to the classpath when I declare them in the pom.xml
and rebuild.

Thanks,
Toby

Mime
View raw message