geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dwo...@apache.org
Subject svn commit: r649215 - in /geronimo/server/trunk: assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/ buildsupport/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/ framework/configs/offline-deployer/src/ma...
Date Thu, 17 Apr 2008 18:21:29 GMT
Author: dwoods
Date: Thu Apr 17 11:21:27 2008
New Revision: 649215

URL: http://svn.apache.org/viewvc?rev=649215&view=rev
Log:
GERONIMO-3900 Add runtime support for non-Sun JVMs.  Merged in updates from 2.1.1 branch.

Added:
    geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/properties/JvmVendor.java
  (with props)
Modified:
    geronimo/server/trunk/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/client.bat
    geronimo/server/trunk/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/client.sh
    geronimo/server/trunk/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/geronimo.bat
    geronimo/server/trunk/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/geronimo.sh
    geronimo/server/trunk/buildsupport/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/StartServerMojo.java
    geronimo/server/trunk/framework/configs/offline-deployer/src/main/plan/plan.xml
    geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/logging/log4j/Log4jService.java
    geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/properties/SystemProperties.java
    geronimo/server/trunk/plugins/client/client/src/main/plan/plan.xml
    geronimo/server/trunk/plugins/j2ee/j2ee-server/src/main/plan/plan.xml
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java

Modified: geronimo/server/trunk/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/client.bat
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/client.bat?rev=649215&r1=649214&r2=649215&view=diff
==============================================================================
--- geronimo/server/trunk/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/client.bat
(original)
+++ geronimo/server/trunk/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/client.bat
Thu Apr 17 11:21:27 2008
@@ -167,7 +167,7 @@
 set CMD_LINE_ARGS=%*
 set _JARFILE="%GERONIMO_HOME%"\bin\client.jar
 
-%_RUNJAVA% %JAVA_OPTS% %GERONIMO_OPTS% -Djava.endorsed.dirs="%GERONIMO_BASE%\lib\endorsed;%JRE_HOME%\lib\endorsed"
-Dorg.apache.geronimo.base.dir="%GERONIMO_BASE%" -Djava.io.tmpdir="%GERONIMO_TMPDIR%" -jar
%_JARFILE% %CMD_LINE_ARGS%
+%_RUNJAVA% %JAVA_OPTS% %GERONIMO_OPTS% -Djava.endorsed.dirs="%GERONIMO_BASE%\lib\endorsed;%JRE_HOME%\lib\endorsed"
-Djava.ext.dirs="%GERONIMO_BASE%\lib\ext;%JRE_HOME%\lib\ext" -Dorg.apache.geronimo.base.dir="%GERONIMO_BASE%"
-Djava.io.tmpdir="%GERONIMO_TMPDIR%" -jar %_JARFILE% %CMD_LINE_ARGS%
 goto end
 
 :end

Modified: geronimo/server/trunk/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/client.sh
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/client.sh?rev=649215&r1=649214&r2=649215&view=diff
==============================================================================
--- geronimo/server/trunk/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/client.sh
(original)
+++ geronimo/server/trunk/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/client.sh
Thu Apr 17 11:21:27 2008
@@ -177,8 +177,10 @@
   GERONIMO_HOME=`cygpath --absolute --windows "$GERONIMO_HOME"`
   GERONIMO_BASE=`cygpath --absolute --windows "$GERONIMO_BASE"`
   GERONIMO_TMPDIR=`cygpath --windows "$GERONIMO_TMPDIR"`
+  EXT_DIRS="$GERONIMO_BASE/lib/ext;$JRE_HOME/lib/ext"
   ENDORSED_DIRS="$GERONIMO_BASE/lib/endorsed;$JRE_HOME/lib/endorsed"
 else
+  EXT_DIRS="$GERONIMO_BASE/lib/ext:$JRE_HOME/lib/ext"
   ENDORSED_DIRS="$GERONIMO_BASE/lib/endorsed:$JRE_HOME/lib/endorsed"
 fi
 
@@ -198,5 +200,6 @@
 exec "$_RUNJAVA" $JAVA_OPTS $GERONIMO_OPTS \
   -Dorg.apache.geronimo.base.dir="$GERONIMO_BASE" \
   -Djava.endorsed.dirs="$ENDORSED_DIRS" \
