Skip to content

Commit

Permalink
Merge pull request #226 from zenoss/feature/ZEN-34899
Browse files Browse the repository at this point in the history
ZEN-34889: Garfield env is missing the jetty.ini configuration file
  • Loading branch information
Deer-WarLord authored May 22, 2024
2 parents 5d2e10a + a845b08 commit a07e1da
Show file tree
Hide file tree
Showing 9 changed files with 129 additions and 0 deletions.
16 changes: 16 additions & 0 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,11 @@
<artifactId>jetty-deploy</artifactId>
<version>${jetty.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-jmx</artifactId>
<version>${jetty.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-webapp</artifactId>
Expand Down Expand Up @@ -401,7 +406,13 @@
<jettyXml>${project.basedir}/../dist/src/assembly/etc/zeneventserver/jetty/jetty-deploy.xml</jettyXml>
<jettyXml>${project.basedir}/../dist/src/assembly/etc/zeneventserver/jetty/jetty-http.xml</jettyXml>
<jettyXml>${project.basedir}/../dist/src/assembly/etc/zeneventserver/jetty/jetty-webapp.xml</jettyXml>
<jettyXml>${project.basedir}/../dist/src/assembly/etc/zeneventserver/jetty/jetty-jmx.xml</jettyXml>
<jettyXml>${project.basedir}/../dist/src/assembly/etc/zeneventserver/jetty/jetty-jmx-remote.xml</jettyXml>
</jettyXmls>
<modules>
<module>${project.basedir}/../dist/src/assembly/modules/jmx.mod</module>
<module>${project.basedir}/../dist/src/assembly/modules/jmx-remote.mod</module>
</modules>
<supportedPackagings>
<supportedPackaging>jar</supportedPackaging>
</supportedPackagings>
Expand Down Expand Up @@ -441,6 +452,11 @@
<artifactId>jetty-util-ajax</artifactId>
<version>${jetty.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-jmx</artifactId>
<version>${jetty.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.toolchain</groupId>
<artifactId>jetty-jakarta-servlet-api</artifactId>
Expand Down
7 changes: 7 additions & 0 deletions dist/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@
<type>jar</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-jmx</artifactId>
<version>${jetty.version}</version>
<type>jar</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
Expand Down
7 changes: 7 additions & 0 deletions dist/src/assembly/bin/zeneventserver-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ JETTYSTART_JAR=`ls -1 ${JETTY_HOME}/lib/jetty-start*.jar`
JETTY_ARGS="--module=centralized-webapp-logging,http,ext"
PS="ps"

[ -n "$JETTY_MODULES" ] && {
JETTY_ARGS="$JETTY_ARGS,$JETTY_MODULES";
echo "Additional modules added for jetty startup: $JETTY_ARGS";
}

# Add --add-opens args to open modules to pre-module code.
OPEN_PACKAGES="java.base/java.lang java.base/java.nio java.base/java.io"
for pkg in ${OPEN_PACKAGES}; do
Expand Down Expand Up @@ -307,6 +312,8 @@ Usage: $0 {start|stop|restart|status|run|run_quiet|threads} [options]
threads - display thread status to stdout
for running jetty with additional modules export JETTY_MODULES variable, eg JETTY_MODULES="jmx,jmx-remote"
HELP
exit 1
esac
Expand Down
20 changes: 20 additions & 0 deletions dist/src/assembly/etc/zeneventserver/jetty/jetty-jmx-remote.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_10_0.dtd">

<Configure id="Server" class="org.eclipse.jetty.server.Server">
<Call name="addBean">
<Arg>
<New id="JMXConnectorServer" class="org.eclipse.jetty.jmx.ConnectorServer">
<Arg>
<New class="javax.management.remote.JMXServiceURL">
<Arg type="java.lang.String">rmi</Arg>
<Arg type="java.lang.String"><Property name="jetty.jmxremote.rmiserverhost" default="localhost"/></Arg>
<Arg type="java.lang.Integer"><Property name="jetty.jmxremote.rmiserverport" default="1099"/></Arg>
<Arg type="java.lang.String">/jndi/rmi://<Property name="jetty.jmxremote.rmiregistryhost" default="localhost"/>:<Property name="jetty.jmxremote.rmiregistryport" default="1099"/>/jmxrmi</Arg>
</New>
</Arg>
<Arg>org.eclipse.jetty.jmx:name=jmxconnectorserver</Arg>
</New>
</Arg>
</Call>
</Configure>
30 changes: 30 additions & 0 deletions dist/src/assembly/etc/zeneventserver/jetty/jetty-jmx.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_10_0.dtd">

<Configure id="Server" class="org.eclipse.jetty.server.Server">

<!-- =========================================================== -->
<!-- Get the platform MBeanServer -->
<!-- =========================================================== -->
<Call id="MBeanServer" class="java.lang.management.ManagementFactory"
name="getPlatformMBeanServer" />

<!-- =========================================================== -->
<!-- Initialize the Jetty MBeanContainer -->
<!-- =========================================================== -->
<Call name="addBean">
<Arg>
<New id="MBeanContainer" class="org.eclipse.jetty.jmx.MBeanContainer">
<Arg>
<Ref refid="MBeanServer" />
</Arg>
<Call name="beanAdded">
<Arg/>
<Arg>
<Get name="ILoggerFactory" class="org.slf4j.LoggerFactory"/>
</Arg>
</Call>
</New>
</Arg>
</Call>
</Configure>
26 changes: 26 additions & 0 deletions dist/src/assembly/modules/jmx-remote.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[description]
Enables clear-text remote RMI access to platform MBeans.

[depend]
jmx

[xml]
etc/zeneventserver/jetty/jetty-jmx-remote.xml

[ini-template]
# tag::documentation[]
## The host/address to bind the RMI server to.
# jetty.jmxremote.rmiserverhost=localhost

## The port the RMI server listens to (0 means a random port is chosen).
# jetty.jmxremote.rmiserverport=1099

## The host/address to bind the RMI registry to.
# jetty.jmxremote.rmiregistryhost=localhost

## The port the RMI registry listens to.
# jetty.jmxremote.rmiregistryport=1099

## The host name exported in the RMI stub.
-Djava.rmi.server.hostname=localhost
# end::documentation[]
11 changes: 11 additions & 0 deletions dist/src/assembly/modules/jmx.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[description]
Enables local JMX support for Jetty components.

[depend]
server

[lib]
lib/jetty-jmx-${jetty.version}.jar

[xml]
etc/zeneventserver/jetty/jetty-jmx.xml
1 change: 1 addition & 0 deletions dist/src/main/assembly/zeneventserver-webapp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<include>org.eclipse.jetty:jetty-servlet</include>
<include>org.eclipse.jetty:jetty-security</include>
<include>org.eclipse.jetty:jetty-util-ajax</include>
<include>org.eclipse.jetty:jetty-jmx</include>
<include>org.eclipse.jetty.toolchain:jetty-jakarta-servlet-api</include>
<include>org.zenoss.zep:zep-core</include>
<include>org.slf4j:slf4j-api</include>
Expand Down
11 changes: 11 additions & 0 deletions webapp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,13 @@
<jettyXml>${project.basedir}/../dist/src/assembly/etc/zeneventserver/jetty/jetty-deploy.xml</jettyXml>
<jettyXml>${project.basedir}/../dist/src/assembly/etc/zeneventserver/jetty/jetty-http.xml</jettyXml>
<jettyXml>${project.basedir}/../dist/src/assembly/etc/zeneventserver/jetty/jetty-webapp.xml</jettyXml>
<jettyXml>${project.basedir}/../dist/src/assembly/etc/zeneventserver/jetty/jetty-jmx.xml</jettyXml>
<jettyXml>${project.basedir}/../dist/src/assembly/etc/zeneventserver/jetty/jetty-jmx-remote.xml</jettyXml>
</jettyXmls>
<modules>
<module>${project.basedir}/../dist/src/assembly/modules/jmx.mod</module>
<module>${project.basedir}/../dist/src/assembly/modules/jmx-remote.mod</module>
</modules>
<webApp>
<contextPath>/zeneventserver</contextPath>
<throwUnavailableOnStartupException>true</throwUnavailableOnStartupException>
Expand Down Expand Up @@ -191,6 +197,11 @@
<artifactId>jetty-util-ajax</artifactId>
<version>${jetty.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-jmx</artifactId>
<version>${jetty.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.toolchain</groupId>
<artifactId>jetty-jakarta-servlet-api</artifactId>
Expand Down

0 comments on commit a07e1da

Please sign in to comment.