You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Patrick Heiden <pa...@gmx.de> on 2008/03/13 20:35:13 UTC

getBeanDefinitionCount() = 0 ??

Hello together!

I have created several beans inside a block. I wonder a little bit, why the call to appCtx.getBeanDefinitionCount() returns 0 ?? I am able to receive those beans via getComponent() and with appCtx.getBean().

appCtx is instance of some implementation of org.springframework.web.context.WebApplicationContext

So where do my bean-definitions and especially my context-definitions end up within 2.2 ?

This result does not change, wether I use jetty for that specific block or for the whole web-app. Also deployment of the final war leaves me with 0.

Best Greetings,
Patrick
-- 
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: getBeanDefinitionCount() = 0 ??

Posted by Patrick Heiden <pa...@gmx.de>.
Hello!

> It's probably due to implementation detail of SSF which creates local bean
> containers for each
> servlet (if I remember correctly) but it does not put anything into this
> local container so it works
> exactly global container.
> 
> I wonder why do you need to know such details just for the start of
> working with Cocoon? Anyway, I'm
> happy to give you answers... ;-)
> 

Well, I always like to know how things work under the hood. If I try to connect my blocks beans it might be usual thought before. And - to be honest - I does not have any sense, where these local containers rest or how it is possible to get beans out of them via getComponent(). So I changed my code a bit, using 'your' WebAppContextUtils-class and now I can see the root-WebAppContext, containing 20 beans for now, all cocoon-framework specific. The main reason for my interesst towards understanding these mechanisms is to be able to configure my blocks beans with sound knowledge in mind - explain what I did, how, when and WHY.

Any further hints would be great help and would keep me a few steps away from head-over source reading.

Best greetings,
Patrick
-- 
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: getBeanDefinitionCount() = 0 ??

Posted by Grzegorz Kossakowski <gr...@tuffmail.com>.
Patrick Heiden pisze:
> Hello together!
> 
> I have created several beans inside a block. I wonder a little bit, why the call to
> appCtx.getBeanDefinitionCount() returns 0 ?? I am able to receive those beans via getComponent()
> and with appCtx.getBean().
> 
> appCtx is instance of some implementation of
> org.springframework.web.context.WebApplicationContext
> 
> So where do my bean-definitions and especially my context-definitions end up within 2.2 ?
> 
> This result does not change, wether I use jetty for that specific block or for the whole web-app.
> Also deployment of the final war leaves me with 0.

It's probably due to implementation detail of SSF which creates local bean containers for each
servlet (if I remember correctly) but it does not put anything into this local container so it works
exactly global container.

I wonder why do you need to know such details just for the start of working with Cocoon? Anyway, I'm
happy to give you answers... ;-)

-- 
Grzegorz Kossakowski

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org