diff --git a/docs/JDK17-build-report.md b/docs/JDK17-build-report.md new file mode 100644 index 000000000..ee9744296 --- /dev/null +++ b/docs/JDK17-build-report.md @@ -0,0 +1,159 @@ +# Apache Synapse — JDK 17 iterative build report + +**Branch:** `dev-thisara` +**Goal:** Build the project with Java 17, skipping modules that fail due to Java version mismatch (without modifying failing source), and rebuild until a distribution is produced. + +**JDK used:** `JAVA_HOME=` + +--- + +## Build iterations + +### Iteration 0 — Full reactor (`mvn clean install -DskipTests`) + +**Result:** FAILURE at `synapse-securevault` (compile). + +**Root cause:** Google ErrorProne is wired as a javac plugin (`-Xplugin:ErrorProne`) with ErrorProne 2.10.0. On JDK 9+, the compiler APIs live in the `jdk.compiler` module and are not accessible to the unnamed module where ErrorProne loads, causing: + +```text +java.lang.IllegalAccessError: class com.google.errorprone.BaseErrorProneJavaCompiler ... cannot access class com.sun.tools.javac.api.BasicJavacTask (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.api to unnamed module +``` + +This is a **toolchain / JDK encapsulation** issue, not application source. + +**How we proceed (without editing failing module source):** Retry with JVM `add-opens` for the compiler so ErrorProne can attach (see Iteration 1). Alternative would be disabling ErrorProne via POM/profile (not used here first). + +--- + +### Iteration 1 — `mvn clean install -DskipTests` + `MAVEN_OPTS` (`--add-opens` for `jdk.compiler`) + +**Result:** Progressed past securevault; **FAILURE** at `synapse-amqp-transport`. + +**Workaround applied for ErrorProne:** Export `MAVEN_OPTS` with `--add-opens` for `jdk.compiler` packages (see **Final recommended command** at end). This is **not** a source change; it only relaxes JDK module boundaries for the forked javac/ErrorProne process. + +**New failure — AMQP transport (`synapse-amqp-transport`):** + +```text +error: Source option 6 is no longer supported. Use 7 or later. +error: Target option 6 is no longer supported. Use 7 or later. +``` + +**Why:** That module pins **Java 6** (`source`/`target` 1.6) and uses **maven-compiler-plugin 2.3.2**, which ignores the parent’s ErrorProne settings (warnings in log). JDK **17’s `javac` no longer accepts `-source 6`/`-target 6`**. + +**How we skip it:** Omit the module from the reactor so the rest of the tree still builds: +`-pl '!org.apache.synapse:synapse-amqp-transport'` +(Any downstream dependency on this JAR must be excluded or the distribution step adjusted—see later iterations.) + +--- + +### Iteration 2 — Rebuild excluding AMQP module (`-pl '!org.apache.synapse:synapse-amqp-transport'`) + `MAVEN_OPTS` + +**Result:** FAILURE at `synapse-core` during **Felix `maven-bundle-plugin`** (`bundle` goal). + +**Root cause:** The embedded **bnd** in `maven-bundle-plugin` **2.3.6** cannot parse **Java 17 class files** (major version 61). The first class that tripped the parser was `org/apache/synapse/jmx/JmxSerializationFilterSupport.class` (compiled from Java 9+ APIs on this branch). + +```text +java.lang.ArrayIndexOutOfBoundsException: Index 18 out of bounds for length 13 + at aQute.lib.osgi.Clazz.parseClassFile(Clazz.java:448) +... +[ERROR] Invalid class file: org/apache/synapse/jmx/JmxSerializationFilterSupport.class +``` + +**How we addressed it:** Raised **`maven-bundle-plugin`** in the root `pom.xml` `pluginManagement` from **2.3.6 → 5.1.9** so OSGi manifest generation uses a **bnd** stack that understands JDK 17 bytecode. This is **build-tooling**, not a change to the failing transport sources. + +--- + +### Iteration 3 — After bundle plugin bump; AMQP still excluded + +**Result:** FAILURE at **`synapse-war`** (`maven-war-plugin:2.1.1:war`). + +**Root cause:** **maven-war-plugin 2.1.1** is not compatible with running Maven on **JDK 17** (reflective access to `Properties` / `Hashtable` internals). + +```text +Cannot access defaults field of Properties +... WebappStructureSerializer +``` + +**How we addressed it:** Bumped **`maven-war-plugin`** in root `pluginManagement` from **2.1.1 → 3.4.0**. + +--- + +### Iteration 4 — Distribution dependency + successful reactor + +**Distribution:** With `synapse-amqp-transport` **not** built, the **`synapse-amqp-transport`** dependency in `modules/distribution/pom.xml` would fail resolution. That dependency was **commented out** (with a pointer to this doc) so the binary/source assemblies can package without the skipped module. + +**Result:** **BUILD SUCCESS** (tests skipped). + +--- + +## Final recommended command (JDK 17) + +Set Java 17, add compiler opens for ErrorProne, exclude AMQP from the reactor, skip tests: + +```bash +export JAVA_HOME= +export PATH="$JAVA_HOME/bin:$PATH" +export MAVEN_OPTS="--add-opens jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED" + +cd +mvn clean install -DskipTests -pl '!org.apache.synapse:synapse-amqp-transport' +``` + +--- + +## Distribution outputs (`target` directories) + +After a successful build, the main **binary and source distributions** are under **`modules/distribution/target/`**: + +| Artifact | Path | +|----------|------| +| Binary tarball | `modules/distribution/target/synapse-3.0.3-SNAPSHOT-bin.tar.gz` | +| Binary zip | `modules/distribution/target/synapse-3.0.3-SNAPSHOT-bin.zip` | +| Source tarball | `modules/distribution/target/synapse-3.0.3-SNAPSHOT-src.tar.gz` | +| Source zip | `modules/distribution/target/synapse-3.0.3-SNAPSHOT-src.zip` | + +Other notable `target` outputs: e.g. `modules/war/target/synapse.war`, per-module JARs under each `modules/*/target/`. + +--- + +## What was skipped vs changed + +| Item | Action | +|------|--------| +| **`synapse-amqp-transport`** | **Skipped** from reactor (Java 6 not supported by JDK 17 `javac`). **Source not modified.** | +| **ErrorProne on JDK 17** | **Workaround:** `MAVEN_OPTS` `--add-opens` for `jdk.compiler` (no POM change). | +| **`maven-bundle-plugin`** | **Version bump** in root POM (tooling). | +| **`maven-war-plugin`** | **Version bump** in root POM (tooling). | +| **`modules/distribution/pom.xml`** | **`synapse-amqp-transport` dependency commented out** so packaging resolves when that module is omitted. | + +To include AMQP again, the module would need its **compiler level** raised (at least 7+, typically 8+) and a **newer `maven-compiler-plugin`** in that module’s POM, then restore the distribution dependency and drop `-pl` exclusion. + +--- + +## Post-build runtime launcher fix (`synapse.sh`) + +After extracting/using the built distribution with Java 17, startup initially failed before Synapse bootstrap with: + +```text +-Djava.endorsed.dirs=... is not supported +Error: Could not create the Java Virtual Machine. +``` + +**Why this happened:** `bin/synapse.sh` always passed `-Djava.endorsed.dirs`, but that JVM option was removed in Java 9+. + +**Fix applied:** updated launcher logic to pass endorsed dirs only for Java 8 and below. + +Files updated: + +- `modules/distribution/src/main/bin/synapse.sh` (source template for future distributions) +- `/bin/synapse.sh` (already built local runtime script) + +Implementation detail: + +- Added `ENDORSED_PROP` variable. +- Set it only when detected Java is 1.6/1.7/1.8. +- Replaced hardcoded `-Djava.endorsed.dirs=$SYNAPSE_ENDORSED` in the java command with `$ENDORSED_PROP`. + +**Validation:** reran `./synapse.sh` with Java 17; Synapse reached full startup (`Apache Synapse started successfully`). + + diff --git a/modules/commons/src/main/java/org/apache/synapse/commons/jmx/JmxConfigurationConstants.java b/modules/commons/src/main/java/org/apache/synapse/commons/jmx/JmxConfigurationConstants.java index 51c9acfc6..59f60535f 100644 --- a/modules/commons/src/main/java/org/apache/synapse/commons/jmx/JmxConfigurationConstants.java +++ b/modules/commons/src/main/java/org/apache/synapse/commons/jmx/JmxConfigurationConstants.java @@ -40,5 +40,12 @@ public class JmxConfigurationConstants { /** Property to activate remote SSL support (same as com.sun.management.jmxremote.ssl) */ public static final String PROP_REMOTE_SSL = "remote.ssl"; - + + /** Property to configure JEP 290 serial filter for remote JMX RMI. */ + public static final String PROP_REMOTE_SERIAL_FILTER_PATTERN = "remote.serial.filter.pattern"; + + /** Standard JMX connector environment key for the RMI deserialization filter pattern. */ + public static final String JMX_REMOTE_SERIAL_FILTER_PATTERN = + "jmx.remote.rmi.server.serial.filter.pattern"; + } diff --git a/modules/commons/src/main/java/org/apache/synapse/commons/jmx/JmxInformation.java b/modules/commons/src/main/java/org/apache/synapse/commons/jmx/JmxInformation.java index 5ea7f8f18..ce60b62f7 100644 --- a/modules/commons/src/main/java/org/apache/synapse/commons/jmx/JmxInformation.java +++ b/modules/commons/src/main/java/org/apache/synapse/commons/jmx/JmxInformation.java @@ -45,6 +45,9 @@ public class JmxInformation { /** Use remote SSL? */ private boolean remoteSSL; + + /** JEP 290 filter pattern used by remote JMX RMI deserialization. */ + private String remoteSerialFilterPattern; /** * The jmxUrl to connect to. @@ -114,6 +117,14 @@ public boolean isRemoteSSL() { public void setRemoteSSL(boolean remoteSSL) { this.remoteSSL = remoteSSL; } + + public String getRemoteSerialFilterPattern() { + return remoteSerialFilterPattern; + } + + public void setRemoteSerialFilterPattern(String remoteSerialFilterPattern) { + this.remoteSerialFilterPattern = remoteSerialFilterPattern; + } /** * Builds the JMX URL depending on the existence of RMI port. diff --git a/modules/commons/src/main/java/org/apache/synapse/commons/jmx/JmxInformationFactory.java b/modules/commons/src/main/java/org/apache/synapse/commons/jmx/JmxInformationFactory.java index fc45516e2..a33c5357c 100644 --- a/modules/commons/src/main/java/org/apache/synapse/commons/jmx/JmxInformationFactory.java +++ b/modules/commons/src/main/java/org/apache/synapse/commons/jmx/JmxInformationFactory.java @@ -117,6 +117,12 @@ public static JmxInformation createJmxInformation(Properties properties, String } jmxInformation.setRemoteSSL(remoteSSL); + value = MiscellaneousUtil.getProperty(properties, + prefix + JmxConfigurationConstants.PROP_REMOTE_SERIAL_FILTER_PATTERN, null); + if (value != null && value.trim().length() > 0) { + jmxInformation.setRemoteSerialFilterPattern(value); + } + return jmxInformation; } diff --git a/modules/commons/src/test/java/org/apache/synapse/commons/jmx/JmxInformationFactoryTest.java b/modules/commons/src/test/java/org/apache/synapse/commons/jmx/JmxInformationFactoryTest.java new file mode 100644 index 000000000..3ec8579c0 --- /dev/null +++ b/modules/commons/src/test/java/org/apache/synapse/commons/jmx/JmxInformationFactoryTest.java @@ -0,0 +1,63 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.synapse.commons.jmx; + +import junit.framework.TestCase; + +import java.util.Properties; + +public class JmxInformationFactoryTest extends TestCase { + + public void testSerialFilterPatternNotAppliedWhenUnset() { + Properties properties = new Properties(); + + JmxInformation info = JmxInformationFactory.createJmxInformation(properties, "localhost"); + + assertEquals(-1, info.getJndiPort()); + assertNull(info.getRemoteSerialFilterPattern()); + } + + public void testConfiguredJndiPortIsKept() { + Properties properties = new Properties(); + properties.setProperty("synapse.jmx.jndiPort", "0"); + + JmxInformation info = JmxInformationFactory.createJmxInformation(properties, "localhost"); + + assertEquals(0, info.getJndiPort()); + } + + public void testSynapseSerialFilterOverrideUsed() { + String customPattern = "maxdepth=10;java.lang.*;!*"; + Properties properties = new Properties(); + properties.setProperty("synapse.jmx.remote.serial.filter.pattern", customPattern); + + JmxInformation info = JmxInformationFactory.createJmxInformation(properties, "localhost"); + + assertEquals(customPattern, info.getRemoteSerialFilterPattern()); + } + + public void testBlankSerialFilterPatternIsIgnored() { + Properties properties = new Properties(); + properties.setProperty("synapse.jmx.remote.serial.filter.pattern", " "); + + JmxInformation info = JmxInformationFactory.createJmxInformation(properties, "localhost"); + + assertNull(info.getRemoteSerialFilterPattern()); + } +} diff --git a/modules/core/src/main/java/org/apache/synapse/JmxAdapter.java b/modules/core/src/main/java/org/apache/synapse/JmxAdapter.java index d54ee19c7..4ae48c304 100644 --- a/modules/core/src/main/java/org/apache/synapse/JmxAdapter.java +++ b/modules/core/src/main/java/org/apache/synapse/JmxAdapter.java @@ -25,6 +25,7 @@ import org.apache.synapse.commons.util.RMIRegistryController; import org.apache.synapse.commons.jmx.JmxInformation; import org.apache.synapse.commons.jmx.JmxSecretAuthenticator; +import org.apache.synapse.jmx.JmxSerializationFilterSupport; import javax.management.MBeanServer; import javax.management.remote.JMXConnectorServer; @@ -204,6 +205,17 @@ public void setJmxInformation(JmxInformation jmxInformation) { private Map createContextMap() { Map env = new HashMap(); + String remoteSerialFilterPattern = jmxInformation.getRemoteSerialFilterPattern(); + if (remoteSerialFilterPattern != null && remoteSerialFilterPattern.trim().length() > 0) { + // Deserialization limits are applied via JmxSerializationFilterSupport (JEP 415 factory), + // not via jmx.remote.rmi.server.serial.filter.pattern in the connector env. + JmxSerializationFilterSupport.configureForJmxPattern(remoteSerialFilterPattern, log); + if (log.isDebugEnabled()) { + log.debug("Configured JEP 290 deserialization filter for remote JMX: " + + remoteSerialFilterPattern); + } + } + if (jmxInformation.isAuthenticate()) { if (jmxInformation.getRemotePasswordFile() != null) { diff --git a/modules/core/src/main/java/org/apache/synapse/jmx/JmxSerializationFilterSupport.java b/modules/core/src/main/java/org/apache/synapse/jmx/JmxSerializationFilterSupport.java new file mode 100644 index 000000000..82b360f28 --- /dev/null +++ b/modules/core/src/main/java/org/apache/synapse/jmx/JmxSerializationFilterSupport.java @@ -0,0 +1,91 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.synapse.jmx; + +import org.apache.commons.logging.Log; + +import java.io.ObjectInputFilter; +import java.util.function.BinaryOperator; + +/** + * Installs JEP 415 context-specific deserialization control for remote JMX without using + * {@code ObjectInputFilter.Config.setSerialFilter} for the entire JVM. + *

