Try Out the Fix

3 views
Skip to first unread message

Robert Fischer

unread,
Mar 20, 2009, 8:53:11 PM3/20/09
to Autobase
I've fixed bugs that have the following symptom:
* Directories like .scripts and .svn are attempted to be run
* Autobase does not execute in create-drop mode

The following behavior was also sneakily added and released:
* Autobase *does* execute in create-drop mode, and you'd rather it not

To not run Autobase in create-drop mode, set the following property in Config.groovy:
autobase.runOnCreateDrop = false

Try out the fixes and let me know what you think.

~~ Robert Fischer.
Grails Training http://GroovyMag.com/training
Smokejumper Consulting http://SmokejumperIT.com
Enfranchised Mind Blog http://EnfranchisedMind.com/blog

Check out my book, "Grails Persistence with GORM and GSQL"!
http://www.smokejumperit.com/redirect.html

Robert Fischer

unread,
Mar 21, 2009, 9:04:29 PM3/21/09
to Autobase
How do you go from a URL to a File on your Y: drive a Windows box?

~~ Robert.

Matias Bjarland wrote:
> Hi Robert,
>
> A bit short on time right now and I'll try to get a more detailed
> version later if needed but here are some initial findings.
>
> Seems that when running on a windows box, there is a URL formatting
> problem with the URL returned by the fileOpener. I have my sample
> project on a drive called "Y:" and doing:
>
> * grails create-app abtest
> * cd abtest
> * grails install-plugin autobase
> * grails create-migration TestOne
> * grails run-app
>
> will result in the exception in the attached log. I suspect that you are
> developing a OSX system, so not exactly easy to spot these there.
>
> Best,
> Matias
>
>
>
>
> On Sat, Mar 21, 2009 at 1:53 AM, Robert Fischer
> <robert....@smokejumperit.com
> --
> Matias Bjarland | mat...@iteego.com <mailto:mat...@iteego.com> | P: +46
> 736 214212 | F: +46 31 7111504 | http://iteego.com
>
> DISCLAIMER: This message contains information which may be confidential
> and/or privileged, and is intended only for the use of
> the addressee(s). Any use, disclosure or copying of this message or any
> part thereof by any person other than such addressee(s) is
> unauthorized and strictly prohibited. If you have received this message
> in error, please notify the sender by return e-mail and delete
> the message. Thank you for your cooperation.

--

Matias Bjarland

unread,
Mar 22, 2009, 6:29:34 AM3/22/09
to grails-...@googlegroups.com
Yeah, I can start by apologizing for sitting on a windows machine. I'm still dependant on a bunch of weird software (read screwed up client vpn bridge etc) which refuses to run on any *nix platform.  

After looking into this a bit it seems that going from a URL to File is not exactly clean in java. It seems the problem on Windows is that the fileopener sends out a URL with "file://xxx" instead of "file:///xxx". The easiest way to get around this is probably apache commons: 

FileUtils.toFile(url) : URL -> File

Attaching a zip with a simple java program which tries to use the URL that I (think) autobase is breaking on on windows and a log of how the output looks when I run the program. I ran this with the apache commons io version that ships with grails 1.1. 

Best, 
Matias



url.zip

Robert Fischer

unread,
Mar 22, 2009, 6:33:52 PM3/22/09
to grails-...@googlegroups.com
Care to submit a patch? Easiest way would be via pull request on GitHub.

Keep in mind that you can't assume the URL is a file in Liquibase-DSL -- for one thing, I've
experimented with classpath:// URLs for extracting migrations when running WARred under Autobase.
For another, there are people using http:// URLs for some migrations.

~~ Robert Fischer.
Grails Training http://GroovyMag.com/training
Smokejumper Consulting http://SmokejumperIT.com
Enfranchised Mind Blog http://EnfranchisedMind.com/blog

Check out my book, "Grails Persistence with GORM and GSQL"!
http://www.smokejumperit.com/redirect.html


Reply all
Reply to author
Forward
0 new messages