Bug 987920 - jcr2vfs CCE due to overlapped classpath resource 'packagebuilder.conf' in drools-compiler
Summary: jcr2vfs CCE due to overlapped classpath resource 'packagebuilder.conf' in dro...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss BRMS Platform 6
Classification: Retired
Component: Migration Tool
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: ER1
: 6.0.1
Assignee: Neus Miras
QA Contact: Petr Široký
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-07-24 12:19 UTC by Petr Široký
Modified: 2014-08-06 19:57 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-08-06 19:57:34 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Petr Široký 2013-07-24 12:19:59 UTC
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.

Comment 1 Petr Široký 2013-07-25 14:37:07 UTC
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 12:09:22 UTC
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 15:17:39 UTC
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

Comment 7 Petr Široký 2014-01-14 11:48:19 UTC
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 17:10:31 UTC
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

Comment 10 Lukáš Petrovický 2014-02-07 16:19:00 UTC
This no longer has a target release of 6.0.0.

Comment 11 Petr Široký 2014-02-19 16:38:50 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.