Results 1 to 3 of 3

Thread: problem in wiring voldemort into my project

  1. #1
    Join Date
    Oct 2008
    Posts
    7

    Default problem in wiring voldemort into my project

    I'm integrating voldemort into my project. If I instantiate the voldemort factory in a non-spring way, it is working great. however when i wire the factory using spring, i'm getting the error "[org.springframework.beans.factory.support.DefaultL istableBeanFactory]Destroying singletons in org.springframework.beans.factory.support.DefaultL istableBeanFactory...[org.springframework.beans.factory.support.Disposab leBeanAdapter] Invoking destroy() on bean with name 'exporter'.........[org.springframework.jmx.export.MBeanExporter] Unregistering JMX-exposed beans on shutdown". All my singletons are getting destroyed and my voldemort stuff breaks. i don't see any problem in the xml file. I have marked my log at TRACE level. I feel spring should log the error in more meaningful manner so that the users can determine the problem with out pulling too much hair. Here is my application-context-cache.xml where I've configured voldemort.

    Any help would be greatly appreciated.

    Code:
    <?xml version="1.0" encoding="UTF-8" ?>
    
    <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:task="http://www.springframework.org/schema/task"
           xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
        <bean id="storeClientFactory" class="voldemort.client.HttpStoreClientFactory">
    
            <constructor-arg>
                <bean class="voldemort.client.ClientConfig" id="config">
                    <property name="bootstrapUrls" value="http://dlaxd2ec001.devapollogrp.edu:8081"/>
                </bean>
            </constructor-arg>
    
        </bean>
    
    </beans>
    Code:
    package edu.apollogrp.d2ec.cacheLayer;
    
    
    import edu.apollogrp.d2ec.dao.EnrollmentGroupDAO;
    import edu.apollogrp.d2ec.dao.hibernate.exception.PersistenceException;
    import edu.apollogrp.d2ec.util.Preferences;
    import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.beans.factory.annotation.Qualifier;
    import org.springframework.scheduling.annotation.Scheduled;
    import org.springframework.stereotype.Component;
    import org.springframework.stereotype.Service;
    import voldemort.client.*;
    import voldemort.versioning.Versioned;
    
    import java.util.Date;
    import java.util.Map;
    
    
    /**
     * author: Maddy Lakshmanan (mxlakshm)
     * date: Jun 26, 2009 12:53:40 PM
     */
    @Service
        public class RankCacheLogicImpl implements RankCacheLogic {
    
        private static final Log logger = LogFactory.getLog(RankCacheLogicImpl.class);
    
    
    
    
        StoreClient<String, Long> client = null;
    
    
        StoreClientFactory storeClientFactory;
    
    
        public RankCacheLogicImpl() {
    //        String bootstrapUrl = "http://dlaxd2ec001.devapollogrp.edu:8081";
    //        StoreClientFactory storeClientFactory = new HttpStoreClientFactory(new ClientConfig().setBootstrapUrls(bootstrapUrl));
    
            // create a client that executes operations on a single store
    
            client = storeClientFactory.getStoreClient("test");
        }
    
    
        @Autowired
        public void setStoreClientFactory(StoreClientFactory storeClientFactory) {
            this.storeClientFactory = storeClientFactory;
        }
    }
    Last edited by luvfort; May 18th, 2010 at 03:50 PM.

  2. #2
    Join Date
    Mar 2010
    Posts
    7

    Default

    Any resolution luvfort? Please share if so.

  3. #3
    Join Date
    Dec 2008
    Posts
    1

    Default Isnt the problem...

    That you use storeClientFactory in the constructor of RankCacheLogicImpl while the property gets set AFTER the constructor? Guaranteed nullpointer I reckon.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •