Skip to content

Commit

Permalink
Add dummy value for Jetty 9 logging system property when using Jetty 12.
Browse files Browse the repository at this point in the history
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
  • Loading branch information
lachlan-roberts committed Mar 13, 2024
1 parent 8b76edd commit 845d97f
Showing 1 changed file with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

package com.google.apphosting.runtime.jetty;

import static java.nio.charset.StandardCharsets.UTF_8;

import com.google.apphosting.base.AppVersionKey;
import com.google.apphosting.base.protos.AppinfoPb;
import com.google.apphosting.base.protos.RuntimePb.UPRequest;
Expand All @@ -32,19 +30,22 @@
import com.google.apphosting.utils.config.AppEngineConfigException;
import com.google.apphosting.utils.config.AppYaml;
import com.google.common.flogger.GoogleLogger;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStreamReader;
import java.util.Objects;
import java.util.concurrent.ExecutionException;
import org.eclipse.jetty.http.CookieCompliance;
import org.eclipse.jetty.http.UriCompliance;
import org.eclipse.jetty.server.HttpConfiguration;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.util.VirtualThreads;
import org.eclipse.jetty.util.thread.QueuedThreadPool;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStreamReader;
import java.util.Objects;
import java.util.concurrent.ExecutionException;

import static java.nio.charset.StandardCharsets.UTF_8;

/**
* This is an implementation of ServletEngineAdapter that uses the third-party Jetty servlet engine.
*
Expand All @@ -66,6 +67,10 @@ public class JettyServletEngineAdapter implements ServletEngineAdapter {
private AppVersionKey lastAppVersionKey;

static {
// Set legacy system property to dummy value because external libraries (google-auth-library-java)
// test if this value is null to decide whether it is Java 7 runtime.
System.setProperty("org.eclipse.jetty.util.log.class", "DEPRECATED");

// Remove internal URLs.
System.setProperty("java.vendor.url", "");
System.setProperty("java.vendor.url.bug", "");
Expand Down

0 comments on commit 845d97f

Please sign in to comment.