Project

General

Profile

« Previous | Next » 

Revision 9adce06e

Added by Andreas Kohlbecker over 9 years ago

skipping dataSourceProperties during bean loading

View differences:

src/main/java/eu/etaxonomy/cdm/server/DataSourcePropertyParser.java
35 35
 */
36 36
public class DataSourcePropertyParser {
37 37

  
38
    private static final String DATA_SOURCE_PROPERTIES = "dataSourceProperties";
39 38
    public static final Logger logger = Logger.getLogger(DataSourcePropertyParser.class);
40 39

  
41 40
    public static List<CdmInstanceProperties> parseDataSourceConfigs(File datasourcesFile){
......
54 53
                NamedNodeMap namedNodeMap = beanNode.getAttributes();
55 54
                String beanId = namedNodeMap.getNamedItem("id").getNodeValue();
56 55

  
57
                // skip the dataSourceProperties bean
58
                if(beanId.equals(DATA_SOURCE_PROPERTIES)){
59
                    continue;
60
                }
61 56

  
62 57
                conf.setDataSourceName(beanId);
63 58
                // ATTRIBUTE_DATASOURCE_DRIVERCLASS
64
                conf.setDriverClass(getXMLNodeProperty(beanNode, "driverClass"));
59
                String driverClass = getXMLNodeProperty(beanNode, "driverClass");
60

  
61
                if(driverClass == null || driverClass.isEmpty()){
62
                    // not a data source bean
63
                    continue;
64
                }
65

  
66
                conf.setDriverClass(driverClass);
65 67
                conf.setUsername(getXMLNodeProperty(beanNode, "username"));
66 68
                if(conf.getUsername() == null){
67 69
                    conf.setUsername(getXMLNodeProperty(beanNode, "user"));

Also available in: Unified diff