diff options
author | 2021-06-27 14:38:28 +0200 | |
---|---|---|
committer | 2021-06-27 14:38:28 +0200 | |
commit | f767b778ee5bae6346adacf990c3a5c58c2ff31b (patch) | |
tree | 9b9930525fcc36d2a45b1b24852f9c138d5619ec /language-web/src/main/java/org/eclipse/viatra/solver | |
parent | Remove Eclipse-specific files (diff) | |
download | refinery-f767b778ee5bae6346adacf990c3a5c58c2ff31b.tar.gz refinery-f767b778ee5bae6346adacf990c3a5c58c2ff31b.tar.zst refinery-f767b778ee5bae6346adacf990c3a5c58c2ff31b.zip |
Fix running outside of Eclipse
Diffstat (limited to 'language-web/src/main/java/org/eclipse/viatra/solver')
-rw-r--r-- | language-web/src/main/java/org/eclipse/viatra/solver/language/web/ServerLauncher.java | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/language-web/src/main/java/org/eclipse/viatra/solver/language/web/ServerLauncher.java b/language-web/src/main/java/org/eclipse/viatra/solver/language/web/ServerLauncher.java index d25f4ae9..d0b2562a 100644 --- a/language-web/src/main/java/org/eclipse/viatra/solver/language/web/ServerLauncher.java +++ b/language-web/src/main/java/org/eclipse/viatra/solver/language/web/ServerLauncher.java | |||
@@ -14,24 +14,19 @@ import org.eclipse.jetty.webapp.WebInfConfiguration; | |||
14 | import org.eclipse.jetty.webapp.WebXmlConfiguration; | 14 | import org.eclipse.jetty.webapp.WebXmlConfiguration; |
15 | 15 | ||
16 | /** | 16 | /** |
17 | * This program starts an HTTP server for testing the web integration of your DSL. | 17 | * This program starts an HTTP server for testing the web integration of your |
18 | * Just execute it and point a web browser to http://localhost:8080/ | 18 | * DSL. Just execute it and point a web browser to http://localhost:8080/ |
19 | */ | 19 | */ |
20 | public class ServerLauncher { | 20 | public class ServerLauncher { |
21 | public static void main(String[] args) { | 21 | public static void main(String[] args) { |
22 | Server server = new Server(new InetSocketAddress("localhost", 1313)); | 22 | Server server = new Server(new InetSocketAddress("localhost", 1313)); |
23 | WebAppContext ctx = new WebAppContext(); | 23 | WebAppContext ctx = new WebAppContext(); |
24 | ctx.setResourceBase("src/main/webapp"); | 24 | ctx.setResourceBase("src/main/webapp"); |
25 | ctx.setWelcomeFiles(new String[] {"index.html"}); | 25 | ctx.setWelcomeFiles(new String[] { "index.html" }); |
26 | ctx.setContextPath("/"); | 26 | ctx.setContextPath("/"); |
27 | ctx.setConfigurations(new Configuration[] { | 27 | ctx.setConfigurations(new Configuration[] { new AnnotationConfiguration(), new WebXmlConfiguration(), |
28 | new AnnotationConfiguration(), | 28 | new WebInfConfiguration(), new MetaInfConfiguration() }); |
29 | new WebXmlConfiguration(), | 29 | ctx.setAttribute(WebInfConfiguration.CONTAINER_JAR_PATTERN, ".*/language-web/.*,.*\\.jar"); |
30 | new WebInfConfiguration(), | ||
31 | new MetaInfConfiguration() | ||
32 | }); | ||
33 | ctx.setAttribute(WebInfConfiguration.CONTAINER_JAR_PATTERN, | ||
34 | ".*/org\\.eclipse\\.viatra\\.solver\\.language\\.web/.*,.*\\.jar"); | ||
35 | ctx.setInitParameter("org.eclipse.jetty.servlet.Default.useFileMappedBuffer", "false"); | 30 | ctx.setInitParameter("org.eclipse.jetty.servlet.Default.useFileMappedBuffer", "false"); |
36 | server.setHandler(ctx); | 31 | server.setHandler(ctx); |
37 | Slf4jLog log = new Slf4jLog(ServerLauncher.class.getName()); | 32 | Slf4jLog log = new Slf4jLog(ServerLauncher.class.getName()); |
@@ -39,7 +34,6 @@ public class ServerLauncher { | |||
39 | server.start(); | 34 | server.start(); |
40 | log.info("Server started " + server.getURI() + "..."); | 35 | log.info("Server started " + server.getURI() + "..."); |
41 | new Thread() { | 36 | new Thread() { |
42 | |||
43 | public void run() { | 37 | public void run() { |
44 | try { | 38 | try { |
45 | log.info("Press enter to stop the server..."); | 39 | log.info("Press enter to stop the server..."); |
@@ -54,7 +48,6 @@ public class ServerLauncher { | |||
54 | log.warn(e); | 48 | log.warn(e); |
55 | } | 49 | } |
56 | } | 50 | } |
57 | |||
58 | }.start(); | 51 | }.start(); |
59 | server.join(); | 52 | server.join(); |
60 | } catch (Exception exception) { | 53 | } catch (Exception exception) { |