How to fix error: com.tibco.be.parser.codegen.CompilationFailedException: warning: [options] bootstrap class path not set in conjunction with-source 8 error: incompatible types: Id cannot be converted to int
book
Article ID: KB0070360
calendar_today
Updated On:
Products
Versions
TIBCO BusinessEvents Enterprise Edition
6.1.1 and above
Description
The error following is shown when trying to build the EAR file, below is the complete error:
com.tibco.be.parser.codegen.CompilationFailedException: warning: [options] bootstrap class path not set in conjunction with-source 8 path_to_failing_rule: error: incompatible types: Id cannot be converted to int java.lang.String ...
This error is caused by the default Lookup strategy in later 6.x releases. In BE 6.1.1 and above versions by default the lookup strategy is set to New Key base lookup, it uses an object extId that becomes the primary key for an entity, and if extId is not provided, an internal extId is automatically generated for that instance. Also, the object table is not used for store or cache lookups. So, Legacy lookup (by default in BE 6.1.0 and before) is object table based which provides mappings for all entities in the cache/store, then an entity instance can be fetched or loaded into working memory by specifying its Long ID or extId with or without specifying its URI.
If we look at the piece of code throwing the error, there is an object value stored in a string variable as shown below:
As explained, the way lookup versions work is different, so the objects cannot be just converted to String as New Key base lookup doesn't use an object table to map the entities.
Environment
All
Resolution
To resolve this issue the Legacy lookup should be enabled.
Stop the engines.
Verify the next properties are uncommented in studio.tra file as shown below:
# Enable getByUri and getByKeys functions
TIBCO.BE.function.catalog.getbyuri=true
#TIBCO.BE.function.catalog.getbykeys=true
# Uncomment below properties to change to Legacy ID mode
be.engine.id.useLegacy=true
TIBCO.BE.function.catalog.getbykeys=false
Add the property be.engine.id.useLegacy=true in the CDD -> Cluster -> Properties and save.
Rebuild EAR.
Restart the engines.
Issue/Introduction
This article explains the difference between the lookup strategy in the piece of code causing this error and the way to fix it.