Grails woes

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Grails woes

grampajohn
Administrator
I have been stuck for at least 12 hours by inability to run integration tests in powertac-common. I'm using the tariff-dev branch, and it's not currently up-to-date at github, but if someone wants to help, I'll happily push my current config. The problem is that the errors I get make no sense, and I have no idea where to look to find clues. Currently, I am trying to run an integration test, in which both the test cases (TariffTests) and the class being tested (Tariff) need access to the TimeService. This is not new code, and two days ago it worked. But yesterday, for some mysterious reason, the Grails dependency-injection scheme decided not to work in the Tariff class. There are no error messages that I can find, except for a NullPointerException where there should be a reference to the TimeService. This is happening AFTER the TimeService has been accessed by TariffTests, and I have not touched TimeService.

There are no compile errors that I can see. I've stared at the code for hours, and made small changes to see if there's some trick I'm missing, but nothing seems to matter.

I have a high tolerance for frustration, or I would not be in this business. But so far, my experience is that Grails is one of the WORST systems I've worked with in terms of producing useful diagnostic output when things go wrong. I've worked with some pretty bad ones over the years. If there was at least some error message I could try to decipher I would have a chance, but when it just does not work, I have no idea what to try.

Any suggestions?

John


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

AW: Grails woes

Daniel Schnurr

Hi John,

 

if you upload your code I will give it a try. (But since I am  busy this weekend, expect no results before Monday)

 

Daniel

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: AW: Grails woes

grampajohn
Administrator
On 02/05/2011 02:14 PM, Daniel Schnurr [via Power TAC Developers] wrote:
> Hi John,
>
> if you upload your code I will give it a try. (But since I am busy this
> weekend, expect no results before Monday)

As usual, when I reach that level of frustration and take a break,
something new often occurs to me. In this case, it was that perhaps the
mechanism of dependency injection is implemented through the constructor
that takes a Map argument. This class has a required argument, and so I
had disabled the constructor that takes a Map and written a constructor
that just takes the required arg. I had tried that earlier, but it did
not work because it's not the whole story. Apparently you cannot
actually USE the injected dependency inside the constructor, even if it
takes a Map. So this class now has an init() method that you have to
call after you create it. You cannot call init() from inside the
constructor - it does not seem to work.

As I said, there were no useful error messages. There should have been
one complaining about missing the Map constructor. Why is this?

Thanks for your offer.

John
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Grails woes - generated documentation

grampajohn
Administrator
In reply to this post by grampajohn
Here's the next problem with grails: the grails doc command does not work. Apparently this is a well-known problem. What I see is that we get, for each package, two copies of each class, but no actual documentation from the class shows up. Even worse, none of the methods are shown. All classes have pretty much exactly the same content, except for the name. Try it. Go to powertac-common and do grails doc. The java classes get documented correctly, but the groovy classes do not. Could someone please look into this and get it fixed? The inability to browse the docs is slowing me down, and will make it much harder to publish our work to a wider audience. How do people use this for professional-quality work?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Grails woes - generated documentation

Carsten Block
Administrator
> Here's the next problem with grails: the grails doc command does not work. Apparently this is a well-known problem. What I see is that we get, for each package, two copies of each class, but no actual documentation from the class shows up. Even worse, none of the methods are shown. All classes have pretty much exactly the same content, except for the name. Try it. Go to powertac-common and do grails doc. The java classes get documented correctly, but the groovy classes do not. Could someone please look into this and get it fixed? The inability to browse the docs is slowing me down, and will make it much harder to publish our work to a wider audience. How do people use this for professional-quality work?

This is an upstream issue and reported at: http://jira.codehaus.org/browse/GRAILS-6605 Let's vote for it to increase likelihood of resolution within the next grails release.
Concerning gapi vs api issue: Afaik gapi contains the superset, i.e. groovy and javadoc. So we can just use that as soon as it is properly working
Concerning online publication of apidocs as html (and not only as packaged zip). Maybe we can use github pages feature (http://pages.github.com) to accomplish this.

Cheers,
Carsten
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Grails woes - generated documentation

grampajohn
Administrator
On 02/08/2011 05:24 AM, Carsten Block [via Power TAC Developers] wrote:

>  > Here's the next problem with grails: the grails doc command does not
> work. Apparently this is a well-known problem. What I see is that we
> get, for each package, two copies of each class, but no actual
> documentation from the class shows up. Even worse, none of the methods
> are shown. All classes have pretty much exactly the same content, except
> for the name. Try it. Go to powertac-common and do grails doc. The java
> classes get documented correctly, but the groovy classes do not. Could
> someone please look into this and get it fixed? The inability to browse
> the docs is slowing me down, and will make it much harder to publish our
> work to a wider audience. How do people use this for
> professional-quality work?
>
> This is an upstream issue and reported at:
> http://jira.codehaus.org/browse/GRAILS-6605 Let's vote for it to
> increase likelihood of resolution within the next grails release.
> Concerning gapi vs api issue: Afaik gapi contains the superset, i.e.
> groovy and javadoc. So we can just use that as soon as it is properly
> working
> Concerning online publication of apidocs as html (and not only as
> packaged zip). Maybe we can use github pages feature
> (http://pages.github.com) to accomplish this.

That jira issue only concerns the duplicates, not the lack of content. I
guess I'll have to create a minimal grails project to demonstrate the
full problem and file a new issue with them.

John
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Grails woes - generated documentation

Carsten Block
Administrator
> That jira issue only concerns the duplicates, not the lack of content. I
> guess I'll have to create a minimal grails project to demonstrate the
> full problem and file a new issue with them.

The comment states that field and method docs are not generated unless classes are in default package (and ours are not - we use org.powertac.xyz). And I think that's exactly our problem. Method and field docs are not generated. But maybe we should open another grails ticket explicitly stating this problem so that it is not only recorded in a comment.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Grails woes - generated documentation

grampajohn
Administrator
I created the ticket - see http://jira.codehaus.org/browse/GRAILS-7234
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Grails woes - generated documentation

grampajohn
Administrator
If you agree with me that generated documentation is important, it might be helpful if you could vote up the jira issue I posted to the grails group.

Thanks.

John
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Grails woes - generated documentation

grampajohn
Administrator
In reply to this post by Carsten Block
Here's another upstream issue that cost me a good 4 hours today: http://jira.codehaus.org/browse/GRAILSPLUGINS-2688. I guess I should not be so quick to assume that the problems I see are my problems. Why do we need that plugin? Can we just ditch it? How many other broken plugins are in there that are causing subtle problems?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Grails woes - generated documentation

ddauer
This plugin is only necessary if the plugin developer wants to release a version into Artifactory. So in general, it can be excluded and only added when a release should happen.(Cp. Step 8 at https://github.com/powertac/powertac-server/wiki/Plugin-development-getting-started).

On Wed, Feb 9, 2011 at 9:39 PM, grampajohn [via Power TAC Developers] <[hidden email]> wrote:
Here's another upstream issue that cost me a good 4 hours today: http://jira.codehaus.org/browse/GRAILSPLUGINS-2688. I guess I should not be so quick to assume that the problems I see are my problems. Why do we need that plugin? Can we just ditch it? How many other broken plugins are in there that are causing subtle problems?


If you reply to this email, your message will be added to the discussion below:
http://power-tac-developers.975333.n3.nabble.com/Grails-woes-tp2433049p2461501.html
To start a new topic under Power TAC Developers, email [hidden email]
To unsubscribe from Power TAC Developers, click here.

Loading...