Friday, June 25, 2010

groovy.lang.MissingMethodException: No signature of method: static .list() is applicable for argument types:

I've started using Grails recently. Its really nice. Productive, easy to get up and running, etc.

My first stab at testing a Controller produced :
groovy.lang.MissingMethodException: No signature of method: static dbtestapp.Team.list() is applicable for argument types:
(org.codehaus.groovy.grails.web.taglib.GroovyPageAttributes) values: [[max:10]]
Possible solutions: is(java.lang.Object), wait(), wait(long), print(java.lang.Object), split(groovy.lang.Closure), use([Ljava.lang.Object;)
at dbtestapp.TeamController$_closure2.doCall
A little weird. list() is a dynamic method and should be on the object.

Its a known issue in the Grails Jira. The solution is to stick the test inside the "integration" package.

Monday, June 14, 2010

Ubuntu slow internet connection

I'm running Ubuntu Karmic Koala on a Dell Latitude D620. I've had a pretty tough time with wireless. Broadcom's support for Linux is terrible.

Yesterday my browsers became ridiculously slow. Running "ping" or "host" from Konsole showed that the problem wasn't networking.

I found a few posts suggesting that I disable IPv6 and reboot. I created a file "/etc/modprobe.d/bad_list", added "alias net-pf-10 off" and rebooted. Much better.

I was on another machine and don't have links to the actual posts from Linux forums and Ubuntu's forums. My apologies to the solution's authors.

Monday, June 7, 2010

java.lang.ClassNotFoundException: org.codehaus.groovy.transform.powerassert.ValueRecorder

Running a GroovyTestCase in a new project I got the following :

java.lang.NoClassDefFoundError: org/codehaus/groovy/transform/powerassert/ValueRecorder
at [My Package Hierarchy].[My TestCase].[My Test Method]([My Test Case].groovy:29)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at junit.framework.TestCase.runTest(
at junit.framework.TestCase.runBare(
at junit.framework.TestResult$1.protect(
at junit.framework.TestResult.runProtected(
at junit.framework.TestSuite.runTest(
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
Caused by: java.lang.ClassNotFoundException: org.codehaus.groovy.transform.powerassert.ValueRecorder
at Method)
at java.lang.ClassLoader.loadClass(
at sun.misc.Launcher$AppClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(
... 20 more
I found a bug that was closed because it couldn't be reproduced in the Groovy Eclipse JIRA.

I had run GroovyTestCases in other projects without this problem.

I right clicked the project and chose "Groovy -> Add Groovy libs to Classpath." That fixed it.

I had added my own Groovy library instead of the plugins. I often point Eclipse Libraries to the jar files in my .m2 directory. The "org.codehaus.groovy.transform.powerassert" package was not part of the Groovy distro. It is part of Groovy Eclipse plugin.

Saturday, June 5, 2010

Another cool NetBeans theme

I really like a dark background in my IDE. I previously mentioned the Aloha theme for NetBeans. I've been using if for a while.

Yesterday I found a version of Twilight for NetBeans. This one is set up for PHP, but works pretty well for Python. It is tweakable of course too.