+  -Djava.ext.dirs="$EXT_DIRS" \
   -Djava.io.tmpdir="$GERONIMO_TMPDIR" \
   -jar "$GERONIMO_HOME"/bin/client.jar "$@" 

Modified: geronimo/server/trunk/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/geronimo.bat
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/geronimo.bat?rev=649215&r1=649214&r2=649215&view=diff
==============================================================================
--- geronimo/server/trunk/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/geronimo.bat
(original)
+++ geronimo/server/trunk/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/geronimo.bat
Thu Apr 17 11:21:27 2008
@@ -317,11 +317,11 @@
 
 @REM Execute Java with the applicable properties
 if not "%JDB%" == "" goto doJDB
-%_EXECJAVA% %JAVA_OPTS% %GERONIMO_OPTS% %JAVA_AGENT_OPTS% -Djava.endorsed.dirs="%GERONIMO_BASE%\lib\endorsed;%JRE_HOME%\lib\endorsed"
-Dorg.apache.geronimo.base.dir="%GERONIMO_BASE%" -Djava.io.tmpdir="%GERONIMO_TMPDIR%" -jar
%_JARFILE% %_LONG_OPT% %CMD_LINE_ARGS%
+%_EXECJAVA% %JAVA_OPTS% %GERONIMO_OPTS% %JAVA_AGENT_OPTS% -Djava.endorsed.dirs="%GERONIMO_BASE%\lib\endorsed;%JRE_HOME%\lib\endorsed"
-Djava.ext.dirs="%GERONIMO_BASE%\lib\ext;%JRE_HOME%\lib\ext" -Dorg.apache.geronimo.base.dir="%GERONIMO_BASE%"
-Djava.io.tmpdir="%GERONIMO_TMPDIR%" -jar %_JARFILE% %_LONG_OPT% %CMD_LINE_ARGS%
 goto end
 
 :doJDB
-%_EXECJAVA% %JAVA_OPTS% %GERONIMO_OPTS% -sourcepath "%JDB_SRCPATH%" -Djava.endorsed.dirs="%GERONIMO_BASE%\lib\endorsed;%JRE_HOME%\lib\endorsed"
-Dorg.apache.geronimo.base.dir="%GERONIMO_BASE%" -Djava.io.tmpdir="%GERONIMO_TMPDIR%" -classpath
%_JARFILE% %MAINCLASS% %CMD_LINE_ARGS%
+%_EXECJAVA% %JAVA_OPTS% %GERONIMO_OPTS% -sourcepath "%JDB_SRCPATH%" -Djava.endorsed.dirs="%GERONIMO_BASE%\lib\endorsed;%JRE_HOME%\lib\endorsed"
-Djava.ext.dirs="%GERONIMO_BASE%\lib\ext;%JRE_HOME%\lib\ext" -Dorg.apache.geronimo.base.dir="%GERONIMO_BASE%"
-Djava.io.tmpdir="%GERONIMO_TMPDIR%" -classpath %_JARFILE% %MAINCLASS% %CMD_LINE_ARGS%
 goto end
 
 :end

Modified: geronimo/server/trunk/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/geronimo.sh
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/geronimo.sh?rev=649215&r1=649214&r2=649215&view=diff
==============================================================================
--- geronimo/server/trunk/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/geronimo.sh
(original)
+++ geronimo/server/trunk/assemblies/geronimo-boilerplate-minimal/src/main/underlay/bin/geronimo.sh
Thu Apr 17 11:21:27 2008
@@ -235,8 +235,10 @@
   GERONIMO_HOME=`cygpath --absolute --windows "$GERONIMO_HOME"`
   GERONIMO_BASE=`cygpath --absolute --windows "$GERONIMO_BASE"`
   GERONIMO_TMPDIR=`cygpath --windows "$GERONIMO_TMPDIR"`
+  EXT_DIRS="$GERONIMO_BASE/lib/ext;$JRE_HOME/lib/ext"
   ENDORSED_DIRS="$GERONIMO_BASE/lib/endorsed;$JRE_HOME/lib/endorsed"
 else
+  EXT_DIRS="$GERONIMO_BASE/lib/ext:$JRE_HOME/lib/ext"
   ENDORSED_DIRS="$GERONIMO_BASE/lib/endorsed:$JRE_HOME/lib/endorsed"
 fi
 
