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(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:79)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.ClassNotFoundException: org.codehaus.groovy.transform.powerassert.ValueRecorder
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 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.