[jboss-user] [Snowdrop] - JBoss 5, Spring 3 Autowiring beans

piobair do-not-reply at jboss.com
Tue May 17 14:31:46 EDT 2011


piobair [http://community.jboss.org/people/piobair] created the discussion

"JBoss 5, Spring 3 Autowiring beans"

To view the discussion, visit: http://community.jboss.org/message/605717#605717

--------------------------------------------------------------
Well, I've looked at all the discussions, docs etc. that I can get my hands on and I'm still having problems getting the beans autowired. I can see the beans being instantiated at deployment time, but they're just not making it into my ServiceBean autowired.

I've tried using both the SpringLifecycleInterceptor.class/@Spring annotations and the SpringBeanAutowiringInterceptor.class/@Autowire methods. No dice.

Here's my configs and annotations.

jboss-spring.xml

<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans"
           xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema-instance"
            xmlns:context=" http://www.springframework.org/schema/context http://www.springframework.org/schema/context"

           xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans
             http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/beans/spring-beans-3.0.xsd           
             http://www.springframework.org/schema/context http://www.springframework.org/schema/context
             http://www.springframework.org/schema/context/spring-context-2.5.xsd http://www.springframework.org/schema/context/spring-context-2.5.xsd">

    <description>BeanFactory=(reportsApp)</description>


    <context:annotation-config/> 

    <bean id="connectionFactoryList" class="com.likewise.lucy.util.riak.RiakConnectionFactory">
         <property name="clients">
             <list>
                 <ref bean="riakClient1"/>
                 <ref bean="riakClient2"/>
             </list>
         </property>
     </bean>

     <bean id="riakClient1" class="com.basho.riak.client.RiakClient">
         <constructor-arg ref="riakConfig1"/>
     </bean>

     <bean id="riakClient2" class="com.basho.riak.client.RiakClient">
         <constructor-arg ref="riakConfig2"/>
     </bean>

     <bean id="riakConfig1" class="com.basho.riak.client.RiakConfig">
             <property name="url" value=" http://10.100.1.119:8091/riak http://10.100.1.119:8091/riak"/>
             <property name="timeout" value="10000"/>
             <property name="maxConnections" value="10"/>
     </bean>

     <bean id="riakConfig2" class="com.basho.riak.client.RiakConfig">
             <property name="url" value=" http://10.100.1.117:8091/riak http://10.100.1.117:8091/riak"/>
             <property name="timeout" value="10000"/>
             <property name="maxConnections" value="10"/>
     </bean>
    <!--  import resource="applicationContext.xml"/ -->
</beans>


and class snippet.

@Service
@Management(RiakEventsForUserMBean.class)

@Interceptors(SpringBeanAutowiringInterceptor.class)
public class RiakEventsForUser implements RiakEventsForUserMBean {
    private boolean started = false;

    @Autowired
    //@Spring(jndiName="reportsApp",bean="connectionFactoryList")
    private RiakConnectionFactory factory;
    // private ApplicationContext ctx;


I'm sure I'm just missing something simple, but can't seem to figure out what.
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/605717#605717]

Start a new discussion in Snowdrop at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2082]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110517/204af512/attachment.html 


More information about the jboss-user mailing list