| skipped 20 lines |
21 | 21 | | import tigase.conf.ConfigHolder; |
22 | 22 | | import tigase.conf.ConfigReader; |
23 | 23 | | import tigase.db.UserRepository; |
| 24 | + | import tigase.db.comp.ConfigRepository; |
24 | 25 | | import tigase.db.util.SchemaManager; |
25 | 26 | | import tigase.kernel.core.BeanConfig; |
26 | 27 | | import tigase.kernel.core.Kernel; |
| skipped 7 lines |
34 | 35 | | |
35 | 36 | | import java.io.ByteArrayInputStream; |
36 | 37 | | import java.io.IOException; |
| 38 | + | import java.lang.reflect.Field; |
37 | 39 | | import java.nio.charset.StandardCharsets; |
38 | 40 | | import java.nio.file.Files; |
39 | 41 | | import java.nio.file.Path; |
| skipped 126 lines |
166 | 168 | | |
167 | 169 | | private void initialize(CommandlineParameter fileParam, Properties properties) |
168 | 170 | | throws ConfigReader.ConfigException, IOException, ClassNotFoundException, RepositoryException, |
169 | | - | InstantiationException, IllegalAccessException { |
| 171 | + | InstantiationException, IllegalAccessException, NoSuchFieldException { |
170 | 172 | | rootPath = Paths.get(properties.getProperty(fileParam.getFullName().get())); |
171 | 173 | | ConfigHolder holder = new ConfigHolder(); |
172 | 174 | | holder.loadConfiguration(new String[] { ConfigHolder.TDSL_CONFIG_FILE_KEY, |
| skipped 20 lines |
193 | 195 | | vhostRepository.setExtensionManager(new VHostItemExtensionManager()); |
194 | 196 | | vhostRepository.setVhostDefaultValues(new VHostItemDefaults()); |
195 | 197 | | vhostRepository.reload(); |
| 198 | + | // mark vhostRepository as initialized to allow saving items (not enabled autoreload intentionally) |
| 199 | + | Field f = ConfigRepository.class.getDeclaredField("initialized"); |
| 200 | + | f.setAccessible(true); |
| 201 | + | f.set(vhostRepository, true); |
196 | 202 | | |
197 | 203 | | for (RepositoryManagerExtension extension : extensions) { |
198 | 204 | | extension.initialize(kernel, dataSourceHelper, repositoryHolder, rootPath); |
| skipped 45 lines |