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): 6.0.0-DR6 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.
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.
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.
The snapshot dependency has been changed to CR1. Following Petr Siroky explanation this issue has to be solved. The dependency change is in Commit: 6.0.x https://github.com/droolsjbpm/drools-wb/commit/8084dab230b1fe5b8e9663565874845dd1dc3e77
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.
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 Commit 6.0.x https://github.com/droolsjbpm/drools-wb/commit/82cef07ed66cd375833fea989dedc1e879ef669e
This no longer has a target release of 6.0.0.
Verified fixed in 6.0.1-ER1.