Browse Source

Updates gemini to 3.0.2 (#5608)

* Updates gemini to 3.0.2

* Removing JSON test type for a test
Mike Smith 5 years ago
parent
commit
94b2bc57d2

+ 0 - 1
frameworks/Java/gemini/benchmark_config.json

@@ -3,7 +3,6 @@
   "tests": [
   "tests": [
     {
     {
       "default": {
       "default": {
-        "json_url": "/json",
         "plaintext_url": "/plaintext",
         "plaintext_url": "/plaintext",
         "port": 8080,
         "port": 8080,
         "approach": "Realistic",
         "approach": "Realistic",

+ 60 - 3
frameworks/Java/gemini/gemini-mysql.dockerfile

@@ -9,11 +9,68 @@ RUN mvn -q compile
 RUN mv src/main/webapp/WEB-INF/configuration/gemini-mysql.conf src/main/webapp/WEB-INF/configuration/Base.conf
 RUN mv src/main/webapp/WEB-INF/configuration/gemini-mysql.conf src/main/webapp/WEB-INF/configuration/Base.conf
 RUN mvn -q war:war
 RUN mvn -q war:war
 
 
-FROM openjdk:11.0.3-jdk-stretch
+FROM openjdk:11-jdk
+RUN apt update -qqy && apt install -yqq curl > /dev/null
 
 
 WORKDIR /resin
 WORKDIR /resin
-RUN curl -sL http://caucho.com/download/resin-4.0.61.tar.gz | tar xz --strip-components=1
+RUN curl -sL http://caucho.com/download/resin-4.0.63.tar.gz | tar xz --strip-components=1
+# Taken from buildpack-deps:stretch - Resin compilation requires JAVA_HOME
+# also added several missing dependencies
+RUN set -ex; \
+  apt-get update; \
+  apt-get install -y --no-install-recommends \
+  autoconf \
+  automake \
+  build-essential \
+  bzip2 \
+  dpkg-dev \
+  file \
+  g++ \
+  gcc \
+  gcc-multilib \
+  imagemagick \
+  libbz2-dev \
+  libc6-dev \
+  libcurl4-openssl-dev \
+  libdb-dev \
+  libevent-dev \
+  libffi-dev \
+  libgdbm-dev \
+  libgeoip-dev \
+  libglib2.0-dev \
+  libgmp-dev \
+  libjpeg-dev \
+  libkrb5-dev \
+  liblzma-dev \
+  libmagickcore-dev \
+  libmagickwand-dev \
+  libncurses5-dev \
+  libncursesw5-dev \
+  libpng-dev \
+  libpq-dev \
+  libreadline-dev \
+  libsqlite3-dev \
+  libssl-dev \
+  libtool \
+  libwebp-dev \
+  libxml2-dev \
+  libxslt-dev \
+  libyaml-dev \
+  linux-libc-dev \
+  linux-headers-amd64 \
+  make \
+  patch \
+  unzip \
+  xz-utils \
+  zlib1g-dev
+
+RUN ./configure --prefix=`pwd` --enable-64bit
+RUN make
+RUN make install
 RUN rm -rf webapps/*
 RUN rm -rf webapps/*
+RUN mkdir logs
 COPY --from=maven /gemini/target/HelloWorld-0.0.1.war webapps/ROOT.war
 COPY --from=maven /gemini/target/HelloWorld-0.0.1.war webapps/ROOT.war
-COPY resin.xml conf/resin.xml
+
+EXPOSE 8080
+
 CMD ["java", "-jar", "lib/resin.jar", "console"]
 CMD ["java", "-jar", "lib/resin.jar", "console"]

+ 60 - 3
frameworks/Java/gemini/gemini-postgres.dockerfile

@@ -9,11 +9,68 @@ RUN mvn -q compile
 RUN mv src/main/webapp/WEB-INF/configuration/gemini-postgres.conf src/main/webapp/WEB-INF/configuration/Base.conf
 RUN mv src/main/webapp/WEB-INF/configuration/gemini-postgres.conf src/main/webapp/WEB-INF/configuration/Base.conf
 RUN mvn -q war:war
 RUN mvn -q war:war
 
 
-FROM openjdk:11.0.3-jdk-stretch
+FROM openjdk:11-jdk
+RUN apt update -qqy && apt install -yqq curl > /dev/null
 
 
 WORKDIR /resin
 WORKDIR /resin
-RUN curl -sL http://caucho.com/download/resin-4.0.61.tar.gz | tar xz --strip-components=1
+RUN curl -sL http://caucho.com/download/resin-4.0.63.tar.gz | tar xz --strip-components=1
+# Taken from buildpack-deps:stretch - Resin compilation requires JAVA_HOME
+# also added several missing dependencies
+RUN set -ex; \
+  apt-get update; \
+  apt-get install -y --no-install-recommends \
+  autoconf \
+  automake \
+  build-essential \
+  bzip2 \
+  dpkg-dev \
+  file \
+  g++ \
+  gcc \
+  gcc-multilib \
+  imagemagick \
+  libbz2-dev \
+  libc6-dev \
+  libcurl4-openssl-dev \
+  libdb-dev \
+  libevent-dev \
+  libffi-dev \
+  libgdbm-dev \
+  libgeoip-dev \
+  libglib2.0-dev \
+  libgmp-dev \
+  libjpeg-dev \
+  libkrb5-dev \
+  liblzma-dev \
+  libmagickcore-dev \
+  libmagickwand-dev \
+  libncurses5-dev \
+  libncursesw5-dev \
+  libpng-dev \
+  libpq-dev \
+  libreadline-dev \
+  libsqlite3-dev \
+  libssl-dev \
+  libtool \
+  libwebp-dev \
+  libxml2-dev \
+  libxslt-dev \
+  libyaml-dev \
+  linux-libc-dev \
+  linux-headers-amd64 \
+  make \
+  patch \
+  unzip \
+  xz-utils \
+  zlib1g-dev
+
+RUN ./configure --prefix=`pwd` --enable-64bit
+RUN make
+RUN make install
 RUN rm -rf webapps/*
 RUN rm -rf webapps/*
+RUN mkdir logs
 COPY --from=maven /gemini/target/HelloWorld-0.0.1.war webapps/ROOT.war
 COPY --from=maven /gemini/target/HelloWorld-0.0.1.war webapps/ROOT.war
-COPY resin.xml conf/resin.xml
+
+EXPOSE 8080
+
 CMD ["java", "-jar", "lib/resin.jar", "console"]
 CMD ["java", "-jar", "lib/resin.jar", "console"]

+ 60 - 3
frameworks/Java/gemini/gemini.dockerfile

@@ -9,11 +9,68 @@ RUN mvn -q compile
 RUN mv src/main/webapp/WEB-INF/configuration/gemini.conf src/main/webapp/WEB-INF/configuration/Base.conf
 RUN mv src/main/webapp/WEB-INF/configuration/gemini.conf src/main/webapp/WEB-INF/configuration/Base.conf
 RUN mvn -q war:war
 RUN mvn -q war:war
 
 
-FROM openjdk:11.0.3-jdk-stretch
+FROM openjdk:11-jdk
+RUN apt update -qqy && apt install -yqq curl > /dev/null
 
 
 WORKDIR /resin
 WORKDIR /resin
-RUN curl -sL http://caucho.com/download/resin-4.0.61.tar.gz | tar xz --strip-components=1
+RUN curl -sL http://caucho.com/download/resin-4.0.63.tar.gz | tar xz --strip-components=1
+# Taken from buildpack-deps:stretch - Resin compilation requires JAVA_HOME
+# also added several missing dependencies
+RUN set -ex; \
+  apt-get update; \
+  apt-get install -y --no-install-recommends \
+  autoconf \
+  automake \
+  build-essential \
+  bzip2 \
+  dpkg-dev \
+  file \
+  g++ \
+  gcc \
+  gcc-multilib \
+  imagemagick \
+  libbz2-dev \
+  libc6-dev \
+  libcurl4-openssl-dev \
+  libdb-dev \
+  libevent-dev \
+  libffi-dev \
+  libgdbm-dev \
+  libgeoip-dev \
+  libglib2.0-dev \
+  libgmp-dev \
+  libjpeg-dev \
+  libkrb5-dev \
+  liblzma-dev \
+  libmagickcore-dev \
+  libmagickwand-dev \
+  libncurses5-dev \
+  libncursesw5-dev \
+  libpng-dev \
+  libpq-dev \
+  libreadline-dev \
+  libsqlite3-dev \
+  libssl-dev \
+  libtool \
+  libwebp-dev \
+  libxml2-dev \
+  libxslt-dev \
+  libyaml-dev \
+  linux-libc-dev \
+  linux-headers-amd64 \
+  make \
+  patch \
+  unzip \
+  xz-utils \
+  zlib1g-dev
+
+RUN ./configure --prefix=`pwd` --enable-64bit
+RUN make
+RUN make install
 RUN rm -rf webapps/*
 RUN rm -rf webapps/*
+RUN mkdir logs
 COPY --from=maven /gemini/target/HelloWorld-0.0.1.war webapps/ROOT.war
 COPY --from=maven /gemini/target/HelloWorld-0.0.1.war webapps/ROOT.war
-COPY resin.xml conf/resin.xml
+
+EXPOSE 8080
+
 CMD ["java", "-jar", "lib/resin.jar", "console"]
 CMD ["java", "-jar", "lib/resin.jar", "console"]

+ 14 - 3
frameworks/Java/gemini/pom.xml

@@ -16,6 +16,11 @@
     </properties>
     </properties>
 
 
     <dependencies>
     <dependencies>
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>javax.servlet-api</artifactId>
+            <version>3.1.0</version>
+        </dependency>
         <dependency>
         <dependency>
             <groupId>mysql</groupId>
             <groupId>mysql</groupId>
             <artifactId>mysql-connector-java</artifactId>
             <artifactId>mysql-connector-java</artifactId>
@@ -29,18 +34,24 @@
         <dependency>
         <dependency>
             <groupId>com.techempower</groupId>
             <groupId>com.techempower</groupId>
             <artifactId>gemini</artifactId>
             <artifactId>gemini</artifactId>
-            <version>2.24.0</version>
+            <version>3.0.2</version>
         </dependency>
         </dependency>
         <dependency>
         <dependency>
             <groupId>com.techempower</groupId>
             <groupId>com.techempower</groupId>
             <artifactId>gemini-jdbc</artifactId>
             <artifactId>gemini-jdbc</artifactId>
-            <version>2.24.0</version>
+            <version>3.0.2</version>
         </dependency>
         </dependency>
         <dependency>
         <dependency>
             <groupId>com.techempower</groupId>
             <groupId>com.techempower</groupId>
             <artifactId>gemini-resin</artifactId>
             <artifactId>gemini-resin</artifactId>
-            <version>2.24.0</version>
+            <version>3.0.2</version>
         </dependency>
         </dependency>
+        <dependency>
+            <groupId>com.google.guava</groupId>
+            <artifactId>guava</artifactId>
+            <version>16.0.1</version>
+        </dependency>
+
     </dependencies>
     </dependencies>
 
 
 </project>
 </project>

+ 2 - 56
frameworks/Java/gemini/src/main/java/hello/GhApplication.java

@@ -19,57 +19,13 @@ import hello.home.handler.*;
  *
  *
  * Development history:
  * Development history:
  *   2012-04-19 - mh - Created
  *   2012-04-19 - mh - Created
+ *   2020-04-17 - ms - Updated to Gemini 3.0.2
  *
  *
  * @author mhixson
  * @author mhixson
  */
  */
 public class GhApplication
 public class GhApplication
      extends ResinGeminiApplication
      extends ResinGeminiApplication
 {
 {
-  //
-  // Static variables.
-  //
-
-  private static final GhApplication INSTANCE = new GhApplication();
-
-  //
-  // Member methods.
-  //
-
-  /**
-   * Constructor.  This method can be extended to construct references
-   * to custom components for the application.
-   */
-  public GhApplication()
-  {
-    super();
-  }
-
-  //
-  // Protected component constructors.
-  //
-
-  /**
-   * Constructs a Version reference.  This is overloaded to return a
-   * custom GhVersion object.
-   */
-  @Override
-  protected Version constructVersion()
-  {
-    return new GhVersion();
-  }
-
-  /**
-   * Creates a JavaScriptWriter for writing JSON.
-   */
-  @Override
-  protected JavaScriptWriter constructJavaScriptWriter()
-  {
-    return LegacyJavaScriptWriter.custom()
-        .addVisitorFactory(World.class, World.VISITOR_FACTORY)
-        .addVisitorFactory(CachedWorld.class, CachedWorld.VISITOR_FACTORY)
-        .build();
-  }
-
   /**
   /**
    * Constructs a Dispatcher.
    * Constructs a Dispatcher.
    */
    */
@@ -90,14 +46,4 @@ public class GhApplication
     return new BasicConnectorFactory(this, null);
     return new BasicConnectorFactory(this, null);
   }
   }
 
 
-  //
-  // Static methods.
-  //
-
-  public static GhApplication getInstance()
-  {
-    return INSTANCE;
-  }
-
-}   // End GhApplication.
-
+}

+ 4 - 7
frameworks/Java/gemini/src/main/java/hello/GhServlet.java

@@ -14,6 +14,7 @@ import com.techempower.gemini.transport.*;
  *
  *
  * Development history:
  * Development history:
  *   2012-04-19 - mh - Created
  *   2012-04-19 - mh - Created
+ *   2020-04-17 - ms - Updated to Gemini 3.0.2
  *
  *
  * @author mhixson
  * @author mhixson
  */
  */
@@ -22,10 +23,7 @@ import com.techempower.gemini.transport.*;
 public class GhServlet
 public class GhServlet
      extends InfrastructureServlet
      extends InfrastructureServlet
 {
 {
-
-  //
-  // Public member methods.
-  //
+  public static final GhApplication APP_INSTANCE = new GhApplication();
 
 
   /**
   /**
    * Gets a GeminiApplication object for this application.
    * Gets a GeminiApplication object for this application.
@@ -33,8 +31,7 @@ public class GhServlet
   @Override
   @Override
   public GhApplication getApplication()
   public GhApplication getApplication()
   {
   {
-    return GhApplication.getInstance();
+    return APP_INSTANCE;
   }
   }
 
 
-}   // End GhServlet.
-
+}

+ 0 - 93
frameworks/Java/gemini/src/main/java/hello/GhVersion.java

@@ -1,93 +0,0 @@
-package hello;
-
-import com.techempower.*;
-import com.techempower.gemini.*;
-import com.techempower.helper.*;
-
-/**
- * Provides a name, client, and version number for the current build of 
- * the GeminiHello application.
- *
- * @see com.techempower.Version
- *
- * Development history:
- *   2012-04-19 - mh - Created
- *
- * @author mhixson
- */
-public class GhVersion
-     extends Version
-{
-
-  //
-  // Member methods.
-  //
-
-  /**
-   * Constructor.  This builds the version string.
-   */
-  public GhVersion()
-  {
-    this.setVersionString(getMajorVersion() + "." 
-        + StringHelper.padZero(getMinorVersion(), 2)
-        + "(" + StringHelper.padZero(getMicroVersion(), 2) 
-        + ") (Gemini " + GeminiConstants.GEMINI_VERSION + ")");
-  }
-
-  /**
-   * Get the version levels.
-   */
-  @Override
-  public int getMajorVersion()  { return 0; }
-  @Override
-  public int getMinorVersion()  { return 1; }
-  @Override
-  public int getMicroVersion()  { return 0; }
-
-  /**
-   * Gets the product code.
-   */
-  @Override
-  public String getProductCode()
-  {
-    return "GH";
-  }
-
-  /**
-   * Gets the product name.
-   */
-  @Override
-  public String getProductName()
-  {
-    return "GeminiHello";
-  }
-
-  /**
-   * Gets the client's name.
-   */
-  @Override
-  public String getClientName()
-  {
-    return "TechEmpower, Inc.";
-  }
-
-  /**
-   * Gets the developer's name.
-   */
-  @Override
-  public String getDeveloperName()
-  {
-    return "TechEmpower, Inc.";
-  }
-
-  /**
-   * Gets the copyright years.
-   */
-  @Override
-  public String getCopyrightYears()
-  {
-    return "----";
-  }
-
-}   // End GhVersion.
-

+ 9 - 0
frameworks/Java/gemini/src/main/webapp/WEB-INF/web.xml

@@ -1,4 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <web-app>
 <web-app>
   <character-encoding>UTF-8</character-encoding>
   <character-encoding>UTF-8</character-encoding>
+
+  <servlet>
+    <servlet-name>GhServlet</servlet-name>
+    <servlet-class>hello.GhServlet</servlet-class>
+  </servlet>
+  <servlet-mapping>
+    <servlet-name>GhServlet</servlet-name>
+    <url-pattern>/*</url-pattern>
+  </servlet-mapping>
 </web-app>
 </web-app>