The sendMail Method on page 270 of DGG (Definitive Guide to Grails) has a method used in the subscription controller that is run from a job. The method (sendMail) takes a user a subject and a bodyContent Closure and sends it using the org.apache.commons.mail.HtmlEmail package.
Should work for the WebTest app with some tweaks. Better then the Spring thing that I tried from the tutorial on the grails site. That one seems to be very old since Grails has progressed alot...Thought the book is old too and has problems.
It works! Except I can't email from windows, only linux WTF... Hard to only work in linux, but I can do some stuff.
Thursday, January 24, 2008
Wednesday, January 23, 2008
Found Grails Eclipse resource!
http://docs.codehaus.org/display/GRAILS/Eclipse+IDE+Integration
Shows how to start grails app from eclipse.
Also has info on how to single step, but so far I can't get that to work.
Shows how to start grails app from eclipse.
Also has info on how to single step, but so far I can't get that to work.
Tuesday, January 22, 2008
eclipse bug: Compute launch button tooltip
Is happening when I try to run grails apps. Not sure if it's related to testNG, but it started when I installed it
grails upgrade and app debugging issues
I upgraded to rc4 and groovy 1.5.1 and had some problems developing on my HP laptop. New apps did not run and the class files were all scattered in the top level of the project.
Comcast laptop had racetrack at version from grails rc1 to rc3. I did the grails upgrade. The app still ran np. The Problems view showed the same Unbound claspath variable : GRAILS_HOME problem. I imported the groovy-all-1.0.jar file by "import groovy libs into project". No change.
I added the GRAILS_HOME variable in the project properties Java Build Path dialog (libraries) and it errored out with the same "Variable points to a folder: Use 'Extend...'to select an archive inside the folder." WTF? I can hit cancel, the variable is set, and the app no longer has the "Problems" view issues. I can then do an eclipse clean and the app builds, and all the class files are deposited in the project top level. again WTF?
I played with turning off the java builder and it works and makes changes to the .project file. I changed it back.
When running grails test-app in RC-3 all the tests fail.
I reverted the environ to rc1 and reverted the project to what's in trunk. I ran grails test-app and all but 4 of the tests passed. Not sure what it was before (all passed or what)
Did an experiment: Upgraded the project to rc3 and ran test-app in an rc-1 environment: Won't run because the app and environ grails version's don't match!! Did another grails upgrade from rc1 (app was rc3) and it downgraded the app! Tests (except 4) ran successfully.
Upgraded back to rc3 (app) and ran it in rc3 (environ) and the tests (cept 4) passed. Wtf.
Will experiment with TestGrails app.
Comcast laptop had racetrack at version from grails rc1 to rc3. I did the grails upgrade. The app still ran np. The Problems view showed the same Unbound claspath variable : GRAILS_HOME problem. I imported the groovy-all-1.0.jar file by "import groovy libs into project". No change.
I added the GRAILS_HOME variable in the project properties Java Build Path dialog (libraries) and it errored out with the same "Variable points to a folder: Use 'Extend...'to select an archive inside the folder." WTF? I can hit cancel, the variable is set, and the app no longer has the "Problems" view issues. I can then do an eclipse clean and the app builds, and all the class files are deposited in the project top level. again WTF?
I played with turning off the java builder and it works and makes changes to the .project file. I changed it back.
When running grails test-app in RC-3 all the tests fail.
I reverted the environ to rc1 and reverted the project to what's in trunk. I ran grails test-app and all but 4 of the tests passed. Not sure what it was before (all passed or what)
Did an experiment: Upgraded the project to rc3 and ran test-app in an rc-1 environment: Won't run because the app and environ grails version's don't match!! Did another grails upgrade from rc1 (app was rc3) and it downgraded the app! Tests (except 4) ran successfully.
Upgraded back to rc3 (app) and ran it in rc3 (environ) and the tests (cept 4) passed. Wtf.
Will experiment with TestGrails app.
Monday, January 21, 2008
trying to fix grails groovy tests in grails apps
Most of the grails test-app test fail with some odd problems about not being able to find some of the domain classes. The problems view in eclipse says stuff like
Unbound classpath variable: 'GRAILS_HOME/ant/lib/ant.jar' in project 'racetrack-TRUNK' racetrack-TRUNK Build path 1200916693560 24138
...
Unbound classpath variable: 'GRAILS_HOME/dist/grails-core-1.0-RC1.jar' in project 'racetrack-TRUNK' racetrack-TRUNK Build path 1200916693576 24197
When upgrading the groovy plugin I found that I needed testNG so I have added the testNG to my eclipse installation and I could then upgrade the groovy plugin. There's a maven plugin too, and I'll have a look at that too.
So next to fix the Unbound classpath variable problems...
Need to create a variable for GRAILS_HOME and point it to the latest grails version.
Setting the GRAILS_HOME only worked if I had also upgraded he project to RC-4. Have to test this with another app to be sure.
One weird thing is that dozens of .class files get build and put into the root folder. Messy. These are definately created by the eclipse build. If you delete them and then do a clean you get them regenerated.
Also seem to need to configure the .classpath so that all the class files go somewhere other than the root folder...
Unbound classpath variable: 'GRAILS_HOME/ant/lib/ant.jar' in project 'racetrack-TRUNK' racetrack-TRUNK Build path 1200916693560 24138
...
Unbound classpath variable: 'GRAILS_HOME/dist/grails-core-1.0-RC1.jar' in project 'racetrack-TRUNK' racetrack-TRUNK Build path 1200916693576 24197
When upgrading the groovy plugin I found that I needed testNG so I have added the testNG to my eclipse installation and I could then upgrade the groovy plugin. There's a maven plugin too, and I'll have a look at that too.
So next to fix the Unbound classpath variable problems...
Need to create a variable for GRAILS_HOME and point it to the latest grails version.
Setting the GRAILS_HOME only worked if I had also upgraded he project to RC-4. Have to test this with another app to be sure.
One weird thing is that dozens of .class files get build and put into the root folder. Messy. These are definately created by the eclipse build. If you delete them and then do a clean you get them regenerated.
Also seem to need to configure the .classpath so that all the class files go somewhere other than the root folder...
Friday, December 7, 2007
service initialization gui application
/usr/bin/system-config-services (may not work) or
usr/sbin/serviceconf
usr/sbin/serviceconf
Thursday, December 6, 2007
To use the maven grails plugin
First create a project (or see how to generate a pom for an existing grails project)
mvn -DgrailsHome=d:\install\groovy\grails-1.0-RC1\ grails:create-app
Then cd to the directory containing the new project and create a pom
mvn -DgroupId=com.summitbid grails:create-pom
There's no longer a run-app target for the mvn plugin but you can test it with:
mvn grails:test-app
First create a project (or see how to generate a pom for an existing grails project)
mvn -DgrailsHome=d:\install\groovy\grails-1.0-RC1\ grails:create-app
Then cd to the directory containing the new project and create a pom
mvn -DgroupId=com.summitbid grails:create-pom
There's no longer a run-app target for the mvn plugin but you can test it with:
mvn grails:test-app
Subscribe to:
Posts (Atom)