3 Replies Latest reply on Dec 24, 2009 5:06 PM by asookazian

    Launching Jetty embedded from Eclipse regarding numberguess example

    asookazian

      I followed these directions from readme.txt:



      Launching Jetty embedded from Eclipse

      First, set up the Eclipse environment:

      mvn clean eclipse:clean eclipse:eclipse -Pjetty-ide

      Next, put all the needed resources into the src/main/webapp

      mvn war:inplace -Pjetty-ide

      Now, you are ready to run the server in Eclipse; find the Start class in
      src/jetty/java, and run its main method as a Java Application. The server
      will launch. You can view the application at the following local URL:

      http://localhost:8080

      I am running Eclipse Galileo 3.5.1.  The instructions forgot to mention that you must create a M2_REPO variable to add to build path.


      The other problem is that I am unable to run the Start class due to Eclipse stating selection does not contain a main type which I assume is complaining that a public static void main() method does not exist in the class, which is not the case, it does exist.


      so why can't I run this class as a Java application from Eclipse?


      plz note that I am running jboss-6.0.0-SNAPSHOT but it worked fine with the exploded weld-numberguess.war that was deployed to server\default\deploy directory...

        • 1. Re: Launching Jetty embedded from Eclipse regarding numberguess example
          asookazian

          well, it seems that you must create a run config for the Java app and I'm now specifying org.mortbay.jetty.Main as the main class.  I shut down JBoss in case so there's no port conflict on port 8080.  but when I run the config, the JVM terminates and I see the following output in the console:


          Usage - java org.mortbay.jetty.Main [<addr>:]<port>
          Usage - java org.mortbay.jetty.Main [<addr>:]<port> docroot
          Usage - java org.mortbay.jetty.Main [<addr>:]<port> -webapp myapp.war
          Usage - java org.mortbay.jetty.Main [<addr>:]<port> -webapps webapps
          Usage - java -jar jetty-x.x.x-standalone.jar [<addr>:]<port>
          Usage - java -jar jetty-x.x.x-standalone.jar [<addr>:]<port> docroot
          Usage - java -jar jetty-x.x.x-standalone.jar [<addr>:]<port> -webapp myapp.war
          Usage - java -jar jetty-x.x.x-standalone.jar [<addr>:]<port> -webapps webapps



          any more specific instructions on how to get this app to run using Jetty from Eclipse?

          • 2. Re: Launching Jetty embedded from Eclipse regarding numberguess example
            pmuir

            Did you get this working? Care to submit a JIRA with detailed instructions on what to do?

            • 3. Re: Launching Jetty embedded from Eclipse regarding numberguess example
              asookazian

              Abandoned temporarily.  I will take a look at this when I have some time in the future.  thx.