Bug 1052886

Summary: jcr2vfs: test scenario migration ends with XML parsing exception
Product: [Retired] JBoss BRMS Platform 6 Reporter: Petr Široký <psiroky>
Component: Migration ToolAssignee: Neus Miras <nmirasch>
Status: CLOSED CURRENTRELEASE QA Contact: Petr Široký <psiroky>
Severity: high Docs Contact:
Priority: high    
Version: 6.0.0CC: atangrin, mbaluch, pzapataf, vigoyal
Target Milestone: ER1Keywords: Regression, TestBlocker
Target Release: 6.0.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Trying to use the migartion tool to migrate a test scenario from a JCR repo to GIT fails on JDK7. Use JDK6 to workaround this issue. Cause: Consequence: Fix: Result:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-06 19:56:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
JCR repo that will reproduce the issue. none

Description Petr Široký 2014-01-14 10:15:45 UTC
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.

Comment 1 Petr Široký 2014-01-14 10:17:31 UTC
Created attachment 849858 [details]
JCR repo that will reproduce the issue.

Comment 2 Petr Široký 2014-01-15 15:19:03 UTC
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

Comment 4 Petr Široký 2014-01-17 15:13:18 UTC
Just retested with CR1 and the issue still persists.

Comment 5 Neus Miras 2014-01-24 15:43:58 UTC
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

Comment 6 Petr Široký 2014-02-19 16:46:41 UTC
Verified fixed in 6.0.1-ER1.