Quantcast

Grails 2.0.RC1 Auto Reloading

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
32 messages Options
12
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Grails 2.0.RC1 Auto Reloading

PfisterA
it seems that the plugin spring-security-ui breaks auto-reloading .....
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Grails 2.0.RC1 Auto Reloading

myongchong
I run grails 2.0.0 final by doing 'grails run-app' in Windows 7 command line.  I created a JIRA issue for this issue  http://jira.grails.org/browse/GRAILS-8573 

On Fri, Jan 6, 2012 at 2:04 PM, PfisterA [via Grails] <[hidden email]> wrote:
it seems that the plugin spring-security-ui breaks auto-reloading .....


If you reply to this email, your message will be added to the discussion below:
http://grails.1312388.n4.nabble.com/Grails-2-0-RC1-Auto-Reloading-tp4023792p4270475.html
To unsubscribe from Grails 2.0.RC1 Auto Reloading, click here.
NAML

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Grails 2.0.RC1 Auto Reloading

robelsner
In reply to this post by PfisterA

I think I remember that plugin isn't 2.0 compatible yet.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Grails 2.0.RC1 Auto Reloading

npasto
In reply to this post by pledbrook
Hi all, I have a weird issue related to that thread:

I use windows 7 64b + jdk1.6.0_25 64b + grails 2.0 for development

I am using intellij + the VM option fix
(-javaagent:c:\grails-2.0.0/lib/com.springsource.springloaded/springloaded-core/jars/springloaded-core-1.0.2.jar
-noverify
-Dspringloaded=profile=grails)

It used to be OK...
But for some projects Auto Reloading started to fail both from Intelliji server launch or command line server launch as well.

When I modify files,  they don't get recompiled at run time ... the recompiling process starts to work after a (BIG) while, like when the server has been being running for 10 minutes.

For these projects I have copied code from other projects (both files and plugins), is there a connection ?

Is there a way to understand that erratic behavior ?

thanks.

Nicolas.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Grails 2.0.RC1 Auto Reloading

Matthias Hryniszak
I also have experienced this kind of behavior although in different scenario that's reproducible even in simplest cases. When I start the Grails environment and the go run-app from there it usually works. But running grails run-app doesn't work even though the console spits out information that classes are being recompiled. 

I'm experiencing this on Ubuntu 11.10, Windows 7 32bit and Windows XP SP3 32bit.

Best regards,
Matthias

2012/2/10 npasto <[hidden email]>
Hi all, I have a weird issue related to that thread:

I use windows 7 64b + jdk1.6.0_25 64b + grails 2.0 for development

I am using intellij + the VM option fix
(-javaagent:c:\grails-2.0.0/lib/com.springsource.springloaded/springloaded-core/jars/springloaded-core-1.0.2.jar
-noverify
-Dspringloaded=profile=grails)

It used to be OK...
But for some projects Auto Reloading started to fail both from Intelliji
server launch or command line server launch as well.

When I modify files,  they don't get recompiled at run time ... the
recompiling process starts to work after a (BIG) while, like when the server
has been being running for 10 minutes.

For these projects I have copied code from other projects (both files and
plugins), is there a connection ?

Is there a way to understand that erratic behavior ?

thanks.

Nicolas.

--
View this message in context: http://grails.1312388.n4.nabble.com/Grails-2-0-RC1-Auto-Reloading-tp4023792p4376990.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Grails 2.0.RC1 Auto Reloading

Matthias Hryniszak
I found the issue with run-app by analyzing the grails.bat file:

There are 2 ways of specifying the script to run:

- the full form (run-app in this case)
- the short form (rA)

I almost never type the full form and in the original startGrails.bat file in the line 102 there's check if the command is called "run-app" but no mentioning of "rA" exists in that batch file.

Should I raise a Jira for this or is it enough if I provide a pull request with a change that extends the startGrails.bat?


Matthias.

2012/2/10 Matthias Hryniszak <[hidden email]>
I also have experienced this kind of behavior although in different scenario that's reproducible even in simplest cases. When I start the Grails environment and the go run-app from there it usually works. But running grails run-app doesn't work even though the console spits out information that classes are being recompiled. 

I'm experiencing this on Ubuntu 11.10, Windows 7 32bit and Windows XP SP3 32bit.

Best regards,
Matthias


2012/2/10 npasto <[hidden email]>
Hi all, I have a weird issue related to that thread:

I use windows 7 64b + jdk1.6.0_25 64b + grails 2.0 for development

I am using intellij + the VM option fix
(-javaagent:c:\grails-2.0.0/lib/com.springsource.springloaded/springloaded-core/jars/springloaded-core-1.0.2.jar
-noverify
-Dspringloaded=profile=grails)

It used to be OK...
But for some projects Auto Reloading started to fail both from Intelliji
server launch or command line server launch as well.

When I modify files,  they don't get recompiled at run time ... the
recompiling process starts to work after a (BIG) while, like when the server
has been being running for 10 minutes.

