From: <tho...@us...> - 2014-03-11 20:16:43
|
Revision: 7930 http://sourceforge.net/p/bigdata/code/7930 Author: thompsonbry Date: 2014-03-11 20:16:38 +0000 (Tue, 11 Mar 2014) Log Message: ----------- Probably fix for the HA CI builds in the RDR branch. There were two problems. 1. paths to files inside of the serviceDir need to be different in the parent context and the child context. Here I punted and just copied the webapp to the serviceDir. This gives the right behavior by default. 2. The NanoSparqlServer was using file://jetty.xml but should have been using file:jetty.xml for a relative URL to a file in the local file system. See #730 (jetty configuration). Modified Paths: -------------- branches/RDR/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournalServer.java branches/RDR/bigdata-jini/src/test/com/bigdata/journal/jini/ha/AbstractHA3JournalServerTestCase.java branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/NanoSparqlServer.java Modified: branches/RDR/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournalServer.java =================================================================== --- branches/RDR/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournalServer.java 2014-03-11 20:10:35 UTC (rev 7929) +++ branches/RDR/bigdata-jini/src/java/com/bigdata/journal/jini/ha/HAJournalServer.java 2014-03-11 20:16:38 UTC (rev 7930) @@ -4569,6 +4569,12 @@ ConfigurationOptions.JETTY_XML, String.class, ConfigurationOptions.DEFAULT_JETTY_XML); + // Note: if we do this, push the serviceDir down into newInstance(). +// if (!jettyXml.startsWith("/")) { +// // Assume that the path is relative to the serviceDir. +// jettyXml = getServiceDir() + File.separator + jettyXml; +// } + // Setup the embedded jetty server for NSS webapp. jettyServer = NanoSparqlServer.newInstance(jettyXml, journal); Modified: branches/RDR/bigdata-jini/src/test/com/bigdata/journal/jini/ha/AbstractHA3JournalServerTestCase.java =================================================================== --- branches/RDR/bigdata-jini/src/test/com/bigdata/journal/jini/ha/AbstractHA3JournalServerTestCase.java 2014-03-11 20:10:35 UTC (rev 7929) +++ branches/RDR/bigdata-jini/src/test/com/bigdata/journal/jini/ha/AbstractHA3JournalServerTestCase.java 2014-03-11 20:16:38 UTC (rev 7930) @@ -1768,16 +1768,20 @@ * well. This is a bit brute force, but maybe it is more useful for * that. * - * TODO This might break in CI if the bigdata-war directory is not - * staged to the testing area. + * TODO The webapp is being deployed to the serviceDir in order + * to avoid complexities with the parent and child process paths + * to the serviceDir and the webappDir. */ - final File webAppDir = new File(serviceDir, "bigdata-war/src"); - if (!webAppDir.exists() && !webAppDir.mkdirs()) { - throw new IOException("Could not create directory: " - + webAppDir); + { + final File webAppDir = serviceDir; + // webAppDir = new File(serviceDir, "bigdata-war/src"); + if (!webAppDir.exists() && !webAppDir.mkdirs()) { + throw new IOException("Could not create directory: " + + webAppDir); + } + copyFiles(new File("bigdata-war/src"), webAppDir); } - copyFiles(new File("bigdata-war/src"), webAppDir); - + // log4j configuration. copyFile(new File( "bigdata/src/resources/logging/log4j-dev.properties"), @@ -1810,8 +1814,14 @@ // Add override for the serviceDir. final String[] overrides = ConfigMath.concat( - new String[] { - "bigdata.serviceDir=new java.io.File(\"" + serviceDir + "\")", + new String[] { // + // The service directory. + "bigdata.serviceDir=new java.io.File(\"" + serviceDir + "\")", +// // Where to find jetty.xml +// HAJournalServer.ConfigurationOptions.COMPONENT + "." +// + HAJournalServer.ConfigurationOptions.JETTY_XML +// + "=\"bigdata-war/src/jetty.xml\"", +// + "=\"" + serviceDir + "/bigdata-war/src/jetty.xml\"", }, testOverrides); Modified: branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/NanoSparqlServer.java =================================================================== --- branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/NanoSparqlServer.java 2014-03-11 20:10:35 UTC (rev 7929) +++ branches/RDR/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/NanoSparqlServer.java 2014-03-11 20:16:38 UTC (rev 7930) @@ -484,7 +484,8 @@ if (new File(jettyXml).exists()) { // Check the file system. - jettyXmlUrl = new URL("file://" + jettyXml); +// jettyXmlUrl = new File(jettyXml).toURI(); + jettyXmlUrl = new URL("file:" + jettyXml); } else { @@ -552,6 +553,13 @@ // Set the IIndexManager attribute on the WebAppContext. wac.setAttribute(IIndexManager.class.getName(), indexManager); + /* + * FIXME We could use setInitParameter() here to override the init + * parameters in web.xml based on those given on the command line to + * main(). If we do this, we should be able to get rid of the + * non-web.xml based versions of newInstance(). + */ + } return server; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |