-
1. Re: jbpmContext null pointer
newbie007 Jul 18, 2006 10:33 AM (in response to viegas)Hi,
May be userName from request is coming null?
Check the html source of login page to see if that is the name of the
dropdown (user list drop down) or look at the browser address bar to see
if that is parameter passed to server.
Hope that helps.
Thanks. -
2. Re: jbpmContext null pointer
newbie007 Jul 18, 2006 10:37 AM (in response to viegas)Where is "context" defined? I hope it is not another JBPMContext type
variable defined as null.
String userName = req.getParameter("userName");
JbpmContext jbpmContext = JbpmContext.getCurrentJbpmContext();
jbpmContext.setActorId(userName);
context.getRequestDispatcher("/mainPage.jsp").forward(req, resp); -
3. Re: jbpmContext null pointer
viegas Jul 18, 2006 10:47 AM (in response to viegas)"newbie007" wrote:
Where is "context" defined? I hope it is not another JBPMContext type
variable defined as null.
String userName = req.getParameter("userName");
JbpmContext jbpmContext = JbpmContext.getCurrentJbpmContext();
jbpmContext.setActorId(userName);
context.getRequestDispatcher("/mainPage.jsp").forward(req, resp);
Hello, thanks for the reply, first the "username" is not null, I have verified that.
About the context, I am not defining it, I thougt that it would get the context of the server. How can I define it?
thanks. -
4. Re: jbpmContext null pointer
kukeltje Jul 18, 2006 11:03 AM (in response to viegas)use JbpmConfiguration.
-
5. Re: jbpmContext null pointer
hosierdm Jul 18, 2006 11:50 AM (in response to viegas)More specifically, you should basically always do something like this:
JbpmContext jbpmContext = JbpmConfiguration.getInstance().createJbpmContext(); try { // do some stuff using the context } finally { jbpmContext.close(); }
-
6. Re: jbpmContext null pointer
kukeltje Jul 18, 2006 2:10 PM (in response to viegas)but do the JbpmConfiguration.getInstance() as little as possible, since it is SLOW. The jBPM webapp does it once!
creating the context can be done lots of times, since it is FAST. -
7. Re: jbpmContext null pointer
hosierdm Jul 18, 2006 2:25 PM (in response to viegas)Right, I was just trying to simplify the example...sorry. :)
-
8. Re: jbpmContext null pointer
kukeltje Jul 18, 2006 2:29 PM (in response to viegas)No problem... I'm just preventing a 'jBPM is slow' situation ;-)
We've had a guy test jBPM once via the (at that time) realy slow webapp. Wrong, wrong, wrong... but straightening that out was lots of work... proving the core was fast... -
9. Re: jbpmContext null pointer
viegas Jul 19, 2006 5:45 AM (in response to viegas)thanks a lot, the command "JbpmConfiguration.getInstance().createJbpmContext();" as solved the problem, but how do I create the context.
and by the wat, whats the function of the context?? Im a newbie...
THANKS