@@ -302,6 +304,7 @@
     exec "$_RUNJDB" $JAVA_OPTS $GERONIMO_OPTS \
       -sourcepath "$JDB_SRCPATH" \
       -Djava.endorsed.dirs="$ENDORSED_DIRS" \
+      -Djava.ext.dirs="$EXT_DIRS" \
       -Dorg.apache.geronimo.base.dir="$GERONIMO_BASE" \
       -Djava.io.tmpdir="$GERONIMO_TMPDIR" \
       -classpath "$GERONIMO_HOME"/bin/server.jar \
@@ -314,6 +317,7 @@
     $JAVA_AGENT_OPTS \
     -Dorg.apache.geronimo.base.dir="$GERONIMO_BASE" \
     -Djava.endorsed.dirs="$ENDORSED_DIRS" \
+    -Djava.ext.dirs="$EXT_DIRS" \
     -Djava.io.tmpdir="$GERONIMO_TMPDIR" \
     -jar "$GERONIMO_HOME"/bin/server.jar $LONG_OPT "$@"
 
@@ -324,6 +328,7 @@
     $JAVA_AGENT_OPTS \
     -Dorg.apache.geronimo.base.dir="$GERONIMO_BASE" \
     -Djava.endorsed.dirs="$ENDORSED_DIRS" \
+    -Djava.ext.dirs="$EXT_DIRS" \
     -Djava.io.tmpdir="$GERONIMO_TMPDIR" \
     -jar "$GERONIMO_HOME"/bin/server.jar $LONG_OPT "$@" \
     >> $GERONIMO_OUT 2>&1 &
@@ -346,6 +351,7 @@
   "$_RUNJAVA" $JAVA_OPTS $GERONIMO_OPTS \
     -Dorg.apache.geronimo.base.dir="$GERONIMO_BASE" \
     -Djava.endorsed.dirs="$ENDORSED_DIRS" \
+    -Djava.ext.dirs="$EXT_DIRS" \
     -Djava.io.tmpdir="$GERONIMO_TMPDIR" \
     -jar "$GERONIMO_HOME"/bin/shutdown.jar "$@"
 

Modified: geronimo/server/trunk/buildsupport/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/StartServerMojo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/buildsupport/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/StartServerMojo.java?rev=649215&r1=649214&r2=649215&view=diff
==============================================================================
--- geronimo/server/trunk/buildsupport/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/StartServerMojo.java
(original)
+++ geronimo/server/trunk/buildsupport/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/StartServerMojo.java
Thu Apr 17 11:21:27 2008
@@ -204,7 +204,9 @@
                     // Skip this property, never propagate it
                 }
                 else if (name.startsWith("org.apache.geronimo") || name.startsWith("geronimo"))
{
-                    log.debug("Propagating: " + name + "=" + value);
+                    if (log.isDebugEnabled()) {
+                        log.debug("Propagating: " + name + "=" + value);
+                    }
                     setSystemProperty(java, name, value);
                 }
             }
@@ -334,7 +336,9 @@
         };
 
         if (verifyTimeout > 0) {
-            log.debug("Starting verify timeout task; triggers in: " + verifyTimeout + " seconds");
+            if (log.isDebugEnabled()) {
+                log.debug("Starting verify timeout task; triggers in: " + verifyTimeout +
" seconds");
+            }
             timer.schedule(timeoutTask, verifyTimeout * 1000);
         }
 
