It WORKS!!!!!!!!! This is really cool.  I put the call to the
MainGenericRunner.main function in a thread object and called start
().  I then did an import of my class and called a function and voila,
it returned the expected value while the lift program is running in
the other thread.  Poor man's debugger without having to add print()
all over your code!

So below is the complete sequence.  Thanks to Josh and Tyler for their
support!

% mvn scala:console

scala> import scala.tools.nsc.MainGenericRunner

scala> import org.codehaus.classworlds.Launcher

scala> new bootstrap.liftweb.Boot().boot

scala> val args = List("-howtorun:object", "-Dclassworlds.conf=/usr/
local/apache-maven/apache-maven-2.0.9/bin/m2.conf",  "-Dmaven.home=/
usr/local/apache-maven/apache-maven-2.0.9",
"org.codehaus.classworlds.Launcher", "jetty:run").toArray

scala> object ConsoleThread extends Thread { override def run =
MainGenericRunner.main(args)}

scala> ConsoleThread.start()

scala> <type in your debugging code here!!!!>



On Dec 10, 3:47 pm, Dano <[EMAIL PROTECTED]> wrote:
> Ok.  I got the app to run by adding 'jetty:run' as an argument after
> the Launcher class.  However, the interpreter does not return to the
> command prompt I stop it using <ctrl>-C.  Maybe I need to spawn a
> thread with the expression 'MainGenericRunner.main(args)'.
>
> Dan
>
> On Dec 10, 3:28 pm, Dano <[EMAIL PROTECTED]> wrote:
>
> > Nice catch.  Thanks Josh.
>
> > Very close now.  For those that want to know, the sequence is below.
> > Somehow mvn is not seeing the 'jetty:run' goal.
>
> > % mvn scala:console jetty:run
>
> > scala> import scala.tools.nsc.MainGenericRunner
>
> > scala> import org.codehaus.classworlds.Launcher
>
> > scala> new bootstrap.liftweb.Boot().boot
>
> > scala> val args = List("-howtorun:object", "-Dclassworlds.conf=/usr/
> > local/apache-maven/apache-maven-2.0.9/bin/m2.conf",  "-Dmaven.home=/
> > usr/local/apache-maven/apache-maven-2.0.9",
> > "org.codehaus.classworlds.Launcher").toArray
>
> > scala> MainGenericRunner.main(args)
>
> > [INFO] Scanning for projects...
> > [INFO]
> > ------------------------------------------------------------------------
> > [ERROR] BUILD FAILURE
> > [INFO]
> > ------------------------------------------------------------------------
> > [INFO]
>
> > You must specify at least one goal. Try 'mvn install' to build or 'mvn
> > -?' for options
> > Seehttp://maven.apache.orgformore information.
>
> > [INFO]
> > ------------------------------------------------------------------------
> > [INFO] For more information, run Maven with the -e switch
> > [INFO]
> > ------------------------------------------------------------------------
> > [INFO] Total time: < 1 second
> > [INFO] Finished at: Wed Dec 10 15:18:31 PST 2008
> > [INFO] Final Memory: 17M/162M
> > [INFO]
> > ------------------------------------------------------------------------
> > [INFO]
> > ------------------------------------------------------------------------
> > [ERROR] BUILD FAILURE
>
> > On Dec 10, 12:25 pm, "Josh Suereth" <[EMAIL PROTECTED]> wrote:
>
> > > Typo in codehause, it should be org.codehaus.classworlds.Launcher.
>
> > > On Wed, Dec 10, 2008 at 2:36 PM, Dano <[EMAIL PROTECTED]> wrote:
>
> > > > Hi Tyler!
>
> > > > I am trying to run my lift app which I usually do by issuing 'mvn
> > > > jetty:run'.  I believe this runs the class
> > > > org.codehause.classworlds.Launcher with the arguments "-
> > > > Dclassworlds.conf=/usr/local/apache-maven/apache-maven-2.0.9/bin/
> > > > m2.conf -Dmaven.home=/usr/local/apache-maven/apache-maven-2.0.9".
>
> > > > Currently, I am trying to run MainGenericRunner.main(args) where I am
> > > > stuffing the above into the args.  It complains that "error: value
> > > > codehause is not a member of package org.  So maybe I just have to
> > > > figure out how to import that class.
>
> > > > Thanks.
>
> > > > Dan
>
> > > > On Dec 10, 11:12 am, TylerWeir <[EMAIL PROTECTED]> wrote:
> > > > > What are you attempting?
>
> > > > > if you run: import com.your.classpath.model._
> > > > > You should be able to create and play with model objects.
>
> > > > > What are you looking to do?
>
> > > > > On Dec 10, 1:39 pm, Dano <[EMAIL PROTECTED]> wrote:
>
> > > > > > Hello Lifters,
>
> > > > > > I am looking into using the maven scala:console plugin as an aid to
> > > > > > debugging with the hope that I can start my lift app thru the 
> > > > > > console,
> > > > > > and then after it comes up, be able to issue calls to 'static' 
> > > > > > methods
> > > > > > which will return data which can help me see what is going on.  My
> > > > > > attempts to use NetBeans as a debugger for my lift app have failed
> > > > > > miserably.  I need a robust simple way to debug and the console 
> > > > > > plug-
> > > > > > in seems like a good way to go.
>
> > > > > > Per the instructions located athttp://
> > > > scala-tools.org/mvnsites/maven-scala-plugin/usage_console.html,
> > > > > > I have done the following:
>
> > > > > >     % mvn scala:console jetty:run
> > > > > >     ....
> > > > > >     scala> new bootstrap.liftweb.Boot().boot
>
> > > > > > However, jetty is not running yet and I am not sure how to prod into
> > > > > > life.
>
> > > > > > Has anyone tried this or have any suggestions?
>
> > > > > > Thanks in advance.
>
> > > > > > Dano
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to