View Issue Details

IDProjectCategoryView StatusLast Update
0001530SymmetricDSBugpublic2024-11-20 18:35
Reporterboris_pavlovic Assigned To 
Priorityhigh 
Status feedbackResolutionopen 
Product Version3.5.13 
Summary0001530: symadmin create-war doesn't put the symmetric-extension.xml under /WEB-INF/classes/conf
Descriptiontherefore any added extensions enumerated in symmetric-extension.xml do not get loaded by spring at the application startup
Steps To Reproducecreate an extension, add it to the symmetric-extension.xml and verify that the extension is not loaded
Tagssymadmin

Activities

boris_pavlovic

2014-01-17 08:52

reporter  

bug_fix_for_http___www_symmetricds_org_issues_view_php_id=1530.patch (1,722 bytes)   
Index: symmetric-client/src/main/java/org/jumpmind/symmetric/SymmetricAdmin.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- symmetric-client/src/main/java/org/jumpmind/symmetric/SymmetricAdmin.java	(revision 7859)
+++ symmetric-client/src/main/java/org/jumpmind/symmetric/SymmetricAdmin.java	(revision )
@@ -246,7 +246,7 @@
             exportDefaultProperties(line, args);
             return true;
         } else if (cmd.equals(CMD_CREATE_WAR)) {
-            generateWar(line, args);
+            generateWar(args);
             return true;
         } else if (cmd.equals(CMD_EXPORT_SYM_TABLES)) {
             exportSymTables(line, args);
@@ -383,12 +383,16 @@
         }
     }
 
-    private void generateWar(CommandLine line, List<String> args) throws Exception {
+    private void generateWar(List<String> args) throws Exception {
         String warFileName = popArg(args, "Filename");
         final File workingDirectory = new File("../.war");
         FileUtils.deleteDirectory(workingDirectory);
         FileUtils.copyDirectory(new File("../web"), workingDirectory);
         FileUtils.copyDirectory(new File("../conf"), new File(workingDirectory, "WEB-INF/classes"));
+        FileUtils.moveFile(
+            new File(workingDirectory, "WEB-INF/classes/symmetric-extensions.xml"),
+            new File(workingDirectory, "WEB-INF/classes/conf/symmetric-extensions.xml")
+        );
         if (propertiesFile != null && propertiesFile.exists()) {
             FileUtils.copyFile(propertiesFile, new File(workingDirectory,
                     "WEB-INF/classes/symmetric.properties"));

boris_pavlovic

2014-01-17 08:52

reporter   ~0000423

Here's the bug fix.

mdrouard

2024-11-20 18:33

developer   ~0002531

The create war command is meant as a starting point to create a war file. The user usually has to add additional files like the JDBC driver. We may consider a future option for adding files to the war through command line option.

There are 2 workarounds.
1. Set parameter extensions.xml with your spring xml and you put your code into the sym_extension table
2. Build a jar file following the structure outlined in the user guide. - https://symmetricds.sourceforge.net/doc/3.15/html/user-guide.html#_extension_points

Let us know if you are interested in collaborating with us on this issue.

Issue History

Date Modified Username Field Change
2014-01-14 14:35 boris_pavlovic New Issue
2014-01-17 08:52 boris_pavlovic File Added: bug_fix_for_http___www_symmetricds_org_issues_view_php_id=1530.patch
2014-01-17 08:52 boris_pavlovic Note Added: 0000423
2019-04-22 14:24 elong Tag Attached: symadmin
2024-11-20 18:33 mdrouard Note Added: 0002531
2024-11-20 18:35 mdrouard Status new => feedback