public static void main(String[] args) {
    	try {
	        if (args == null || args.length < 1 || args[0] == null) {
	        	
	            // If no arguments passed we exit. We need 1 parameter
	            // containing the path of the configuration file
	            System.out.println(ERROR_NO_CONF);
	            return;
	        }
	
	        // Read configuration file
	        File configFile = new File(args[0]);
	        Properties params = new Properties();
	        try {
	            params.load(new FileInputStream(configFile));
	
	        } catch (FileNotFoundException e) {
	            System.out.println(ERROR_NO_CONF);
	            return;
	        
	        } catch (IOException e) {
	            System.out.println(ERROR_NO_CONF);
	            return;
	        }
	
	        // Configure a log4j logger
	        String logConf= getParam(params,"logConf", true, null);
	        if (logConf != null) {
	            try {
	                DOMConfigurator.configureAndWatch(logConf, 10000);
	                __log = Logger.getLogger(JmsStockListDemoService.class);
	                
	            } catch (Exception ex) {
	                ex.printStackTrace();
	                System.out.println(ex.getMessage());
	                throw new IllegalStateException(ERROR_LOG_CONF);
	            }
	
	        } else {
	            System.out.println(ERROR_LOG_CONF);
	            throw new IllegalStateException(ERROR_LOG_CONF);
	        }
	
	        __log.info("StockList Demo service starting. Loading configuration...");
	        
	        // Read parameters
	        String jmsUrl= getParam(params, "jmsUrl", true, null);
            String initialContextFactory= getParam(params, "initialContextFactory", true, null);
            String connectionFactory= getParam(params, "connectionFactory", true, null);
            String stocksTopicName= getParam(params, "stocksTopicName", true, null);
            
	        // Create our service passing read parameters
            new StockListService(__log, jmsUrl, initialContextFactory, connectionFactory, stocksTopicName);
	
	        __log.info("StockList Demo service ready.");
	        
	        // Avoid termination
	        Object semaphore= new Object();
	        synchronized (semaphore) {
	        	semaphore.wait();
	        }
	      
    	} catch (Exception e) {
    		if (__log != null)
    			__log.error("Exception caught while starting StockList Demo service: " + e.getMessage(), e);
    		
    		e.printStackTrace();
    	}
    }