svn commit: r1549016 - in /ofbiz/branches/release13.07: ./ framework/base/src/org/ofbiz/base/container/ClassLoaderContainer.java framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1549016 - in /ofbiz/branches/release13.07: ./ framework/base/src/org/ofbiz/base/container/ClassLoaderContainer.java framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java

jleroux@apache.org
Author: jleroux
Date: Sun Dec  8 11:06:12 2013
New Revision: 1549016

URL: http://svn.apache.org/r1549016
Log:
"Applied fix from trunk for revision: 1549015  " conflict handled by hand: no WebSiteProperties class in R13.07, RequestHandler.getDefaultServerRootUrl() is not deprecated there.
------------------------------------------------------------------------
r1549015 | jleroux | 2013-12-08 11:48:18 +0100 (dim. 08 déc. 2013) | 7 lignes

In r1533839 (related to https://issues.apache.org/jira/browse/OFBIZ-4794 "Set different ports for testing in a CI environment (e.g. Jenkins)"
Which will mostly be used to simultaneously run official demos without having to create patches, I forgot the portOffset for websites and url.properties ports values.
This fixes this point. I also did in it RequestHandler class though the getDefaultServerRootUrl() method is now deprecated.
To be consistent with r1547186 I will backport in R13.07

People should be aware that this will change the ports values of websites and url.properties ports values which in some cases could be an unwanted side effect.
Anyway the portOffset feature is not destined to be used in production environments where websites and url.properties ports values are often changed purposely
------------------------------------------------------------------------

Modified:
    ofbiz/branches/release13.07/   (props changed)
    ofbiz/branches/release13.07/framework/base/src/org/ofbiz/base/container/ClassLoaderContainer.java
    ofbiz/branches/release13.07/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java

Propchange: ofbiz/branches/release13.07/
------------------------------------------------------------------------------
  Merged /ofbiz/trunk:r1549015

Modified: ofbiz/branches/release13.07/framework/base/src/org/ofbiz/base/container/ClassLoaderContainer.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release13.07/framework/base/src/org/ofbiz/base/container/ClassLoaderContainer.java?rev=1549016&r1=1549015&r2=1549016&view=diff
==============================================================================
--- ofbiz/branches/release13.07/framework/base/src/org/ofbiz/base/container/ClassLoaderContainer.java (original)
+++ ofbiz/branches/release13.07/framework/base/src/org/ofbiz/base/container/ClassLoaderContainer.java Sun Dec  8 11:06:12 2013
@@ -68,7 +68,7 @@ public class ClassLoaderContainer implem
                         try {
                             ClassLoaderContainer.portOffset = Integer.valueOf(argumentVal);
                         } catch (NumberFormatException e) {
-                            e.printStackTrace();
+                            Debug.logError(e, module);
                         }
                     }
                 }
@@ -82,6 +82,7 @@ public class ClassLoaderContainer implem
     /**
      * @see org.ofbiz.base.container.Container#start()
      */
+    @Override
     public boolean start() throws ContainerException {
         return true;
     }
@@ -89,9 +90,11 @@ public class ClassLoaderContainer implem
     /**
      * @see org.ofbiz.base.container.Container#stop()
      */
+    @Override
     public void stop() throws ContainerException {
     }
 
+    @Override
     public String getName() {
         return name;
     }

Modified: ofbiz/branches/release13.07/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release13.07/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java?rev=1549016&r1=1549015&r2=1549016&view=diff
==============================================================================
--- ofbiz/branches/release13.07/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java (original)
+++ ofbiz/branches/release13.07/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java Sun Dec  8 11:06:12 2013
@@ -36,6 +36,7 @@ import javax.servlet.http.HttpSession;
 
 import javolution.util.FastMap;
 
+import org.ofbiz.base.container.ClassLoaderContainer;
 import org.ofbiz.base.util.Debug;
 import org.ofbiz.base.util.SSLUtil;
 import org.ofbiz.base.util.StringUtil;
@@ -56,6 +57,7 @@ import org.ofbiz.webapp.stats.ServerHitB
 import org.ofbiz.webapp.view.ViewFactory;
 import org.ofbiz.webapp.view.ViewHandler;
 import org.ofbiz.webapp.view.ViewHandlerException;
+import org.ofbiz.webapp.website.WebSiteProperties;
 import org.ofbiz.webapp.website.WebSiteWorker;
 import org.owasp.esapi.errors.EncodingException;
 
@@ -945,6 +947,15 @@ public class RequestHandler {
         String httpServer = UtilProperties.getPropertyValue("url.properties", "force.http.host");
         boolean useHttps = UtilProperties.propertyValueEqualsIgnoreCase("url.properties", "port.https.enabled", "Y");
 
+        if (ClassLoaderContainer.portOffset != 0) {
+            Integer httpPortValue = Integer.valueOf(httpPort);
+            httpPortValue += ClassLoaderContainer.portOffset;
+            httpPort = httpPortValue.toString();
+            Integer httpsPortValue = Integer.valueOf(httpsPort);
+            httpsPortValue += ClassLoaderContainer.portOffset;
+            httpsPort = httpsPortValue.toString();
+        }                
+        
         StringBuilder newURL = new StringBuilder();
 
         if (secure && useHttps) {