@@ -354,7 +358,7 @@
 
             if (!started) {
                 Throwable error = server.getLastError();
-                if (error != null) {
+                if ((error != null) && (log.isDebugEnabled())) {
                     log.debug("Server query failed; ignoring", error);
                 }
 
@@ -423,7 +427,9 @@
 
             if (set == null) {
                 if ("default".equals(id)) {
-                    log.debug("Default optionSet selected, but no optionSet defined with
that id; ignoring");
+                    if (log.isDebugEnabled()) {
+                        log.debug("Default optionSet selected, but no optionSet defined with
that id; ignoring");
+                    }
                 }
                 else {
                     log.warn("Missing optionSet for id: " + id);

Modified: geronimo/server/trunk/framework/configs/offline-deployer/src/main/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/configs/offline-deployer/src/main/plan/plan.xml?rev=649215&r1=649214&r2=649215&view=diff
==============================================================================
--- geronimo/server/trunk/framework/configs/offline-deployer/src/main/plan/plan.xml (original)
+++ geronimo/server/trunk/framework/configs/offline-deployer/src/main/plan/plan.xml Thu Apr
17 11:21:27 2008
@@ -33,5 +33,14 @@
         <attribute name="systemProperties">
              org.apache.geronimo.deployment.util.DeploymentUtil.jarUrlRewrite=true
         </attribute>
+         <attribute name="sunSystemProperties">
+             java.security.Provider=SUN
+         </attribute>
+         <attribute name="ibmSystemProperties">
+             java.security.Provider=IBMCertPath
+         </attribute>
+         <attribute name="apacheSystemProperties">
+             java.naming.factory.url.pkgs=org.apache.harmony.jndi.provider
+         </attribute>
     </gbean>
 </module>

Modified: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/logging/log4j/Log4jService.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/logging/log4j/Log4jService.java?rev=649215&r1=649214&r2=649215&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/logging/log4j/Log4jService.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/logging/log4j/Log4jService.java
Thu Apr 17 11:21:27 2008
@@ -51,6 +51,7 @@
 import org.apache.geronimo.kernel.log.GeronimoLogFactory;
 import org.apache.geronimo.kernel.log.GeronimoLogging;
 import org.apache.geronimo.system.logging.SystemLog;
+import org.apache.geronimo.system.properties.JvmVendor;
 import org.apache.geronimo.system.serverinfo.DirectoryUtils;
 import org.apache.geronimo.system.serverinfo.ServerConstants;
 import org.apache.geronimo.system.serverinfo.ServerInfo;
@@ -261,7 +262,10 @@
      * @param configurationFile the logging configuration file
      */
     public synchronized void setConfigFileName(final String configurationFile) {
-        log.debug("setConfigFileName() called with configurationFile=" + configurationFile);
+        if (log.isDebugEnabled()) {
+            log.debug("setConfigFileName() called with configurationFile=" + configurationFile);
+        }
+
         if (configurationFile == null) {
             throw new IllegalArgumentException("configurationFile is null");
         }
@@ -521,7 +525,9 @@
         if (file == null || !file.exists()) {
             return;
         } else {
-            log.debug("reconfigure() using configurationFile=" + configurationFile);
+            if (log.isDebugEnabled()) {
+                log.debug("reconfigure() using configurationFile=" + configurationFile);
+            }
             lastChanged = file.lastModified();
         }
 
@@ -628,11 +634,12 @@
           Log log = LogFactory.getLog(Log4jService.class);
           log.info("----------------------------------------------");
           log.info("Started Logging Service");
-          log.debug("Log4jService created with configFileName=" + this.configurationFile
+
-                    ", refreshPeriodSeconds=" + this.refreshPeriod);
+          if (log.isDebugEnabled()) {
+              log.debug("Log4jService created with configFileName=" + this.configurationFile
+ ", refreshPeriodSeconds=" + this.refreshPeriod);
+          }
           log.info("Runtime Information:");
           log.info("  Install Directory = " + DirectoryUtils.getGeronimoInstallDirectory().toString());
-          log.info("  JVM in use = " + System.getProperty("java.vendor") + " Java " + System.getProperty("java.version"));
+          log.info("  JVM in use = " + JvmVendor.getJvmInfo());
           log.info("Java Information:");
           log.info("  System property [java.runtime.name]  = " + System.getProperty("java.runtime.name"));
           log.info("  System property [java.runtime.version]  = " + System.getProperty("java.runtime.version"));

Added: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/properties/JvmVendor.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/properties/JvmVendor.java?rev=649215&view=auto
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/properties/JvmVendor.java
(added)
+++ geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/properties/JvmVendor.java
Thu Apr 17 11:21:27 2008
@@ -0,0 +1,145 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed 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.geronimo.system.properties;
+
+import java.security.Provider;
+import java.security.Security;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * @version $Rev: 5066 $ $Date: 2007-04-27 12:07:23 -0400 (Fri, 27 Apr 2007) $
+ */
+public class JvmVendor {
+
+    private static final Log log = LogFactory.getLog(JvmVendor.class);
+
+    private static final String JVM_VENDOR_PROPERTY_NAME = "java.vm.vendor";
+
+    private static final boolean sun;
+
+    private static final boolean ibm;
+
+    private static final boolean apache;
+    
+    private static final boolean ibmHybrid;
+
+    private JvmVendor () {
+    }
+
+    static {
+        String fullVendorName = getFullName();
+        boolean bApache = fullVendorName.substring(0, 6).equalsIgnoreCase("Apache");    //
aka. Apache Harmony
+        boolean bIBM = fullVendorName.substring(0, 3).equalsIgnoreCase("IBM");          
// aka. IBM, but not IBM Hybrid
+        boolean bSun = !bIBM && !bApache;                                       
       // default all others to Sun
+        boolean bHP = fullVendorName.substring(0, 7).equalsIgnoreCase("Hewlett");       //
aka. Hewlett-Packard Company
+        boolean bIBMHybrid = false;
+        
+        // Special code for IBM Hybrid SDK (Sun JVM with IBM extensions on Solaris and HP-UX)
+        if ( ((bSun == true) && (System.getProperty("os.name").equalsIgnoreCase("SunOS")
== true)) ||
+             ((bHP == true) && (System.getProperty("os.name").equalsIgnoreCase("HP-UX")
== true)) )
+        {
+            log.debug("Looking for the IBM Hybrid SDK Extensions");
+            // Check if provider IBMJSSE Provider is installed.
+            try {
+                if (Security.getProvider("com.ibm.jsse2.IBMJSSEProvider2") == null) {
+                    // IBMJSSE Provider is not installed, install it
+                    log.debug("Trying to load IBM JSSE2 Provider.");
+                    Class c = Class.forName("com.ibm.jsse2.IBMJSSEProvider2");
+                    Provider p = (Provider) c.newInstance();
+                    Security.addProvider(p);
+                    // Security.addProvider(new com.ibm.jsse2.IBMJSSEProvider2());
+                    log.debug("Loaded the IBM JSSE2 Provider");
+                } else {
+                    log.debug("Found the IBM JSSE2 Provider = " + Security.getProvider("com.ibm.jsse2.IBMJSSEProvider2"));
+                }
+                if (Security.getProvider("IBMCertPath") == null) {
+                    // If we found IBMJSSE but not this one, then the JAVA_OPTS are probably
messed up
+                    log.debug("No IBMCertPath provider found.");
+                    throw new RuntimeException("Could not find the IBMCertPath provider.");
+                } else {
+                    log.debug("Found the IBMCertPath Provider = " + Security.getProvider("IBMCertPath"));
+                }
+                if (Security.getProvider("IBMJCE") == null) {
+                    // If we found IBMJSSE but not this one, then the JAVA_OPTS are probably
messed up
+                    log.debug("No IBMJCE provider found.");
+                    throw new RuntimeException("Could not find the IBMJCE provider.");
+                } else {
+                    log.debug("Found the IBMJCE Provider" + Security.getProvider("IBMJCE"));
+                }
+                System.setProperty("java.protocol.handler.pkgs", "com.ibm.net.ssl.www2.protocol");
+                // All of the expected IBM Extensions were found, so we must be using the
IBM Hybrid JDK
+                bSun = false;
+                bApache = false;
+                bIBM = true;
+                bIBMHybrid = true;
+            } catch (ClassNotFoundException e) {
+                // Couldn't load the IBMJSSE Provider, so we must not be using the IBM Hybrid
SDK
+                log.debug("Caught Exception="+e.toString());
+                log.debug("Could not load the IBM JSSE Provider.  Must be using the OS provider's
Java.");
+            } catch (Throwable t) {
+                // Couldn't load the IBMJSSE Provider, so we must not be using the IBM Hybrid
SDK
+                log.debug("Caught Throwable="+t.toString());
+                log.debug("Assume we could not load the IBM JSSE Provider and that we are
using the OS provider's Java.");
+            }
+        }
+        // now, set our statics
+        apache = bApache;
+        ibm = bIBM;
+        ibmHybrid = bIBMHybrid;
+        sun = bSun;
+        // log what we found
+        log.info(getJvmInfo());
+    }
+
+    public static String getFullName() {
+        return System.getProperty(JVM_VENDOR_PROPERTY_NAME);
+    }
+
+    public static boolean isSun() {
+        return sun;
+    }
+
+    public static boolean isIBM() {
+        return ibm;
+    }
+
+    public static boolean isIBMHybrid() {
+        return ibmHybrid;
+    }
+
+    public static boolean isApache() {
+        return apache;
+    }
+
+    public static String getJvmInfo() {
+        if (sun == true) {
+            return new String("Sun JVM " + System.getProperty("java.version"));
+        } else if (apache == true) {
+            return new String("Apache Harmony JVM " + System.getProperty("java.version"));
+        } else if (ibm == true) {
+            return new String("IBM JVM " + System.getProperty("java.version"));
+        } else if (ibmHybrid == true) {
+            return new String("IBM Hybrid JVM " + System.getProperty("java.version") + "
on " + System.getProperty("os.name"));
+        } else {
+            // should never happen
+            return new String("Unknown JVM detected - " + getFullName());
+        }
+    }
+
+}

Propchange: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/properties/JvmVendor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/properties/SystemProperties.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/properties/SystemProperties.java?rev=649215&r1=649214&r2=649215&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/properties/SystemProperties.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/properties/SystemProperties.java
Thu Apr 17 11:21:27 2008
@@ -20,6 +20,8 @@
 import java.util.Properties;
 import java.util.Map;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.system.serverinfo.ServerInfo;
@@ -29,26 +31,48 @@
  */
 public class SystemProperties {
 
+    private final Log log = LogFactory.getLog(SystemProperties.class);
 
-    public SystemProperties(Properties properties, Properties pathProperties, ServerInfo
serverInfo) {
+    public SystemProperties(Properties systemProperties, Properties systemPathProperties,
ServerInfo serverInfo, Properties sunSystemProperties, Properties ibmSystemProperties, Properties
apacheSystemProperties) {
+        if (log.isDebugEnabled()) log.debug("Setting systemProperties");
+        setProperties(systemProperties, null);
+
+        if (JvmVendor.isIBM()) {
+            if (log.isDebugEnabled()) log.debug("Setting ibmSystemProperties for the IBM
JVM");
+            setProperties(ibmSystemProperties, null);
+        } else if (JvmVendor.isApache()) {
+            if (log.isDebugEnabled()) log.debug("Setting apacheSystemProperties for the Apache
Harmony JVM");
+            setProperties(apacheSystemProperties, null);
+        } else {
+            if (log.isDebugEnabled()) log.debug("Setting sunSystemProperties for the Sun
JVM");
+            setProperties(sunSystemProperties, null);
+        }
+
+        if (serverInfo != null) {
+            if (log.isDebugEnabled()) log.debug("Setting systemPathProperties");
+            setProperties(systemPathProperties, serverInfo);
+        }
+    }
+
+    private void setProperties(Properties properties, ServerInfo serverInfo) {
         if (properties != null) {
             for (Iterator iterator = properties.entrySet().iterator(); iterator.hasNext();)
{
                 Map.Entry entry = (Map.Entry) iterator.next();
                 String propertyName = (String) entry.getKey();
                 String propertyValue = (String) entry.getValue();
-                if (System.getProperty(propertyName) == null) {
-                    System.setProperty(propertyName, propertyValue);
+                if (serverInfo != null) {
+                    propertyValue = serverInfo.resolvePath(propertyValue);
                 }
-            }
-        }
-        if (pathProperties != null && serverInfo != null) {
-            for (Iterator iterator = pathProperties.entrySet().iterator(); iterator.hasNext();)
{
-                Map.Entry entry = (Map.Entry) iterator.next();
-                String propertyName = (String) entry.getKey();
-                String propertyValue = (String) entry.getValue();
-                propertyValue = serverInfo.resolveServerPath(propertyValue);
-                if (System.getProperty(propertyName) == null) {
+                String currentPropertyValue = System.getProperty(propertyName);
+                if (currentPropertyValue == null) {
                     System.setProperty(propertyName, propertyValue);
+                    log.info("Setting Property=" + propertyName + " to Value=" + propertyValue);
+                } else {
+                    if (currentPropertyValue.equals(propertyValue)) {
+                        log.warn("Existing Property=" + propertyName + " is already set to
Value=" + currentPropertyValue);
+                    } else {
+                        log.error("Not updating existing Property=" + propertyName + " to
Value=" + propertyValue + ".  Property is already set to " + currentPropertyValue);
+                    }
                 }
             }
         }
@@ -61,7 +85,10 @@
         infoBuilder.addAttribute("systemProperties", Properties.class, true, true);
         infoBuilder.addAttribute("systemPathProperties", Properties.class, true, true);
         infoBuilder.addReference("ServerInfo", ServerInfo.class, "GBean");
-        infoBuilder.setConstructor(new String[] {"systemProperties", "systemPathProperties",
"ServerInfo"});
+        infoBuilder.addAttribute("sunSystemProperties", Properties.class, true, true);
+        infoBuilder.addAttribute("ibmSystemProperties", Properties.class, true, true);
+        infoBuilder.addAttribute("apacheSystemProperties", Properties.class, true, true);
+        infoBuilder.setConstructor(new String[] { "systemProperties", "systemPathProperties",
"ServerInfo", "sunSystemProperties", "ibmSystemProperties", "apacheSystemProperties" });
 
         GBEAN_INFO = infoBuilder.getBeanInfo();
     }

Modified: geronimo/server/trunk/plugins/client/client/src/main/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/client/client/src/main/plan/plan.xml?rev=649215&r1=649214&r2=649215&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/client/client/src/main/plan/plan.xml (original)
+++ geronimo/server/trunk/plugins/client/client/src/main/plan/plan.xml Thu Apr 17 11:21:27
2008
@@ -103,8 +103,17 @@
            javax.xml.soap.SOAPFactory=org.apache.geronimo.webservices.saaj.GeronimoSOAPFactory
            javax.xml.soap.SOAPConnectionFactory=org.apache.geronimo.webservices.saaj.GeronimoSOAPConnectionFactory
            javax.xml.soap.MetaFactory=org.apache.geronimo.webservices.saaj.GeronimoMetaFactory
-
            org.apache.cxf.jaxws.checkPublishEndpointPermission=true
+           java.net.preferIPv4Stack=true
+         </attribute>
+         <attribute name="sunSystemProperties">
+             java.security.Provider=SUN
+         </attribute>
+         <attribute name="ibmSystemProperties">
+             java.security.Provider=IBMCertPath
+         </attribute>
+         <attribute name="apacheSystemProperties">
+             java.naming.factory.url.pkgs=org.apache.harmony.jndi.provider
          </attribute>
     </gbean>
 

Modified: geronimo/server/trunk/plugins/j2ee/j2ee-server/src/main/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/j2ee-server/src/main/plan/plan.xml?rev=649215&r1=649214&r2=649215&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/j2ee-server/src/main/plan/plan.xml (original)
+++ geronimo/server/trunk/plugins/j2ee/j2ee-server/src/main/plan/plan.xml Thu Apr 17 11:21:27
2008
@@ -90,6 +90,15 @@
            org.apache.cxf.jaxws.checkPublishEndpointPermission=true
            java.net.preferIPv4Stack=true
          </attribute>
+         <attribute name="sunSystemProperties">
+             java.security.Provider=SUN
+         </attribute>
+         <attribute name="ibmSystemProperties">
+             java.security.Provider=IBMCertPath
+         </attribute>
+         <attribute name="apacheSystemProperties">
+             java.naming.factory.url.pkgs=org.apache.harmony.jndi.provider
+         </attribute>
     </gbean>
 
 </module>

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java?rev=649215&r1=649214&r2=649215&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java
(original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java
Thu Apr 17 11:21:27 2008
@@ -185,9 +185,11 @@
      * See org.apache.catalina.startup.Embedded for details (TODO: provide the link to the
javadoc)
      */
     public void doStart() throws Exception {
-        log.debug("doStart()");
-
-        log.debug("Endorsed Dirs set to:" + System.getProperty("java.endorsed.dirs"));
+        if (log.isDebugEnabled()) {
+            log.debug("doStart()");
+            log.debug("Java Endorsed Dirs set to:" + System.getProperty("java.endorsed.dirs"));
+            log.debug("Java Ext Dirs set to:" + System.getProperty("java.ext.dirs"));
+        }
 
         // The comments are from the javadoc of the Embedded class
 
@@ -330,10 +332,12 @@
                         realm = new TomcatJAASRealm();
                     }
 
-                    log.debug("The security-realm-name '" + securityRealmName +
+                    if (log.isDebugEnabled()) {
+                        log.debug("The security-realm-name '" + securityRealmName +
                             "' was specified and a parent (Engine/Host) is not named the
same or no RealmGBean was configured for this context. " +
                             "Creating a default " + realm.getClass().getName() +
                             " adapter for this context.");
+                    }
 
                     ((JAASRealm) realm).setUserClassNames("org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal");
                     ((JAASRealm) realm).setRoleClassNames("org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal");



Mime
View raw message