For these projects I have copied code from other projects (both files and
plugins), is there a connection ?

Is there a way to understand that erratic behavior ?

thanks.

Nicolas.

--
View this message in context: http://grails.1312388.n4.nabble.com/Grails-2-0-RC1-Auto-Reloading-tp4023792p4376990.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email




Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Grails 2.0.RC1 Auto Reloading

npasto
Hi Matthias, do mean that in your case the problem is solved when you use run-app instead of ra ?

I my case I use run-app anyway ... the strange thing is that it sometime misbehave (for a painful period of time) by not recompiling changed code.

Does some one know how that "hot recompiling" process works ? Then, is there a misconfiguration that can make it fail ?


Does it just look at all the changed files in grails-app, src and plugin directory ?

I my case, changing a simple controller doesn't force recompilation, I don't understand.

It had been working for me since 1.X versions.

thanks,
 Nicolas.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Grails 2.0.RC1 Auto Reloading

npasto
Hi experts,

I am using  grails.project.plugins.dir = "./plugins" in conf/Build.groovy to get the plugins installed in the project directory.

It seems that this if the cause of the "no hot recompilation" problem in my case...

Once this option is set and the server gets launched, plug ins get downloaded (web.xml, Jquery , hivernate etc).

These local plug ins are then used instead of shared onces,  it seams that after that hot reload feature of Grails 2.0 disappears.

Can some one explain this behavior ?

Is there a way to fix it ?

Thanks a lot, I am stuck because we want to have plug ins local to the projects for code share purposes.

Nicolas.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Grails 2.0.RC1 Auto Reloading

Matthias Hryniszak
I'm using "-Dgrails.project.work.dir=target/work" parameter  in the grails.bat  to have all the artifacts stored per project. Although I don't really use the hot reloading functionality for foreign plugins I do however use it to have the option to have more than one branch of the same application on the same machine.

That way for example all the compiled files and downloaded plugins separated and when I switch branches all I need to do is to clear a folder that is right there in the working copy (ignored by SCM by default).

Here's how my proxy batch file for grails.bat looks like

C:\Windows\grails.bat

@echo off

set GRAILS_HOME=C:/grails-2.0.0
set JAVA_OPTS=%JAVA_OPTS% -Dgrails.project.work.dir=target/work

%GRAILS_HOME%\bin\grails.bat %*

You can try it out if it'll help you in any way.


Matthias.

2012/2/11 npasto <[hidden email]>
grails.project.plugins

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Grails 2.0.RC1 Auto Reloading

burtbeckwith
You can make that change in BuildConfig.groovy; whenever I create a new project one of the first things I do is change

   grails.project.class.dir = "target/classes"
   grails.project.test.class.dir = "target/test-classes"
   grails.project.test.reports.dir = "target/test-reports"

to

   grails.project.work.dir = 'target'

to keep everything under target.

Burt

On Saturday, February 11, 2012 10:15:28 AM Matthias Hryniszak wrote:

> I'm using "-Dgrails.project.work.dir=target/work" parameter  in the
> grails.bat  to have all the artifacts stored per project. Although I don't
> really use the hot reloading functionality for foreign plugins I do however
> use it to have the option to have more than one branch of the same
> application on the same machine.
>
> That way for example all the compiled files and downloaded plugins
> separated and when I switch branches all I need to do is to clear a folder
> that is right there in the working copy (ignored by SCM by default).
>
> Here's how my proxy batch file for grails.bat looks like
>
> C:\Windows\grails.bat
>
> @echo off
>
> set GRAILS_HOME=C:/grails-2.0.0
> set JAVA_OPTS=%JAVA_OPTS% -Dgrails.project.work.dir=target/work
>
> %GRAILS_HOME%\bin\grails.bat %*
>
> You can try it out if it'll help you in any way.
>
>
> Matthias.
>
> 2012/2/11 npasto <[hidden email]>
>
> > grails.project.plugins

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Grails 2.0.RC1 Auto Reloading

Matthias Hryniszak
So what you're saying is that setting this parameter in BuildConfig.groovy is completely the same as passing it in the command line? I need to check it out because it will simplify Grails the installation on other machines (like in Jenkins for example)... 

Anyways, what I am wondering about is if having plugins installed under target/work/plugins will cause the plugin classes to be reloaded when I manually change them...

And so I checked it using the Quartz plugin as an example. The following can be observed:

1. I've been modifying the "isArtefactClass" method in TaskArtefactHandler.java adding a System.out.println("...") to the beginning of the method
2. I've created an ExampleJob.groovy under grails-app/jobs
3. I've started the application using interactive mode. In this instant I could see lots of my debug outputs in console showing that the class has been modified, compiled and is being used.
4. I've modified the "isArtefactClass" method in TaskArtefactHandler.java again adding some random text to it. After saving the file I see the message "| Compiling 1 source files." in console suggesting that the change has been picked up.
5. After modifying the ExampleJob.groovy I see the previous message being dumped instead of the modified in pt 4.

