Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions server/embedded/src/org/labkey/embedded/EmbeddedExtractor.java
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,9 @@ public void extractExecutableJar(File destDirectory, boolean remotePipeline)
{
try (JarFile jar = new JarFile(verifyJar()))
{
boolean foundDistributionZip = false;
boolean missingDistributionZip = true;
boolean missingBootstrapJar = remotePipeline;
boolean missingServletApiJar = remotePipeline;
var entries = jar.entries();
while (entries.hasMoreElements())
{
Expand All @@ -233,22 +235,24 @@ public void extractExecutableJar(File destDirectory, boolean remotePipeline)

if ("labkey/distribution.zip".equals(entryName))
{
foundDistributionZip = true;
missingDistributionZip = false;
try (var distInputStream = jar.getInputStream(entry))
{
extractDistributionZip(distInputStream, destDirectory);
}
}
if (remotePipeline)
{
// Keep this code in sync with org.labkey.pipeline.api.PipelineServiceImpl.extractBootstrapFromEmbedded()
if (entry.getName().contains("labkeyBootstrap") && entry.getName().toLowerCase().endsWith(".jar"))
{
try (var in = jar.getInputStream(entry))
{
extractFile(in, new File(destDirectory, "labkeyBootstrap.jar"));
}
missingBootstrapJar = false;
}
if (entry.getName().contains("tomcat-servlet-api") && entry.getName().toLowerCase().endsWith(".jar"))
if (entry.getName().contains("tomcat-embed-core") && entry.getName().toLowerCase().endsWith(".jar"))
{
File pipelineLib = new File(destDirectory, "pipeline-lib");
if (!pipelineLib.exists())
Expand All @@ -262,14 +266,23 @@ public void extractExecutableJar(File destDirectory, boolean remotePipeline)
{
extractFile(in, new File(pipelineLib, "servletApi.jar"));
}
missingServletApiJar = false;
}
}
}

if (!foundDistributionZip)
if (missingDistributionZip)
{
throw new ConfigException("Unable to find distribution zip required to run LabKey Server.");
}
if (missingBootstrapJar)
{
throw new ConfigException("Unable to find labkeyServer.jar required to run LabKey Server's remote pipeline code.");
}
if (missingServletApiJar)
{
throw new ConfigException("Unable to find Servlet API file required to run LabKey Server's remote pipeline code.");
}
}
}
catch (IOException | ConfigException e)
Expand Down