You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by Alex Ough <al...@sungard.com> on 2014/04/01 00:54:25 UTC

Re: How to use @Inject

It seems like I wrote a wrong type in ComponentContext.
getComponent(RmapDao.class).
It should be ComponentContext.getComponent(DomainDao.class)

Thanks
Alex Ough


On Mon, Mar 31, 2014 at 5:53 PM, Alex Ough <al...@sungard.com> wrote:

> All,
>
> I'm trying to change "ComponentContext.getComponent(RmapDao.class)" to
> using @Inject, but I can't get the Dao object even after adding a
> configuration file with below information.
>
> <beans xmlns="http://www.springframework.org/schema/beans"
>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>        xmlns:context="http://www.springframework.org/schema/context"
>        xmlns:aop="http://www.springframework.org/schema/aop"
>        xsi:schemaLocation="http://www.springframework.org/schema/beans
>
> http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
>                       http://www.springframework.org/schema/aop
> http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
>                       http://www.springframework.org/schema/context
>
> http://www.springframework.org/schema/context/spring-context-3.0.xsd"
>                       >
>
>     <bean id="domainDaoImpl" class="com.cloud.domain.dao.DomainDaoImpl" />
>     <bean id="accountDaoImpl" class="com.cloud.user.dao.AccountDaoImpl" />
>     <bean id="userDaoImpl" class="com.cloud.user.dao.UserDaoImpl" />
>
> </beans>
>
> Can anyone show me what needs to be fixed?
> Thanks
> Alex Ough
>
>