Bug 987920 - jcr2vfs CCE due to overlapped classpath resource 'packagebuilder.conf' in drools-compiler
jcr2vfs CCE due to overlapped classpath resource 'packagebuilder.conf' in dro...
Product: JBoss BRMS Platform 6
Classification: JBoss
Component: Migration Tool (Show other bugs)
Unspecified Unspecified
medium Severity high
: ER1
: 6.0.1
Assigned To: Neus Miras
Petr Široký
Depends On:
  Show dependency treegraph
Reported: 2013-07-24 08:19 EDT by Petr Široký
Modified: 2014-08-06 15:57 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-08-06 15:57:34 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Petr Široký 2013-07-24 08:19:59 EDT
Description of problem:
When running the migration tool in standard way, on some machines the migration ends with CCE: org.drools.compiler.rule.builder.dialect.mvel.lMVELDialectConfiguration cannot be cast to org.drools.compiler.DialectConfiguration.

Unfortunately its not happening on all machines (its classpath order related issue), so it might be very hard to reproduce. However in our environment 2 out of 3 machines experienced the problem.

I suspect its classpath order related issue. The migration tool needs both drool5 and drool6 jars on CP and thus file 'packagebuilder.conf' will end up on classpath twice (its in drools-compiler-6.0.0.Beta5.jar and guvnor-jcr2vfs-migration-droolsjbpm-as-uberjar-5.5.1-20130606.153149-125-jars-as-uberjar.jar). The file contains dialect definitions class names. There are two possible cases:

  1) drools-compiler-6.0.0.Beta5.jar/META-INF/packagebuilder.conf is loaded and because it contains drools6 class names the drools5 PackageBuilderConfiguration won't be able to cast it. And thus the mentioned CCE will be thrown.

  2) guvnor-jcr2vfs-migration-droolsjbpm-as-uberjar-5.5.1-20130606.153149-125-jars-as-uberjar.jar/META-INF/packagebuilder.conf is loaded and everything goes as expected because the drools5 class names will be used.

Removing the drools-compiler-6.0.0.Beta5.jar/META-INF/packagebuilder.conf __seems__ to solve the problem, however it could cause other issues.

Full stacktrace:
Exception in thread "main" org.drools.RuntimeDroolsException: Unable to load dialect 'org.drools.compiler.rule.builder.dialect.mvel.MVELDialectConfiguration:mvel:org.drools.compiler.rule.builder.dialect.mvel.MVELDialectConfiguration'
	at org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:321)
	at org.drools.compiler.PackageBuilderConfiguration.buildDialectConfigurationMap(PackageBuilderConfiguration.java:307)
	at org.drools.compiler.PackageBuilderConfiguration.init(PackageBuilderConfiguration.java:192)
	at org.drools.compiler.PackageBuilderConfiguration.<init>(PackageBuilderConfiguration.java:165)
	at org.drools.guvnor.server.builder.BRMSPackageBuilder.getPackageBuilderConfiguration(BRMSPackageBuilder.java:134)
	at org.drools.guvnor.server.builder.BRMSPackageBuilder.<init>(BRMSPackageBuilder.java:67)
	at org.drools.workbench.jcr2vfsmigration.migrater.asset.GuidedEditorMigrater.migrate(GuidedEditorMigrater.java:96)
	at org.drools.workbench.jcr2vfsmigration.migrater.asset.GuidedEditorMigrater$Proxy$_$$_WeldClientProxy.migrate(GuidedEditorMigrater$Proxy$_$$_WeldClientProxy.java)
	at org.drools.workbench.jcr2vfsmigration.migrater.AssetMigrater.migrate(AssetMigrater.java:159)
	at org.drools.workbench.jcr2vfsmigration.migrater.AssetMigrater.migrateAll(AssetMigrater.java:135)
	at org.drools.workbench.jcr2vfsmigration.migrater.AssetMigrater$Proxy$_$$_WeldClientProxy.migrateAll(AssetMigrater$Proxy$_$$_WeldClientProxy.java)
	at org.drools.workbench.jcr2vfsmigration.Jcr2VfsMigrater.migrateAll(Jcr2VfsMigrater.java:82)
	at org.drools.workbench.jcr2vfsmigration.Jcr2VfsMigrater$Proxy$_$$_WeldClientProxy.migrateAll(Jcr2VfsMigrater$Proxy$_$$_WeldClientProxy.java)
	at org.drools.workbench.jcr2vfsmigration.Jcr2VfsMigrationApp.main(Jcr2VfsMigrationApp.java:36)
Caused by: java.lang.ClassCastException: org.drools.compiler.rule.builder.dialect.mvel.lMVELDialectConfiguration cannot be cast to org.drools.compiler.DialectConfiguration
	at org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:316)
	... 13 more

Version-Release number of selected component (if applicable):

Steps to Reproduce:
1. Just run the migration tool in standard way (however the issue will not be present on all machines).

Actual results:
On some machines the migration tool throws CCE.

Expected results:
The CCE is never thrown.
Comment 1 Petr Široký 2013-07-25 10:37:07 EDT
Sorry for the rushed "TestBlocker". I just realized its not a TestBlocker as it can be workarounded by removing the packagebuilder.conf file from drools-compiler-6*.jar.
Comment 2 Petr Široký 2013-08-20 08:09:22 EDT
This issue should be fixed by proper order of classpath elements in runMigration.sh. I will close it once we get a productized build with non-SNAPSHOT versions of droolsjbpm-uberjar.
Comment 6 Neus Miras 2013-11-22 10:17:39 EST
The snapshot dependency has been changed to CR1. Following  Petr Siroky explanation this issue has to be solved.

The dependency change is in Commit:

Comment 7 Petr Široký 2014-01-14 06:48:19 EST
The runMigration.sh script have a mechanism in place to find the correct version of uberjar as first classpath element, however the runMigration.bat script still contains some snapshot version. See https://github.com/droolsjbpm/drools-wb/blob/6.0.x/drools-wb-jcr2vfs-migration/drools-wb-jcr2vfs-migration-core/src/main/assembly/scripts/bin/runMigration.bat

The snapshot version should be replaced by 5.6.0.CR1 in the Windows bat script.
Comment 9 Neus Miras 2014-01-23 12:10:31 EST
The generation of .bat scritp has been modified to make referebce to guvnor-jcr2vfs-migration-droolsjbpm-as-uberjar-5.6.0.Final-jars-as-uberjar.jar

Comment 10 Lukáš Petrovický 2014-02-07 11:19:00 EST
This no longer has a target release of 6.0.0.
Comment 11 Petr Široký 2014-02-19 11:38:50 EST
Verified fixed in 6.0.1-ER1.

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