Bug 1052886 - jcr2vfs: test scenario migration ends with XML parsing exception
Summary: jcr2vfs: test scenario migration ends with XML parsing exception
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss BRMS Platform 6
Classification: Retired
Component: Migration Tool
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ER1
: 6.0.1
Assignee: Neus Miras
QA Contact: Petr Široký
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-01-14 10:15 UTC by Petr Široký
Modified: 2014-08-06 19:56 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-08-06 19:56:51 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
JCR repo that will reproduce the issue. (1.10 MB, application/zip)
2014-01-14 10:17 UTC, Petr Široký
no flags Details

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.


Note You need to log in before you can comment on or make changes to this bug.