+ * Synapse targets Java 17+; the configured JMX pattern is merged with the stream filter only when + * the stack indicates deserialization for {@code javax.management.remote} / {@code com.sun.jmx.remote}. + */ +public final class JmxSerializationFilterSupport { + + private JmxSerializationFilterSupport() { + } + + /** + * Installs a {@link ObjectInputFilter.Config#setSerialFilterFactory serial filter factory} + * that merges the given pattern for JMX/RMI deserialization stacks. + * + * @param pattern non-empty filter pattern (same string as {@code synapse.jmx.remote.serial.filter.pattern}) + * @param log logger (typically {@link org.apache.synapse.JmxAdapter}) + */ + public static void configureForJmxPattern(String pattern, Log log) { + if (pattern == null || pattern.trim().isEmpty()) { + return; + } + try { + ObjectInputFilter jmxFilter = ObjectInputFilter.Config.createFilter(pattern); + BinaryOperator factory = (curr, next) -> { + ObjectInputFilter base = next != null ? next : curr; + if (base == null) { + base = ObjectInputFilter.Config.getSerialFilter(); + } + if (!isJmxRemoteDeserializationStack()) { + return base; + } + return ObjectInputFilter.merge(jmxFilter, base); + }; + ObjectInputFilter.Config.setSerialFilterFactory(factory); + log.info("Installed JEP 415 serial filter factory for JMX deserialization"); + if (log.isDebugEnabled()) { + log.debug("JEP 415 serial filter factory installed for JMX/RMI stacks"); + } + } catch (IllegalStateException e) { + log.warn("Serial filter factory already set; leaving existing factory in place: " + + e.getMessage()); + } catch (RuntimeException e) { + if (log.isDebugEnabled()) { + log.debug("JEP 415 serial filter factory failed: " + e.getMessage(), e); + } + log.warn("Could not install JEP 415 serial filter factory; check JDK configuration."); + } + } + + /** + * Detect JMX-over-RMI deserialization by stack frames. + */ + static boolean isJmxRemoteDeserializationStack() { + StackTraceElement[] trace = Thread.currentThread().getStackTrace(); + for (int i = 0; i < trace.length && i < 40; i++) { + String name = trace[i].getClassName(); + if (name.startsWith("javax.management.remote.") + || name.startsWith("com.sun.jmx.remote")) { + return true; + } + } + return false; + } +} diff --git a/modules/core/src/test/java/org/apache/synapse/JmxAdapterContextMapTest.java b/modules/core/src/test/java/org/apache/synapse/JmxAdapterContextMapTest.java new file mode 100644 index 000000000..ae1b30487 --- /dev/null +++ b/modules/core/src/test/java/org/apache/synapse/JmxAdapterContextMapTest.java @@ -0,0 +1,76 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.synapse; + +import junit.framework.TestCase; +import org.apache.synapse.commons.jmx.JmxConfigurationConstants; +import org.apache.synapse.commons.jmx.JmxInformation; +import org.apache.synapse.commons.jmx.JmxSecretAuthenticator; +import org.apache.synapse.securevault.secret.SecretInformation; + +import javax.management.remote.JMXConnectorServer; +import java.lang.reflect.Method; +import java.util.Map; + +public class JmxAdapterContextMapTest extends TestCase { + + @SuppressWarnings("unchecked") + private Map createContextMap(JmxInformation info) throws Exception { + JmxAdapter adapter = new JmxAdapter(info); + Method method = JmxAdapter.class.getDeclaredMethod("createContextMap"); + method.setAccessible(true); + return (Map) method.invoke(adapter); + } + + /** + * Serial filter pattern is applied via {@code JmxSerializationFilterSupport}, not the standard + * JMX connector env key {@code jmx.remote.rmi.server.serial.filter.pattern}. + */ + public void testContextMapDoesNotPutSerialFilterPatternInEnv() throws Exception { + String filterPattern = "maxdepth=5;java.lang.String;!*"; + JmxInformation info = new JmxInformation(); + info.setRemoteSerialFilterPattern(filterPattern); + + Map env = createContextMap(info); + + assertNull(env.get(JmxConfigurationConstants.JMX_REMOTE_SERIAL_FILTER_PATTERN)); + } + + public void testContextMapIncludesAuthAndSSLWhenEnabled() throws Exception { + String filterPattern = "maxdepth=5;java.lang.String;!*"; + JmxInformation info = new JmxInformation(); + info.setRemoteSerialFilterPattern(filterPattern); + info.setAuthenticate(true); + info.setRemoteAccessFile("conf/jmxremote.access"); + info.setRemoteSSL(true); + + SecretInformation secretInformation = new SecretInformation(); + secretInformation.setUser("admin"); + secretInformation.setAliasSecret("admin"); + info.setSecretInformation(secretInformation); + + Map env = createContextMap(info); + + assertNull(env.get(JmxConfigurationConstants.JMX_REMOTE_SERIAL_FILTER_PATTERN)); + assertTrue(env.get(JMXConnectorServer.AUTHENTICATOR) instanceof JmxSecretAuthenticator); + assertEquals("conf/jmxremote.access", env.get("jmx.remote.x.access.file")); + assertNotNull(env.get("jmx.remote.rmi.client.socket.factory")); + assertNotNull(env.get("jmx.remote.rmi.server.socket.factory")); + } +} diff --git a/modules/distribution/pom.xml b/modules/distribution/pom.xml index 7dea7ce57..75032a16e 100644 --- a/modules/distribution/pom.xml +++ b/modules/distribution/pom.xml @@ -127,10 +127,11 @@ org.apache.synapse synapse-vfs-transport - + + com.oopsconsultancy diff --git a/modules/distribution/src/main/bin/synapse.sh b/modules/distribution/src/main/bin/synapse.sh index dad4a792f..459ddd73f 100644 --- a/modules/distribution/src/main/bin/synapse.sh +++ b/modules/distribution/src/main/bin/synapse.sh @@ -122,6 +122,11 @@ if $cygwin; then fi # endorsed dir SYNAPSE_ENDORSED=$SYNAPSE_HOME/lib/endorsed +ENDORSED_PROP= +# -Djava.endorsed.dirs is removed from Java 9+. +if [ "$jdk_16" -o "$jdk_17" -o "$jdk_18" ]; then + ENDORSED_PROP="-Djava.endorsed.dirs=$SYNAPSE_ENDORSED" +fi # synapse config SYNAPSE_XML=$SYNAPSE_HOME/repository/conf/synapse-config @@ -181,7 +186,7 @@ $JAVA_HOME/bin/java -server -Xms512M -Xmx512M \ $XDEBUG \ $TEMP_PROPS \ -Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.parsers.XMLGrammarCachingConfiguration \ - -Djava.endorsed.dirs=$SYNAPSE_ENDORSED \ + $ENDORSED_PROP \ -Djava.io.tmpdir=$SYNAPSE_HOME/work/temp/synapse \ -classpath $SYNAPSE_CLASSPATH \ org.apache.synapse.SynapseServer \ diff --git a/pom.xml b/pom.xml index 641dd8061..3da66154f 100644 --- a/pom.xml +++ b/pom.xml @@ -303,7 +303,8 @@ org.apache.felix maven-bundle-plugin - 2.3.6 + + 5.1.9 org.apache.maven.plugins @@ -323,7 +324,8 @@ org.apache.maven.plugins maven-war-plugin - 2.1.1 + + 3.4.0 org.codehaus.mojo diff --git a/repository/conf/synapse.properties b/repository/conf/synapse.properties index 576adc15f..e236fbd8c 100644 --- a/repository/conf/synapse.properties +++ b/repository/conf/synapse.properties @@ -115,8 +115,8 @@ ################################################################################ # JMX Configuration ################################################################################ -# Default is to autodetect free port starting at 1099; change it to meet your deployment requirements! -synapse.jmx.jndiPort=0 +# JMX is disabled by default; set to -1 to disable JMX; set this to 0 to autodetect free port starting at 1099; change it to a fixed port to meet your deployment requirements. +synapse.jmx.jndiPort=-1 # By default rmi port will be detected automatically, change it to a fixed port to meet your deployment requirements #synapse.jmx.rmiPort=1101 # By default the hostname will be detected, but you can force to use another network interface @@ -129,6 +129,11 @@ synapse.jmx.jndiPort=0 #synapse.jmx.password=admin # Optionally you may want to specify the location of an remote access file to restrict access #synapse.jmx.remote.access.file= +# Optional deserialization filter for remote JMX. +# Applies only when JMX is enabled (set synapse.jmx.jndiPort to a value other than -1). +# Configure a JEP 415/JEP 290-style deserialization filter pattern as needed; remove/comment out +# synapse.jmx.remote.serial.filter.pattern to disable this additional JMX deserialization filter. +synapse.jmx.remote.serial.filter.pattern=maxdepth=20;maxrefs=1000;maxbytes=262144 ################################################################################################# # Proxy Settings For URL Connections, these are used when synapse retrieves resources from URLs