User Tools

Site Tools


java_jetty_server_on_metaarray

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Last revisionBoth sides next revision
java_jetty_server_on_metaarray [2022/01/21 00:51] – [Setting up a simple Java Jetty Server] added another link to Jetty peteyboyjava_jetty_server_on_metaarray [2022/01/21 00:58] – clean up peteyboy
Line 1: Line 1:
-FIXME  this is under construction 
- 
  
 ====== Setting up a simple Java Jetty Server  ====== ====== Setting up a simple Java Jetty Server  ======
Line 13: Line 11:
 ===== Create Project Space ===== ===== Create Project Space =====
  
-First, we'll create your maven-style project folder.+First, let'create your maven-style project folder.
   - Go to an appropriate project folder that you want to work in   - Go to an appropriate project folder that you want to work in
   - make the java source folder in the maven style   - make the java source folder in the maven style
Line 21: Line 19:
 ===== Create Project Object Model ===== ===== Create Project Object Model =====
  
-Next, we'll set up the POM file, which maven will use to pull all the dependencies for our framework and let us build it.+Next, let'set up the POM file, which maven will use to pull all the dependencies for our framework and let us build it.
  
   - Create a new file in "myproject", call it ''pom.xml''   - Create a new file in "myproject", call it ''pom.xml''
Line 79: Line 77:
       </plugin>       </plugin>
       <plugin>       <plugin>
 +        <!-- Exec plugin lets us run app directly from maven and not deal with classpaths -->
        <groupId>org.codehaus.mojo</groupId>        <groupId>org.codehaus.mojo</groupId>
          <artifactId>exec-maven-plugin</artifactId>          <artifactId>exec-maven-plugin</artifactId>
Line 90: Line 89:
          </executions>          </executions>
          <configuration>          <configuration>
 +           <!-- This is what exec will run as project main, *CHANGE THIS IF YOU ARE USING A DIFFERENT MAIN CLASS-->
            <mainClass>myproject.helloWorld</mainClass>            <mainClass>myproject.helloWorld</mainClass>
          </configuration>          </configuration>
Line 138: Line 138:
 ===== Run Your Server ===== ===== Run Your Server =====
  
-Now, let's run the server. We've set up an "exec goal" in the pom so we can run the resulting project from maven, like so:+Now, let's run the server. We've set up an "exec goal" in the POM so we can run the resulting project from maven, like so:
  
   mvn exec:java   mvn exec:java
      
-You should see something like this:+You should see something like this (hopefully any warnings you get are ignorable):
  
   WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations   WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
Line 167: Line 167:
   [myproject.helloWorld.main()] INFO io.javalin.Javalin - Listening on http://localhost:32056/   [myproject.helloWorld.main()] INFO io.javalin.Javalin - Listening on http://localhost:32056/
   [myproject.helloWorld.main()] INFO io.javalin.Javalin - Javalin started in 263ms \o/   [myproject.helloWorld.main()] INFO io.javalin.Javalin - Javalin started in 263ms \o/
- +   
-Now try it outpoint your web browser to //http://yourusername.yourSDFmetarraydomain.org:yourMetaArrayPort // and see it if works!+If you get here, then your server is running! Now try it outpoint your web browser to //http://yourusername.yourSDFmetarraydomain.org:yourMetaArrayPort // and see it if works!
  
 Press ''ctl-c'' to stop the server.  Press ''ctl-c'' to stop the server. 
java_jetty_server_on_metaarray.txt · Last modified: 2023/04/27 18:26 by peteyboy