For future reference, posted to JavaRebel support forum at

http://www.zeroturnaround.com/forum/topic.php?id=336

Mark Lynn
Sabado Technologies




On Jun 22, 2009, at 4:29 PM, David Pollak wrote:

>
>
> On Mon, Jun 22, 2009 at 11:54 AM, Mark Lynn <m...@sabado.com> wrote:
>
> David,
>
> Thanks. I expected that much, but I am only changing things within  
> snippets. I see in the terminal window running mvn scala:cc that the  
> file is being recompiled and I can also see in the file system that  
> the corresponding class files have updated timestamps. However,  
> JavaRebal only indicates that it is reloading the main snippet class  
> file and does not appear to reload additional class files.
>
> As an example, I defined MyMenu.scala as a direct replacement for  
> Menu.scala so that I could add some wrapper html for menu items. I  
> have the following (minus imports):
>
> class MyMenu extends DispatchSnippet {
>   def dispatch: DispatchIt = {
>     case "item" => item
>   }
>
>   def item(text: NodeSeq): NodeSeq =
>     for (name <- S.attr("name").toList;
>          request <- S.request.toList;
>          loc <- request.location.toList)
>     yield {
>       if (loc.name != name) {
>         val itemLink = SiteMap.buildLink(name, text) match {
>           case e : Elem => e % S.prefixedAttrsToMetaData("a")
>           case x => x
>         }
>         <span class="link">{ Group(itemLink) }</span>
>       } else if (S.attr("donthide").isDefined) {
>         // Use the provided text if it's non-empty, otherwise,  
> default to Loc's LinkText
>         <span class="current">{
>           if (text.length > 0) {
>             Group(text)
>           } else {
>             Group(loc.linkText openOr Text(loc.name))
>           }
>         }</span>
>       } else {
>         Text("")
>       }
>     }
>
>
> If I change the line
>
> <span class="link">{ Group(itemLink) }</span>
>
> to
>
> <span class="test-link">{ Group(itemLink) }</span>
>
> it does not pick this up though I see the following message in my  
> console window:
>
> JavaRebel: Reloading class 'org.watertogether.snippet.MyMenu'.
>
> If I kill Jetty and restart it, then the change is found.
>
> Yeah... I updated to JR 2.0.1 and am seeing the same problems.  It's  
> looking like JR is not loading the anonymous inner classes that  
> Scala generates.  I'd suggest reporting this on the JavaRebel list.
>
> Sorry.
>
>
>  - Mark
>
> Mark Lynn
> Sabado Technologies
>
>
> On Jun 22, 2009, at 2:07 PM, David Pollak wrote:
>
>> Mark,
>>
>> Anything that's passed to Lift in Boot is "static" and changes will  
>> not be picked up by JR on recompile.  So, if you're changing  
>> SiteMap or REST handling, you'll have to restart you app.
>>
>> Thanks,
>>
>> David
>>
>> On Mon, Jun 22, 2009 at 7:13 AM, Mark Lynn <m...@sabado.com> wrote:
>>
>>
>> I saw JavaRebel mentioned on the list in recent days and was excited
>> to try it. I followed the instructions at
>>
>> http://wiki.liftweb.net/index.php/JavaRebel
>>
>> for using it with Jetty. I have mvn scala:cc setup in another  
>> terminal
>> window and I see that it is compiling files that change. I also see
>> where JavaRebel is reporting that snippets are being reloaded, but it
>> does not appear to be reloading other classes generated from the
>> snippet source file. As an example, if I add a case to the dispatch
>> method, it does not pick up this change. Is this a limitation of
>> JavaRebel or am I missing something in the configuration? By the way,
>> I am not using an IDE - just Textmate and the command line which is  
>> my
>> preferred mode. The one thing I was really missing from the Rails
>> world was the reloading of classes automatically - hence I was very
>> excited to learn of JavaRebel.
>>
>>  - Mark
>>
>> Mark Lynn
>> Sabado Technologies
>>
>>
>>
>>
>>
>>
>>
>>
>> -- 
>> Lift, the simply functional web framework http://liftweb.net
>> Beginning Scala http://www.apress.com/book/view/1430219890
>> Follow me: http://twitter.com/dpp
>> Git some: http://github.com/dpp
>>
>>
>>
>
>
>
>
>
>
> -- 
> Lift, the simply functional web framework http://liftweb.net
> Beginning Scala http://www.apress.com/book/view/1430219890
> Follow me: http://twitter.com/dpp
> Git some: http://github.com/dpp
>
> >


--~--~---------~--~----~------------~-------~--~----~
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 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to