Error importing classes from external jar in BRMS or BPMS 6.0.0

Solution Verified - Updated -

Issue

  • Having created a rule project in BRMS or BPMS 6.0.0 which uses an external jar as dependent library and importing classes from that jar in rule authoring and JUnit test cases causes the error shown below.
package com.sample;
import org.kie.api.KieServices;
import org.kie.api.runtime.KieContainer;
import org.kie.api.runtime.KieSession;
import com.sample.redhat.Foo;
 .. . 

It fails with exception:

Error at line# 5: Only a type can be imported. com.sample.redhat.Foo resolves to a package

How to fix this issue ?

Environment

  • Red Hat JBoss BRMS (BRMS)
    • 6.0.0
  • Red Hat JBoss BPM Suite (BPMS)
    • 6.0.0

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In