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

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:
 
String extID_ChgUserData = String.valueOfInt(ChgDetail.ChgDetail_ChgCommonUserData[k]@id);

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.

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.

Environment

All

Resolution

To resolve this issue the Legacy lookup should be enabled.
  1. Stop the engines.
  2. 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
  1. Add the property be.engine.id.useLegacy=true in the CDD -> Cluster -> Properties and save.
  2. Rebuild EAR.
  3. Restart the engines.

Additional Information

https://docs.tibco.com/pub/businessevents-enterprise/6.3.0/doc/html/Default.htm#Architects-Guide/Data-Lookup-Strategies.htm?TocPath=Architects%2520Guide%257CStorage%2520and%2520Retrieval%2520of%2520Entity%2520Objects%257C_____1