Thursday, December 13, 2012

grails 1.3.8 and java 1.6

since we still have a lot of grails 1.3.8 application, we are forced to use them and apparently sometimes all the test fail with the following exception:

java.lang.IllegalAccessError: tried to access class org.apache.xml.serializer.XSLOutputAttributes from class org.apache.xalan.transformer.TransformerImpl at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates( at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates( at org.apache.xalan.lib.Redirect.write( at org.apache.xalan.extensions.ExtensionHandlerJavaClass.processElement( at org.apache.xalan.templates.ElemExtensionCall.execute( at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes( at org.apache.xalan.templates.ElemApplyTemplates.execute( at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates( at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode( at org.apache.xalan.transformer.TransformerImpl.transformNode( at org.apache.xalan.transformer.TransformerImpl.transform( at org.apache.xalan.transformer.TransformerImpl.transform( at org.apache.xalan.transformer.TransformerImpl.transform( at at at at at at at at _GrailsEvents_groovy$_run_closure5.doCall(_GrailsEvents_groovy:58) at _GrailsEvents_groovy$ at _GrailsTest_groovy$_run_closure1.doCall(_GrailsTest_groovy:199) at TestApp$_run_closure1.doCall(TestApp:82) at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381) at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415) at gant.Gant$_dispatch_closure7.doCall(Gant.groovy) at gant.Gant.withBuildListeners(Gant.groovy:427) at gant.Gant.this$2$withBuildListeners(Gant.groovy) at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source) at gant.Gant.dispatch(Gant.groovy:415) at gant.Gant.this$2$dispatch(Gant.groovy) at gant.Gant.invokeMethod(Gant.groovy) at gant.Gant.executeTargets(Gant.groovy:590)
fix in the BuildConfig.groovy file:

inherits("global") { // uncomment to disable ehcache // excludes 'ehcache' excludes 'serializer' }

git deleting remote branch

deleting a remote branch is rather clunky, but easy:

git push origin :branch

please ensure that you have the colon (:) infront of your branch name to ensure that the branch will deleted.

git memorizing branches

First, you must create your branch locally
git checkout -b your_branch
After that, you can work locally in your branch, when you are ready to share the branch, push it. The next command push the branch to the remote repository origin and tracks it
git push -u origin your_branch
Teammates can reach your branch, by doing:
git fetch
git checkout origin/your_branch
You can continue working in the branch and pushing whenever you want without passing arguments to git push (argumentless git push will push the master to remote master, your_branch local to remote your_branch, etc...)
git push
Teammates can push to your branch by doing commits and then push explicitly
... work ...
git commit
... work ...
git commit
git push origin HEAD:refs/heads/your_branch
Or tracking the branch to avoid the arguments to git push
git checkout --track -b your_branch origin/your_branch
... work ...
git commit
... work ...
git commit
git push
Found at stackoverflow