Description of problem: When the migration tool tries to migrate test scenarios, following exception is thrown and the scenario is not migrated (it is not in the output vfs repository): [Fatal Error] :2:4: The markup in the document following the root element must be well-formed. org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 4; The markup in the document following the root element must be well-formed. at org.apache.xerces.parsers.DOMParser.parse(Unknown Source) at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source) at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:121) at org.drools.workbench.jcr2vfsmigration.migrater.PackageImportHelper.assertPackageImportXML(PackageImportHelper.java:149) at org.drools.workbench.jcr2vfsmigration.migrater.asset.TestScenarioMigrater.migrate(TestScenarioMigrater.java:62) at org.drools.workbench.jcr2vfsmigration.migrater.asset.TestScenarioMigrater$Proxy$_$$_WeldClientProxy.migrate(TestScenarioMigrater$Proxy$_$$_WeldClientProxy.java) at org.drools.workbench.jcr2vfsmigration.migrater.AssetMigrater.migrate(AssetMigrater.java:223) at org.drools.workbench.jcr2vfsmigration.migrater.AssetMigrater.migrateAll(AssetMigrater.java:156) at org.drools.workbench.jcr2vfsmigration.migrater.AssetMigrater$Proxy$_$$_WeldClientProxy.migrateAll(AssetMigrater$Proxy$_$$_WeldClientProxy.java) at org.drools.workbench.jcr2vfsmigration.Jcr2VfsMigrater.migrateAll(Jcr2VfsMigrater.java:91) at org.drools.workbench.jcr2vfsmigration.Jcr2VfsMigrater$Proxy$_$$_WeldClientProxy.migrateAll(Jcr2VfsMigrater$Proxy$_$$_WeldClientProxy.java) at org.drools.workbench.jcr2vfsmigration.Jcr2VfsMigrationApp.migrate(Jcr2VfsMigrationApp.java:64) at org.drools.workbench.jcr2vfsmigration.Jcr2VfsMigrationApp.run(Jcr2VfsMigrationApp.java:52) at org.drools.workbench.jcr2vfsmigration.Jcr2VfsMigrationApp.main(Jcr2VfsMigrationApp.java:37) It seems like the XML file is broken, however the same file was successfully migrated in previous versions of the tool. I am not sure it this is general issue or only product one (e.g. different version of some jar file). I will need to dig deeper to see what is the root cause of this one. Version-Release number of selected component (if applicable): 6.0.0-ER7 Steps to Reproduce: 1. Run migration tool with the attached repo. 2. See the standard output. Actual results: For every test scenario the above mentioned exception is thrown. Expected results: No exception, the migration ends with success.
Created attachment 849858 [details] JCR repo that will reproduce the issue.
I just noticed that the exception is thrown only when using JDK7 (OpenJDK or OracleJDK). When using JDK6 the migration seems to end successfully (at least no exception is thrown, need to check the migrated content too). JDK versions tested: OracleJDK version "1.7.0_51" -- FAILS OpenJDK version "1.7.0_45" -- FAILS OracleJDK version "1.6.0_35" -- WORKS
Just retested with CR1 and the issue still persists.
It was related with the Transformer class that at java version 1.6 adds '\n' after the xml header and at java version 1.7 no. The problem has been fixed changing the way to remove the generated xml header. Commit: 6.0.x https://github.com/droolsjbpm/drools-wb/commit/2e512c2cc9a1825007aac91397913dca6b0c5a90
Verified fixed in 6.0.1-ER1.