[rules-users] KIE Internal M2 Repository Access Denied

marjan.sterjev sterjevm at mt.net.mk
Tue Dec 3 08:09:25 EST 2013


Thank you.

It works now with the security exclusion applied. Let's move on.
The documentation says that KieScanner can scan local and remote
repositories. However I can't get it works.

Consider this simple program that tries to dynamically load rules jar that
is not referenced in the project's pom:

import java.util.Scanner;

import org.kie.api.KieServices;
import org.kie.api.builder.KieScanner;
import org.kie.api.runtime.KieContainer;
import org.kie.api.runtime.StatelessKieSession;

import com.interworks.labs.domain.Employee;

public class TestMyModel {

	public static void main(String[] args) throws Throwable {

		KieServices ks = KieServices.Factory.get();

		KieContainer kContainer = ks.newKieContainer(ks.newReleaseId(
				"com.masterit.labs", "my-rules", "1.0.0"));

		KieScanner kScanner = ks.newKieScanner(kContainer);
		kScanner.start(10000L);

		Scanner scanner = new Scanner(System.in);

		while (true) {
			runRule(kContainer);
			System.out
					.println("Press enter in order to run the test again....");
			scanner.nextLine();
		}

	}

	private static void runRule(KieContainer kieKontainer) {
		StatelessKieSession kSession = kieKontainer
				.newStatelessKieSession("my-session");
		Employee employee = new Employee("John", "Smith", 30);
		kSession.setGlobal("out", System.out);
		kSession.execute(employee);
	}

}

I'm running the program with this command line:

mvn -gs ./settings.xml exec:java -Dexec.mainClass="TestMyModel"
-Dkie.maven.settings.custom=D:/Projects/Java/Drools/my-mod
el-test/settings.xml

Everything is ok when the program starts, the rules artifact is loaded from
the KIE WB and successfully executed. However if I change the rules in the
Guvnor, build and deploy the change is not visible. I must stop the program,
delete the my-rules artifact and restart the program after that.

Any idea?




--
View this message in context: http://drools.46999.n3.nabble.com/KIE-Internal-M2-Repository-Access-Denied-tp4027058p4027067.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list