How to integrate KIE Workbench 6.1.0.Final (Drools Guvnor) Project with Java Application

邮差的信 提交于 2019-11-29 15:35:39

Change your eclipse runtime to 6.0 0 and keep the workbench to 6.1.0 final. This should work with your approach 3. However you won’t be able to use KieScanner.

I had the same issue as yours. Working on the 3rd approach you have mentioned, I was able to get it to work finally.

The problem lies in the UrlResource class which was not able to authenticate properly and hence the issue. I replaced the UrlResource with following code snippet:

String userpassword = "username:password";
String url = "http://localhost:8080/drools/maven2/com/org/project/1.0/project-1.0.jar";
httpURLConnection = (HttpURLConnection)new URL(url).openConnection();
String authEnc = new Base64Encoder().encode(userpassword.getBytes());
httpURLConnection.setRequestProperty("Authorization", "Basic "+ authEnc);
is = httpURLConnection.getInputStream();
KieModule kModule = kr.addKieModule(ks.getResources().newInputStreamResource(is));

and used this kModule to get the kContainer and kSession.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!