So far my conclusion is that the new class has been picked up and compiled but not swapped with the previous definition. I guess that means that existing instances are not being updated the way they are when using other tools like JavaRebel for example. 

So to answer the original question it seems that it is not possible to achieve at this point reloading of non-artefact classes for plugins.


Matthias.

2012/2/11 Burt Beckwith <[hidden email]>
You can make that change in BuildConfig.groovy; whenever I create a new project one of the first things I do is change

  grails.project.class.dir = "target/classes"
  grails.project.test.class.dir = "target/test-classes"
  grails.project.test.reports.dir = "target/test-reports"

to

  grails.project.work.dir = 'target'

to keep everything under target.

Burt

On Saturday, February 11, 2012 10:15:28 AM Matthias Hryniszak wrote:
> I'm using "-Dgrails.project.work.dir=target/work" parameter  in the
> grails.bat  to have all the artifacts stored per project. Although I don't
> really use the hot reloading functionality for foreign plugins I do however
> use it to have the option to have more than one branch of the same
> application on the same machine.
>
> That way for example all the compiled files and downloaded plugins
> separated and when I switch branches all I need to do is to clear a folder
> that is right there in the working copy (ignored by SCM by default).
>
> Here's how my proxy batch file for grails.bat looks like
>
> C:\Windows\grails.bat
>
> @echo off
>
> set GRAILS_HOME=C:/grails-2.0.0
> set JAVA_OPTS=%JAVA_OPTS% -Dgrails.project.work.dir=target/work
>
> %GRAILS_HOME%\bin\grails.bat %*
>
> You can try it out if it'll help you in any way.
>
>
> Matthias.
>
> 2012/2/11 npasto <[hidden email]>
>
> > grails.project.plugins

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Grails 2.0.RC1 Auto Reloading

Matthias Hryniszak
@Burt Setting the grails.project.work.dir = 'target' is way better than doing it manually in the "proxy script"! And removing those other settings does make the folder structure really more manageable! Thanks for the tip!

Unfortunately the change you proposed didn't influence the ability to update class definition of the plugin class so that part remains the same...

Matthias. 

2012/2/11 Matthias Hryniszak <[hidden email]>
So what you're saying is that setting this parameter in BuildConfig.groovy is completely the same as passing it in the command line? I need to check it out because it will simplify Grails the installation on other machines (like in Jenkins for example)... 

Anyways, what I am wondering about is if having plugins installed under target/work/plugins will cause the plugin classes to be reloaded when I manually change them...

And so I checked it using the Quartz plugin as an example. The following can be observed:

1. I've been modifying the "isArtefactClass" method in TaskArtefactHandler.java adding a System.out.println("...") to the beginning of the method
2. I've created an ExampleJob.groovy under grails-app/jobs
3. I've started the application using interactive mode. In this instant I could see lots of my debug outputs in console showing that the class has been modified, compiled and is being used.
4. I've modified the "isArtefactClass" method in TaskArtefactHandler.java again adding some random text to it. After saving the file I see the message "| Compiling 1 source files." in console suggesting that the change has been picked up.
5. After modifying the ExampleJob.groovy I see the previous message being dumped instead of the modified in pt 4.

So far my conclusion is that the new class has been picked up and compiled but not swapped with the previous definition. I guess that means that existing instances are not being updated the way they are when using other tools like JavaRebel for example. 

So to answer the original question it seems that it is not possible to achieve at this point reloading of non-artefact classes for plugins.


Matthias.


2012/2/11 Burt Beckwith <[hidden email]>
You can make that change in BuildConfig.groovy; whenever I create a new project one of the first things I do is change

  grails.project.class.dir = "target/classes"
  grails.project.test.class.dir = "target/test-classes"
  grails.project.test.reports.dir = "target/test-reports"

to

  grails.project.work.dir = 'target'

to keep everything under target.

Burt

On Saturday, February 11, 2012 10:15:28 AM Matthias Hryniszak wrote:
> I'm using "-Dgrails.project.work.dir=target/work" parameter  in the
> grails.bat  to have all the artifacts stored per project. Although I don't
> really use the hot reloading functionality for foreign plugins I do however
> use it to have the option to have more than one branch of the same
> application on the same machine.
>
> That way for example all the compiled files and downloaded plugins
> separated and when I switch branches all I need to do is to clear a folder
> that is right there in the working copy (ignored by SCM by default).
>
> Here's how my proxy batch file for grails.bat looks like
>
> C:\Windows\grails.bat
>
> @echo off
>
> set GRAILS_HOME=C:/grails-2.0.0
> set JAVA_OPTS=%JAVA_OPTS% -Dgrails.project.work.dir=target/work
>
> %GRAILS_HOME%\bin\grails.bat %*
>
> You can try it out if it'll help you in any way.
>
>
> Matthias.
>
> 2012/2/11 npasto <[hidden email]>
>
> > grails.project.plugins

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email




12
Loading...