You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Alex Kotchnev <ak...@gmail.com> on 2012/08/31 14:44:33 UTC

Injecting tapestry5.ioc.Messages ino service

I have a service that needs access to the global message catalog.

In a previous email (
http://tapestry.1045711.n5.nabble.com/component-scope-service-with-injected-messages-td4724993.html),
Howard indicated that Messages can now be injected into the service layer.
However, when I add an ioc.Messages into my service constructor, I get the
message:

ioc.Registry No service implements the interface
org.apache.tapestry5.ioc.Messages.

So, how can I inject Messages into the service layer ?

Cheers,

Alex K

Re: Injecting tapestry5.ioc.Messages ino service

Posted by Dmitry Gusev <dm...@gmail.com>.
Not sure why its volatile here, though :)
But it definitely works without it also.

On Fri, Aug 31, 2012 at 6:02 PM, Dmitry Gusev <dm...@gmail.com>wrote:

> I'm using field injection:
>
>     @Inject
>
>     private volatile Messages messages;
>
> works for me
>
> On Fri, Aug 31, 2012 at 4:44 PM, Alex Kotchnev <ak...@gmail.com> wrote:
>
>> I have a service that needs access to the global message catalog.
>>
>> In a previous email (
>>
>> http://tapestry.1045711.n5.nabble.com/component-scope-service-with-injected-messages-td4724993.html
>> ),
>> Howard indicated that Messages can now be injected into the service layer.
>> However, when I add an ioc.Messages into my service constructor, I get the
>> message:
>>
>> ioc.Registry No service implements the interface
>> org.apache.tapestry5.ioc.Messages.
>>
>> So, how can I inject Messages into the service layer ?
>>
>> Cheers,
>>
>> Alex K
>>
>
>
>
> --
> Dmitry Gusev
>
> AnjLab Team
> http://anjlab.com
>



-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com

Re: Injecting tapestry5.ioc.Messages ino service

Posted by Dmitry Gusev <dm...@gmail.com>.
I'm using field injection:

    @Inject

    private volatile Messages messages;

works for me

On Fri, Aug 31, 2012 at 4:44 PM, Alex Kotchnev <ak...@gmail.com> wrote:

> I have a service that needs access to the global message catalog.
>
> In a previous email (
>
> http://tapestry.1045711.n5.nabble.com/component-scope-service-with-injected-messages-td4724993.html
> ),
> Howard indicated that Messages can now be injected into the service layer.
> However, when I add an ioc.Messages into my service constructor, I get the
> message:
>
> ioc.Registry No service implements the interface
> org.apache.tapestry5.ioc.Messages.
>
> So, how can I inject Messages into the service layer ?
>
> Cheers,
>
> Alex K
>



-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com