tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1528748 - /tomee/tomee/trunk/arquillian/arquillian-tomee-webapp-remote/src/main/java/org/apache/tomee/arquillian/webapp/TomEEWebappContainer.java
Date Thu, 03 Oct 2013 08:47:18 GMT
Author: rmannibucau
Date: Thu Oct  3 08:47:17 2013
New Revision: 1528748

URL: http://svn.apache.org/r1528748
Log:
adding some logs in tomee webapp adapter to see if the failling test on buildbot is due to
buildbot envrt or a bug

Modified:
    tomee/tomee/trunk/arquillian/arquillian-tomee-webapp-remote/src/main/java/org/apache/tomee/arquillian/webapp/TomEEWebappContainer.java

Modified: tomee/tomee/trunk/arquillian/arquillian-tomee-webapp-remote/src/main/java/org/apache/tomee/arquillian/webapp/TomEEWebappContainer.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/arquillian/arquillian-tomee-webapp-remote/src/main/java/org/apache/tomee/arquillian/webapp/TomEEWebappContainer.java?rev=1528748&r1=1528747&r2=1528748&view=diff
==============================================================================
--- tomee/tomee/trunk/arquillian/arquillian-tomee-webapp-remote/src/main/java/org/apache/tomee/arquillian/webapp/TomEEWebappContainer.java
(original)
+++ tomee/tomee/trunk/arquillian/arquillian-tomee-webapp-remote/src/main/java/org/apache/tomee/arquillian/webapp/TomEEWebappContainer.java
Thu Oct  3 08:47:17 2013
@@ -99,9 +99,9 @@ public class TomEEWebappContainer extend
                 System.setProperty("catalina.home", openejbHome.getAbsolutePath());
                 System.setProperty("catalina.base", openejbHome.getAbsolutePath());
 
-                System.setProperty("openejb.deploymentId.format", "{appId}/{ejbJarId}/{ejbName}");
+                System.setProperty("openejb.deploymentId.format", System.getProperty("openejb.deploymentId.format",
"{appId}/{ejbJarId}/{ejbName}"));
 
-                Paths paths = new Paths(webapp);
+                final Paths paths = new Paths(webapp);
                 installer = new Installer(paths, true);
                 if (!configuration.isUseInstallerServlet()) {
                     installer.installAll();
@@ -141,22 +141,32 @@ public class TomEEWebappContainer extend
             if (!wereOpenejbHomeSet && configuration.isUseInstallerServlet()) {
                 // instead of calling the Installer, let's just do like users do
                 // call the servlet installer instead
-                String baseUrl = "http://" + configuration.getHost() + ":" + configuration.getHttpPort()
+ "/tomee/installer";
+                final String baseUrl = "http://" + configuration.getHost() + ":" + configuration.getHttpPort()
+ "/tomee/installer";
 
                 assert installer != null;
                 installer.addTomEEAdminConfInTomcatUsers(true);
 
-                RemoteServer tmpContainer = new RemoteServer();
+                final RemoteServer tmpContainer = new RemoteServer();
                 tmpContainer.start();
 
-                URL url = new URL(baseUrl);
-                URLConnection uc = url.openConnection();
-                // dG9tZWU6dG9tZWU= --> Base64 of tomee:tomee
-                String authorizationString = "Basic dG9tZWU6dG9tZWU=";
-                uc.setRequestProperty ("Authorization", authorizationString);
-                InputStream is = uc.getInputStream();
-                org.apache.openejb.loader.IO.slurp(is);
-                is.close();
+                final URL url = new URL(baseUrl);
+                logger.info("Calling TomEE Installer Servlet on " + url);
+
+                for (int i = 0; i < 3; i++) {
+                    final URLConnection uc = url.openConnection();
+                    // dG9tZWU6dG9tZWU= --> Base64 of tomee:tomee
+                    final String authorizationString = "Basic dG9tZWU6dG9tZWU=";
+                    uc.setRequestProperty ("Authorization", authorizationString);
+                    try {
+                        final InputStream is = uc.getInputStream();
+                        org.apache.openejb.loader.IO.slurp(is);
+                        is.close();
+                        break;
+                    } catch (final Exception e) {
+                        logger.warning(e.getMessage());
+                        Thread.sleep(1000);
+                    }
+                }
 
                 tmpContainer.stop();
                 tmpContainer.getServer().waitFor();
@@ -164,6 +174,7 @@ public class TomEEWebappContainer extend
 
             container = new RemoteServer();
             container.start(Arrays.asList("-Dorg.apache.openejb.servlet.filters=" + ArquillianFilterRunner.class.getName()
+ "=" + ServletMethodExecutor.ARQUILLIAN_SERVLET_MAPPING), "start", true);
+            container.killOnExit();
         } catch (Exception e) {
             throw new LifecycleException("Unable to start remote container", e);
         }



Mime
View raw message