In Rule Designer a BOM entry may show build errors such as [B2X] Cannot find execution class "TestClass" for translating business class "TestClass" even though it looks like the XOM does have the TestClass defined. What can be the cause of the error?
Answer by odmfd (3407) | Feb 24, 2015 at 06:16 PM
During build/checks Rule Designer may need to load the XOM Java class using reflection API, there can be several reasons for that to fail:
the Java class may have been compiled with a compliance level that is higher than the JDK running Rule Designer, for example compiling the classes with Java 7 and running Rule Designer with a Java 6 JVM.
the Java class may have dependencies to other classes included in libraries that are not available in the XOM path
the Java class may have some static initializer that fails in the Rule Designer environment ( for example because the static initialization code was written with dependencies to file or network resource that are only available in a properly configured target runtime environment, versus the Rule Designer / Eclipse development environment )
In order to troubleshoot this sort of situation, it can be useful to create a simple Java project in Rule Designer that only has on its classpath the same XOM libraries that make up the XOM of the Rule Project causing issue, and then run the following code:
public class Main {
public static void main(String[] args) throws Exception {
Class.forName("com.mycompany.myxom.MyXomClass");
}
}
Where com.mycompany.myxom.MyXomClass should be replaced with the fully qualified name of a XOM class causing issue. This may lead to a ClassNotFoundException / NoClassDefFoundError / LinkageError message hinting at some class/library dependency issue, or possibly a java.lang.ExceptionInInitializerError pointing to an error occuring during static initializations.
Answer by Mike_MDH (1) | Aug 01, 2016 at 03:47 AM
mousami, I am assuming you do not want to add the class to your XOM. If that's the case, your BOM class is what's referred to as a virtual class. You need to add an "execution name" to the BOM-to-XOM mapping of your class. In the BOM editor, go down to "BOM to XOM Mapping", and enter java.lang.Object in the execution name.