Problem with multiple class initialization on my upgraded 0.6->1.0.1 app

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with multiple class initialization on my upgraded 0.6->1.0.1 app

Pablo Pazos
Hi, I finally have my app working with v1.0.1. I've upgraded it from 0.6.

Now I have this problem:
- I create instances of a "RequestForm" class within the Bootstrap
- When I do: def form = new RequestForm(), I get an infinite loop wich is calling new RequestForm() again and again, but I don't have this in my code.
- With this code I obtain the output pasted below:

(CODE IN BOOTSTRAP)

        println "1"
        ....  // lots of code ...
        println "2"
        ....
        println "3"
        ....
        println "4"
        ....
        println "5"

        for (i in 1..5)
        {
            println "A ==="
           
                def form = new RequestForm()
           
            println "A1 ===" // This is never printed!!!!!!!!!!!!!!!!!
            .....
        }
......

(CODE IN RequestForm)

   public RequestForm() {
      println "   RequestForm() A"
      this.questions  = new FormNodeList(form:this)
      println "   RequestForm() B"
      this.evaluation = new FormNodeList(form:this)
      println "   RequestForm() C"
      this.escalationList = new EscalationList(form:this)
      println "   RequestForm() D"
      this.lastUpdate = new Date()
      println "   RequestForm() E"
   }

(CODE in EscalationList)
    public EscalationList() {
        println "      EscalationList A"
        this.nodes = []
        println "      EscalationList B"
    }

(CODE in FormNodeList)
    public FormNodeList()
    {
        println "      FormNodeList A"
        this.nodes = []
        println "      FormNodeList B"
    }

(OUTPUT)
1
2
3
4
5
A ===
   RequestForm() A
      FormNodeList A
      FormNodeList B
   RequestForm() A
      FormNodeList A
      FormNodeList B
   RequestForm() A
      FormNodeList A
      FormNodeList B
   RequestForm() A
      FormNodeList A
      FormNodeList B
   RequestForm() A
      FormNodeList A
      FormNodeList B
....
(continues forever and never prints "A1")


any ideas?

this is driving me crazy!! :P

thank you!!!

cheers,
Pablo Pazos Gutierrez
www.SimpleWebPortal.net
Reply | Threaded
Open this post in threaded view
|

Re: Problem with multiple class initialization on my upgraded 0.6->1.0.1 app

rainer-2
are u sure u dont call the constructor in the construr?
my first guess was the loop never ends, but if the 3rd line is never printed.. hmmm

i am interested in that... let us know what is the solution...

maybe u could post a simplified version of the evolved classes, so so. sould try it out ;)

Reply | Threaded
Open this post in threaded view
|

Re: Problem with multiple class initialization on my upgraded 0.6->1.0.1 app

Pablo Pazos
HI, I've pasted the contructor code from RequestForm and the contructor code from 2 other clases that are instantiated within RequestForm constructor (see my first post).

The weird thing is that I've this code working ok in my v0.6 app, the problem appears when I upgraded my app to grails 1.0.1.

I don't know what else to try... maybe it's something with the class name??? any other ideas???
I'll touch the thing a little and tell you what I get.


cheers,
Pablo Pazos Gutierrez
www.SimpleWebPortal.net

On 2/19/08, rainer <[hidden email]> wrote:

are u sure u dont call the constructor in the construr?
my first guess was the loop never ends, but if the 3rd line is never
printed.. hmmm

i am interested in that... let us know what is the solution...

maybe u could post a simplified version of the evolved classes, so so. sould
try it out ;)


--
View this message in context: http://www.nabble.com/Problem-with-multiple-class-initialization-on-my-upgraded-0.6-%3E1.0.1-app-tp15562402p15564059.html
Sent from the grails - user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: Problem with multiple class initialization on my upgraded 0.6->1.0.1 app

Pablo Pazos
Well I been looking for the error for hours and I reach where is the problem.

It´s in my listaction on my RequestFormController when I do this search by criteria it starts to create instances of RequestForm and never ends, and I have no RequestForm created yet...

def formsWithoutGroup = RequestForm.withCriteria
                                {
                                  isNull('group')
                                }

Do you think it´s something broken with the withCriteria method?

thanks,
Pablo Pazos Gutierrez

pablox wrote
HI, I've pasted the contructor code from RequestForm and the contructor code
from 2 other clases that are instantiated within RequestForm constructor
(see my first post).

The weird thing is that I've this code working ok in my v0.6 app, the
problem appears when I upgraded my app to grails 1.0.1.

I don't know what else to try... maybe it's something with the class name???
any other ideas???
I'll touch the thing a little and tell you what I get.


cheers,
Pablo Pazos Gutierrez
www.SimpleWebPortal.net


On 2/19/08, rainer <RainerBlumenthal@gmx.de> wrote:
>
>
> are u sure u dont call the constructor in the construr?
> my first guess was the loop never ends, but if the 3rd line is never
> printed.. hmmm
>
> i am interested in that... let us know what is the solution...
>
> maybe u could post a simplified version of the evolved classes, so so.
> sould
> try it out ;)
>
>
> --
> View this message in context:
> http://www.nabble.com/Problem-with-multiple-class-initialization-on-my-upgraded-0.6-%3E1.0.1-app-tp15562402p15564059.html
> Sent from the grails - user mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Problem with multiple class initialization on my upgraded 0.6->1.0.1 app

Pablo Pazos
...And the infinite "loop" creating instances of RequestForm when I create ONE instance of it, is still happening...

Later I'll send some code that may help you to help me :)

cheers,
Pablo.

pablox wrote
Well I been looking for the error for hours and I reach where is the problem.

It´s in my listaction on my RequestFormController when I do this search by criteria it starts to create instances of RequestForm and never ends, and I have no RequestForm created yet...

def formsWithoutGroup = RequestForm.withCriteria
                                {
                                  isNull('group')
                                }

Do you think it´s something broken with the withCriteria method?

thanks,
Pablo Pazos Gutierrez

pablox wrote
HI, I've pasted the contructor code from RequestForm and the contructor code
from 2 other clases that are instantiated within RequestForm constructor
(see my first post).

The weird thing is that I've this code working ok in my v0.6 app, the
problem appears when I upgraded my app to grails 1.0.1.

I don't know what else to try... maybe it's something with the class name???
any other ideas???
I'll touch the thing a little and tell you what I get.


cheers,
Pablo Pazos Gutierrez
www.SimpleWebPortal.net


On 2/19/08, rainer <RainerBlumenthal@gmx.de> wrote:
>
>
> are u sure u dont call the constructor in the construr?
> my first guess was the loop never ends, but if the 3rd line is never
> printed.. hmmm
>
> i am interested in that... let us know what is the solution...
>
> maybe u could post a simplified version of the evolved classes, so so.
> sould
> try it out ;)
>
>
> --
> View this message in context:
> http://www.nabble.com/Problem-with-multiple-class-initialization-on-my-upgraded-0.6-%3E1.0.1-app-tp15562402p15564059.html
> Sent from the grails - user mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>
>