Description of problem: 'Build & Deploy' of a project will fail if a user defined kbase and/or a ksession is present. Despite that the status dialog will say 'Build Failed' the jar is generated in the repository and the kmodule.xml file has correct content. How reproducible: 100% Steps to Reproduce: 1. Create a new project (e.g. project2) 2. Switch to 'Knowledge bases and sessions' in the 'project editor' 3. Add a new kbase (e.g. kbase1 - optionally make it default) 4. Add a new ksession (e.g. ksession1 - optionally make it default) 5. Save the changes and hit 'Build & Deploy' Actual results: When 'Build & Deploy' is hit the build process will FAIL. Expected results: When 'Build & Deploy' is hit the build process will PASS. Additional info: 'Build & Deploy' will fail also when: 1) only a user defined kbase (kbase is made default) is present with no user defined ksession 2) both user defined kbase and ksession is present - weather the kbase or ksession is made default does not make any difference
Created attachment 847739 [details] screencast Added screencast which shows how to reproduce the issue.
Created attachment 847740 [details] stacktrace1
Created attachment 847741 [details] stacktrace2
Marek, actually this is by design. What fails is the deployment to runtime engine (might be we could try to enhance the message to be more meaningful). As this is auto deploy it expects to have either no kbase/ksessions defined or have both marked as default so it can bootstrap the right ones without additional information. Additional information is kbase name and ksession name that can be provided when deploying kjar using Deployments View. Please also note that for runtime engine only ksession of type statefull is supported. I believe you used stateless and that's why it still was not possible to be deployed even when marked as default.
Maciej, many thanks for the detailed explanation. I have only one question. Should 'Build&Deploy' be enabled when the deployment cannot succeed? This is very confusing and I can imagine that customers will do the same mistake I did. @MB
Maciej, Should the error message be changed to make it clear?
Created attachment 848124 [details] kmodule with default kbase and default stateful session I get NPE when building project with this kmodule (edited using Project Editor in the workbench). I think it complies with requirements in comment 4 - there is all the information needed to bootstrap a session during auto deploy. Tested with BRMS. NPE stack trace will follow.
Created attachment 848125 [details] server.log with NPE
So, the NPE is thrown if kmodule contains kbase with spaces in name. I think I should report it as a separate issue.
(In reply to Marek Baluch from comment #5) > Maciej, > > many thanks for the detailed explanation. > > I have only one question. Should 'Build&Deploy' be enabled when the > deployment cannot succeed? This is very confusing and I can imagine that > customers will do the same mistake I did. > > @MB Certainly it needs to be documented - requirements for auto deploy. Disabling the button might be too much as then users won't be able to build and deploy to maven at all. While sometimes that is desired. We plan to include some sort of deployment descriptors that might be a solution for this so users could specify what should be used when deploying. Would that be sufficient?
(In reply to Edson Tirelli from comment #6) > Maciej, > > Should the error message be changed to make it clear? Edson, I believe detailed error message is shown in problems panel so changing the "flyover" message not sure will bring any additional value. As mentioned in comment 10 it should be documented what is actually needed for auto deploy to runtime.
(In reply to Jiri Locker from comment #9) > So, the NPE is thrown if kmodule contains kbase with spaces in name. I think > I should report it as a separate issue. better to have it as separate issue as based on stack trace it fails on actual build of the project and not deploy to runtime.
The NPE is unrelated to this issue and reported as bug 1051469.
(In reply to Maciej Swiderski from comment #10) > (In reply to Marek Baluch from comment #5) > > Maciej, > > > > many thanks for the detailed explanation. > > > > I have only one question. Should 'Build&Deploy' be enabled when the > > deployment cannot succeed? This is very confusing and I can imagine that > > customers will do the same mistake I did. > > > > @MB > Certainly it needs to be documented - requirements for auto deploy. > Disabling the button might be too much as then users won't be able to build > and deploy to maven at all. While sometimes that is desired. > We plan to include some sort of deployment descriptors that might be a > solution for this so users could specify what should be used when deploying. > Would that be sufficient? Yes I believe that would work.
thanks Marek, just for reference (and possible ideas on how it should look like) link to deployment descriptor bz: https://bugzilla.redhat.com/show_bug.cgi?id=1017327
you're reading my mind! that's what I was going to ask next :D. weather you have specifics about the deployment descriptor. thanks.
Should we close this off as won't fix and rather document the requirements related to defining kbases and ksessions to allow auto-deployment?
Give me one more day please. There may be more to this issue. Based on my latest attempts it seems that if deployed using the described way an error window will keep popping up with message: null. I would like to confirm or refute.
Nvermind - I'm unable to reproduce the issue I saw anymore.
Marek, so can we close this one?
yes we can. thanks!