JRebel and Lift

117 views
Skip to first unread message

maikklein

unread,
Sep 22, 2012, 4:45:01 PM9/22/12
to lif...@googlegroups.com
I just found JRebel and for scala users it is free but I am not sure if it is needed. 
At the moment I am able to recompile my lift app, if I refresh the browser and I don't have to restart the server. 
~; container:start; container:reload
From what I see on the JRebel page it does exactly the same thing?

Are there any pros / cons for using JRebel in Lift?

Ben Phelan

unread,
Sep 22, 2012, 5:23:05 PM9/22/12
to lif...@googlegroups.com
The main benefits of JRebel are that it is slightly faster than restarting the container and that you don't lose your session/s.  This can save you time if you are testing something in the middle of a complicated process or where you have to be logged in.  On the other hand there are a bunch of things it can't/doesn't reload for you and this could be confusing until you get the hang of it.

Naftoli Gugenheim

unread,
Sep 23, 2012, 6:34:35 PM9/23/12
to lif...@googlegroups.com
On Sat, Sep 22, 2012 at 4:45 PM, maikklein <maik...@googlemail.com> wrote:
I just found JRebel and for scala users it is free but I am not sure if it is needed. 
At the moment I am able to recompile my lift app, if I refresh the browser and I don't have to restart the server. 
~; container:start; container:reload
The above does restart the server. For instance, every time you save a source file, you will have a fresh session.
 
From what I see on the JRebel page it does exactly the same thing?

Are there any pros / cons for using JRebel in Lift?

--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code
 
 
 

AGYNAMIX Torsten Uhlmann

unread,
Sep 24, 2012, 9:34:28 AM9/24/12
to lif...@googlegroups.com
And if you're using the Scala-IDE with Eclipse you don't even need to ~compile, Eclipse does that for you. It compiles the sources into the same target dir as sbt, JRebel picks up the new classes and redeploys them.

Torsten.

-- 
AGYNAMIX(R). Passionate Software.
Inh. Torsten Uhlmann | Buchenweg 5 | 09380 Thalheim
Phone:       +49 3721 273445
Fax:             +49 3721 273446
Mobile:       +49 151 12412427
Web:           http://www.agynamix.de

Am 24.09.2012 um 10:30 schrieb Alexzander <alexza...@gmail.com>:

Hello!

With JRebel you don't to need reload, you can run ~compile task, wich will start a continious compilation, then start a container and thats all.

воскресенье, 23 сентября 2012 г., 0:45:01 UTC+4 пользователь maikklein написал:

Chenguang He

unread,
Sep 24, 2012, 1:08:03 PM9/24/12
to lif...@googlegroups.com
Is there any idea that how to setup JRebel in Intellij?
I tried many ways, but none of them succeed

Chenguang He

AGYNAMIX Torsten Uhlmann

unread,
Sep 24, 2012, 1:21:49 PM9/24/12
to lif...@googlegroups.com
When I used IntelliJ I used it together with the sbt plugin. All you need to do then is to use the line to launch sbt from the sbt shell script and paste it into the sbt plugin line in IntelliJ.

The other alternative would be to simply run sbt from a terminal. In that case you don't have to do anything special in IntelliJ at all.

In build.sbt you say:

scanDirectories := Nil

In your sbt shell script you define (adjust path):

java -Djava.awt.headless=true -Dfile.encoding=UTF8 -XX:MaxPermSize=512m -Xss4M -Xmx1512M -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC -server -noverify -javaagent:/ewu/jrebel/jrebel.jar -Drebel.lift_plugin=true -jar `dirname $0`/sbt-launch-0.11.3-2.jar "$@"

Hope that helps,
Torsten.

-- 
AGYNAMIX(R). Passionate Software.
Inh. Torsten Uhlmann | Buchenweg 5 | 09380 Thalheim
Phone:       +49 3721 273445
Fax:             +49 3721 273446
Mobile:       +49 151 12412427
Web:           http://www.agynamix.de

Chenguang He

unread,
Sep 24, 2012, 3:47:13 PM9/24/12
to lif...@googlegroups.com
Uhm.. i tried the second way, it didn't work.
For the first way, do you use JRebel plug-in or not? When i use the plug-in, it shows that it works, but when i change the .scala class, nothing happened.


Chenguang He



Tobias Pfeiffer

unread,
Sep 24, 2012, 3:49:45 PM9/24/12
to lif...@googlegroups.com
Hi,

Am Montag, 24. September 2012, 21:47 schrieb Chenguang He:
> Uhm.. i tried the second way, it didn't work.
> For the first way, do you use JRebel plug-in or not? When i use the
> plug-in, it shows that it works, but when i change the .scala class,
> nothing happened.

For me (I use JRebel with the RunWebApp test, as it's much faster), the
class reload only takes place when the code is *needed* (e.g. at page
reload), not when it's changed/compiled. When I change a snippet and
reload the page, I get a JRebel message "Reloading class ..." on the
console.

Tobias

Chenguang He

unread,
Sep 24, 2012, 3:56:13 PM9/24/12
to lif...@googlegroups.com
Do you use container:start ?

Chenguang He




Tobias Pfeiffer

unread,
Sep 24, 2012, 3:59:12 PM9/24/12
to lif...@googlegroups.com
Hi,

Am Montag, 24. September 2012, 21:56 schrieb Chenguang He:
> Do you use container:start ?

No, I run the RunWebApp class in the src/test/scala directory of my
project directly from Eclipse as a "Scala Application".

Tobias

Alexzander

unread,
Sep 25, 2012, 8:37:33 AM9/25/12
to lif...@googlegroups.com
Just use this plugin to create intellij idea project  https://github.com/mpeltonen/sbt-idea 

понедельник, 24 сентября 2012 г., 21:08:01 UTC+4 пользователь Readman написал:

Chenguang He

unread,
Sep 25, 2012, 3:00:33 PM9/25/12
to lif...@googlegroups.com
Yea, i know how to create a .idea project in Lift.
I just want to know, do you use Intellij's JRebel plug-in? or just sbt with JRebel?

Chenguang He



Alexzander

unread,
Sep 25, 2012, 3:16:16 PM9/25/12
to lif...@googlegroups.com
I`m using both IDEA Jrebel and Sbt plugins - everything works well.

вторник, 25 сентября 2012 г., 23:00:37 UTC+4 пользователь Readman написал:
Reply all
Reply to author
Forward
0 new messages