Project

General

Profile

« Previous | Next » 

Revision 6901

Added by Matt Jones over 12 years ago

Properly initialize the servlet context when starting alternate servlets, which makes sure that the configuration files have been loaded and config properties are available.

View differences:

src/edu/ucsb/nceas/metacat/advancedsearch/AdvancedSearchServlet.java
115 115
		super.init(config);
116 116

  
117 117
		try {
118
			PropertyService.getInstance();
118
		    ServletContext context = config.getServletContext();
119
			PropertyService.getInstance(context);
119 120
		} catch (ServiceException se) {
120 121
			System.err.println("Error in loading properties: " + se.getMessage());
121 122
		} 
src/edu/ucsb/nceas/metacat/harvesterClient/HarvesterRegistration.java
743 743
		dirPath = context.getRealPath(CONFIG_DIR);
744 744

  
745 745
		try {
746
			PropertyService.getInstance();
746
		    ServletContext context = config.getServletContext();
747
			PropertyService.getInstance(context);
747 748

  
748 749
			dbDriver = PropertyService.getProperty("database.driver");
749 750
			defaultDB = PropertyService.getProperty("database.connectionURI");

Also available in: Unified diff