You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Muhammad Gelbana <m....@gmail.com> on 2012/09/16 18:59:12 UTC
[5.3.5] Manually building tapestry's registry loads only the main module
I'm developing background services for windows and linux using java with
tapestry IoC. This requires having a static method to be called and I use
this snippet to start my tapestry app:
System.out.println("Starting service.");
> RegistryBuilder builder = null;
> try {
> builder = new RegistryBuilder();
> System.out.println("Adding module as builder to tapestry registry.");
> builder.add(TestAgentModule.class);
> // builder.add(CoreModule.class);
> // builder.add(TestAgentCoreModule.class);
> System.out.println("Building tapestry registry.");
> registry = builder.build();
> System.out.println("Starting tapestry registry.");
> registry.performRegistryStartup();
> System.out.println("Tapestry registry started.");
> } catch (Throwable t) {
> System.out.println(t.getMessage());
> t.printStackTrace();
> }
In this environment, If I start my application with the highlighted
statements commented as they are, the commented modules wont start although
they are in the classpath. I get the desired behavior with web applications
but not with this environment ! But If I un-comment these lines, the
modules get injected as expected.
What did I miss here ? Assuming tapestry doesn't support auto-loading when
started in that way, can I stop having to add the manifest attribute "
Tapestry-Module-Classes" since it would be useless then ?
Re: [5.3.5] Manually building tapestry's registry loads only the main module
Posted by Muhammad Gelbana <m....@gmail.com>.
>
> What's the error? Stack trace?
Non tapestry errors. Just errors indicating that symbols couldn't be
resolved but that was because my modules with the symbol providers weren't
loaded.
you need to call the IOCUtilities.**addDefaultModules
Yup, that did the trick. Thank you :)
On Mon, Sep 17, 2012 at 1:57 PM, Thiago H de Paula Figueiredo <
thiagohp@gmail.com> wrote:
> On Sun, 16 Sep 2012 13:59:12 -0300, Muhammad Gelbana <m....@gmail.com>
> wrote:
>
> In this environment, If I start my application with the highlighted
>> statements commented as they are, the commented modules wont start
>> although they are in the classpath.
>>
>
> What's the error? Stack trace?
>
>
> What did I miss here ? Assuming tapestry doesn't support auto-loading
>> when started in that way,
>>
>
> Tapestry-IoC does support auto-loading, but, when creating the Registry
> yourself, you need to call the IOCUtilities.**addDefaultModules(**RegistryBuilder
> builder) method yourself.
>
> --
> Thiago H. de Paula Figueiredo
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.org<us...@tapestry.apache.org>
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
Re: [5.3.5] Manually building tapestry's registry loads only the main
module
Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Sun, 16 Sep 2012 13:59:12 -0300, Muhammad Gelbana <m....@gmail.com>
wrote:
> In this environment, If I start my application with the highlighted
> statements commented as they are, the commented modules wont start
> although they are in the classpath.
What's the error? Stack trace?
> What did I miss here ? Assuming tapestry doesn't support auto-loading
> when started in that way,
Tapestry-IoC does support auto-loading, but, when creating the Registry
yourself, you need to call the
IOCUtilities.addDefaultModules(RegistryBuilder builder) method yourself.
--
Thiago H. de Paula Figueiredo
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org