You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Britske <gb...@gmail.com> on 2008/05/18 15:40:41 UTC

getting ClassFactory is matched by 2 services After upgrade from 5.06 -> 5.0.11

After upgrading tapestry from 5.0.6  to 5.0.11 I'm getting the following
error:

Caused by: java.lang.RuntimeException: Service interface
org.apache.tapestry.ioc.services.ClassFactory is matched by 2 services:
ClassFactory, ComponentClassFactory.  Automatic dependency resolution
requires that exactly one service implement the interface.

I'm getting the error (I think), I'm just not sure where to look to change
it. For instance, I have nothing defined in my AppModule that could be the
cause. 

Anyone?

Thanks,
Britske
-- 
View this message in context: http://www.nabble.com/getting-ClassFactory-is-matched-by-2-services-After-upgrade-from-5.06--%3E-5.0.11-tp17303089p17303089.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: getting ClassFactory is matched by 2 services After upgrade from 5.06 -> 5.0.11

Posted by Kristian Marinkovic <kr...@porsche.co.at>.
if you use constructor injection you have to qualify the ClassFactory
with either the full service id or a annotation (marker) it is associated 
with. this applies equally to builder or contribute methods in your 
module.

this is true for any service interface that has multiple implementations
in the registry. 

eg with annotation:

public Foo(@Builtin ClassFactory classFactory, Logger logger){}


or maybe you just have to ensure your jars on the classpath have 
the right version :)


g,
kris




Britske <gb...@gmail.com> 
19.05.2008 18:56
Bitte antworten an
"Tapestry users" <us...@tapestry.apache.org>


An
users@tapestry.apache.org
Kopie

Thema
Re: getting ClassFactory is matched by 2 services After upgrade from 5.06 
-> 5.0.11








I do not quite understand where to put the annotation. I haven't got any 
code
where I'm referencing a classloader explicitly. I must be something 
missing
here?..



Howard Lewis Ship wrote:
> 
> Add the injection point (i.e., the constructor parameter) add either
> the @Builtin or the @ComponentLayer annotation.  This marker
> annotation will select the correct implementation:  either the general
> ClassFactory (used by the IoC container) or the one used when working
> with component code.  You probably want @Builtin.
> 
> On Sun, May 18, 2008 at 6:40 AM, Britske <gb...@gmail.com> wrote:
>>
>> After upgrading tapestry from 5.0.6  to 5.0.11 I'm getting the 
following
>> error:
>>
>> Caused by: java.lang.RuntimeException: Service interface
>> org.apache.tapestry.ioc.services.ClassFactory is matched by 2 services:
>> ClassFactory, ComponentClassFactory.  Automatic dependency resolution
>> requires that exactly one service implement the interface.
>>
>> I'm getting the error (I think), I'm just not sure where to look to
>> change
>> it. For instance, I have nothing defined in my AppModule that could be
>> the
>> cause.
>>
>> Anyone?
>>
>> Thanks,
>> Britske
>> --
>> View this message in context:
>> 
http://www.nabble.com/getting-ClassFactory-is-matched-by-2-services-After-upgrade-from-5.06--%3E-5.0.11-tp17303089p17303089.html

>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
> 
> 
> 
> -- 
> Howard M. Lewis Ship
> 
> Creator Apache Tapestry and Apache HiveMind
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/getting-ClassFactory-is-matched-by-2-services-After-upgrade-from-5.06--%3E-5.0.11-tp17303089p17323208.html

Sent from the Tapestry - User mailing list archive at Nabble.com.


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



Re: getting ClassFactory is matched by 2 services After upgrade from 5.06 -> 5.0.11

Posted by Britske <gb...@gmail.com>.
I do not quite understand where to put the annotation. I haven't got any code
where I'm referencing a classloader explicitly. I must be something missing
here?..



Howard Lewis Ship wrote:
> 
> Add the injection point (i.e., the constructor parameter) add either
> the @Builtin or the @ComponentLayer annotation.  This marker
> annotation will select the correct implementation:  either the general
> ClassFactory (used by the IoC container) or the one used when working
> with component code.  You probably want @Builtin.
> 
> On Sun, May 18, 2008 at 6:40 AM, Britske <gb...@gmail.com> wrote:
>>
>> After upgrading tapestry from 5.0.6  to 5.0.11 I'm getting the following
>> error:
>>
>> Caused by: java.lang.RuntimeException: Service interface
>> org.apache.tapestry.ioc.services.ClassFactory is matched by 2 services:
>> ClassFactory, ComponentClassFactory.  Automatic dependency resolution
>> requires that exactly one service implement the interface.
>>
>> I'm getting the error (I think), I'm just not sure where to look to
>> change
>> it. For instance, I have nothing defined in my AppModule that could be
>> the
>> cause.
>>
>> Anyone?
>>
>> Thanks,
>> Britske
>> --
>> View this message in context:
>> http://www.nabble.com/getting-ClassFactory-is-matched-by-2-services-After-upgrade-from-5.06--%3E-5.0.11-tp17303089p17303089.html
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
> 
> 
> 
> -- 
> Howard M. Lewis Ship
> 
> Creator Apache Tapestry and Apache HiveMind
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/getting-ClassFactory-is-matched-by-2-services-After-upgrade-from-5.06--%3E-5.0.11-tp17303089p17323208.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: getting ClassFactory is matched by 2 services After upgrade from 5.06 -> 5.0.11

Posted by Howard Lewis Ship <hl...@gmail.com>.
Add the injection point (i.e., the constructor parameter) add either
the @Builtin or the @ComponentLayer annotation.  This marker
annotation will select the correct implementation:  either the general
ClassFactory (used by the IoC container) or the one used when working
with component code.  You probably want @Builtin.

On Sun, May 18, 2008 at 6:40 AM, Britske <gb...@gmail.com> wrote:
>
> After upgrading tapestry from 5.0.6  to 5.0.11 I'm getting the following
> error:
>
> Caused by: java.lang.RuntimeException: Service interface
> org.apache.tapestry.ioc.services.ClassFactory is matched by 2 services:
> ClassFactory, ComponentClassFactory.  Automatic dependency resolution
> requires that exactly one service implement the interface.
>
> I'm getting the error (I think), I'm just not sure where to look to change
> it. For instance, I have nothing defined in my AppModule that could be the
> cause.
>
> Anyone?
>
> Thanks,
> Britske
> --
> View this message in context: http://www.nabble.com/getting-ClassFactory-is-matched-by-2-services-After-upgrade-from-5.06--%3E-5.0.11-tp17303089p17303089.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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