Re: Console app with Tapestry IoC configuration

2011-09-23 Thread nquirynen
Steve Eynon wrote: > > I believe the @Inject is working just fine - you just have to access > the service *after* the class has been constructed! > Yep that was my problem. Thanks for the explanation! -- View this message in context: http://tapestry.1045711.n5.nabble.com/Cons

Re: Console app with Tapestry IoC configuration

2011-09-21 Thread Steve Eynon
Just re-looked at your code - can't believe I missed this the first time round... I believe the @Inject is working just fine - you just have to access the service *after* the class has been constructed! T5 is good, but it can't re-write the JVM! General sequence of events: - T5 instantiates th

Re: Console app with Tapestry IoC configuration

2011-09-21 Thread Thiago H. de Paula Figueiredo
On Wed, 21 Sep 2011 09:35:36 -0300, Chris Poulsen wrote: Hi, Hi! Thanks for the clarification! I was too lazy to read through the IoC docs as its not a code problem of mine we're discussing here. :) :) I think i read that tap IoC worked by constructor injection only; somewhere at so

Re: Console app with Tapestry IoC configuration

2011-09-21 Thread Taha Hafeez
Hi As DocumentGenerator is a class you can use registry.autobuild to create an instance. This will inject the dependencies for you. On Wed, Sep 21, 2011 at 5:34 PM, Martin Strand wrote: > On Wed, 21 Sep 2011 13:19:51 +0200, nquirynen > wrote: > >> if I do >>     registry.getService(PolicyValueP

Re: Console app with Tapestry IoC configuration

2011-09-21 Thread Martin Strand
On Wed, 21 Sep 2011 13:19:51 +0200, nquirynen wrote: if I do registry.getService(PolicyValueProviderSource.class) and pass this as a parameter to my DocumentGenerator's constructor it does work. Is this the way to go then? (my knowledge of Tapestry IoC is very small) Yes, that is t

Re: Console app with Tapestry IoC configuration

2011-09-21 Thread nquirynen
try IoC is very small) Thanks Nathan -- View this message in context: http://tapestry.1045711.n5.nabble.com/Console-app-with-Tapestry-IoC-configuration-tp4822836p4825992.html Sent from the Tapestry - User mailing list archiv

Re: Console app with Tapestry IoC configuration

2011-09-21 Thread Steve Eynon
a* >> >> @Inject >>        private static PolicyValueProviderSource policyValueProvider; >> >>        public DocumentGenerator() { >>                 for(String v : policyValueProvider.getConfiguredFields()) { >>            

Re: Console app with Tapestry IoC configuration

2011-09-21 Thread Chris Poulsen
ate static PolicyValueProviderSource policyValueProvider; > >public DocumentGenerator() { > for(String v : policyValueProvider.getConfiguredFields()) { >System.out.println(v+" : "); >} > } > > >

Re: Console app with Tapestry IoC configuration

2011-09-21 Thread nquirynen
System.out.println(v+" : "); } } But now I always get a NullPointerException on *policyValueProvider* in *DocumentGenerator.* -- View this message in context: http://tapestry.1045711.n5.nabble.com/Console-app-with-Tapestry-IoC-configuration-tp4822836p4825438.html S

Re: Console app with Tapestry IoC configuration

2011-09-20 Thread Steve Eynon
Yep, I always define two modules; one Core Module that defines my database DAOs and other core services and another Web Module which focuses on T5 webby stuff. Steve. -- Steve Eynon --- "If at first you don't succeed,    so much for skydiving!" On 20 September 2011 2

Re: Console app with Tapestry IoC configuration

2011-09-20 Thread Thiago H. de Paula Figueiredo
On Tue, 20 Sep 2011 11:51:56 -0300, nquirynen wrote: Hi, Hi! I'm making an application using Tapestry IoC configuration (contributions). Nice! So in my AppModule I have: *public void contributePolicyValueProviderSource(MappedConfiguration config) { ... }

Re: Console app with Tapestry IoC configuration

2011-09-20 Thread Lenny Primak
nsionarchitects.merge.services.AppModule.contributeRequestHandler(OrderedConfiguration, > RequestFilter) (at AppModule.java:128) is for service 'RequestHandler', > which does not exist./ > > > Anyone an idea what the problem could be here? > If you need specific code, please do

Console app with Tapestry IoC configuration

2011-09-20 Thread nquirynen
stHandler', which does not exist./ Anyone an idea what the problem could be here? If you need specific code, please do ask. Thanks in advance! Nathan -- View this message in context: http://tapestry.1045711.n5.nabble.com/Console-app-with-Tapestry-IoC-configuration-tp4822836p4822836.htm