NullPointerException while checking in User view

Hi,

I have written a custome create user task.

This task does the following:

1. Create User View

2. Sets values of

global.firstname, global.lastname, global.fullname, global.email

waveset.accountId, waveset.organization

accountInfo.accounts[Lighthouse].accountId

3. Checks in the view

I am getting a NullPointerException while checking in the user view.

The trace log shows the folling message:

<ResultItem type='error' status='error'>

<ResultError throwable='java.lang.NullPointerException'>

<StackTrace>java.lang.NullPointerException

at javax.mail.internet.InternetAddress.parse(InternetAddress.java:562)

at javax.mail.internet.InternetAddress.parse(InternetAddress.java:526)

at com.waveset.notification.EmailNotifier.lookupLocaleFromEmail(EmailNotifier.java :653)

at com.waveset.notification.EmailNotifier.notify(EmailNotifier.java:588)

at com.waveset.provision.WorkflowServices.notify(WorkflowServices.java:4817)

at com.waveset.provision.WorkflowServices.call(WorkflowServices.java:774)

at com.waveset.workflow.WorkflowEngine.callApplication(WorkflowEngine.java:4338)

at com.waveset.workflow.WorkflowEngine.callAction(WorkflowEngine.java:4165)

at com.waveset.workflow.WorkflowEngine.callAction(WorkflowEngine.java:3478)

at com.waveset.workflow.WorkflowEngine.execute(WorkflowEngine.java:3318)

at com.waveset.workflow.WorkflowEngine.makeTransition(WorkflowEngine.java:2837)

at com.waveset.workflow.WorkflowEngine.checkExplicitTransitions(WorkflowEngine.jav a:2728)

at com.waveset.workflow.WorkflowEngine.checkTransitions(WorkflowEngine.java:2514)

at com.waveset.workflow.WorkflowEngine.processSteps(WorkflowEngine.java:1919)

at com.waveset.workflow.WorkflowEngine.walkCases(WorkflowEngine.java:1772)

at com.waveset.workflow.WorkflowEngine.walkCases(WorkflowEngine.java:1680)

at com.waveset.workflow.WorkflowEngine.execute(WorkflowEngine.java:823)

at com.waveset.workflow.WorkflowEngine.execute(WorkflowEngine.java:485)

at com.waveset.workflow.WorkflowExecutor.execute(WorkflowExecutor.java:235)

at com.waveset.task.Scheduler.execute(Scheduler.java:2434)

at com.waveset.task.Scheduler.launchTask(Scheduler.java:1607)

at com.waveset.task.Scheduler.launchTask(Scheduler.java:1286)

at com.waveset.task.TaskManager.launchTask(TaskManager.java:267)

at com.waveset.server.InternalSession.runTask(InternalSession.java:3135)

at com.waveset.server.ViewMaster.runTask(ViewMaster.java:918)

at com.waveset.view.UserViewer.launchCreate(UserViewer.java:2959)

at com.waveset.view.UserViewer.checkinView(UserViewer.java:1243)

at com.waveset.object.ViewMaster.checkinView(ViewMaster.java:722)

at com.waveset.session.WorkflowServices.checkinView(WorkflowServices.java:1314)

at com.waveset.session.WorkflowServices.call(WorkflowServices.java:453)

at com.waveset.workflow.WorkflowEngine.callApplication(WorkflowEngine.java:4338)

at com.waveset.workflow.WorkflowEngine.callAction(WorkflowEngine.java:4165)

at com.waveset.workflow.WorkflowEngine.callAction(ThreadPool.java:684)

at java.lang.Thread.run(Thread.java:595)

....................

</StackTrace>

</ResultError>

</ResultItem>

[3420 byte] By [the-gryphona] at [2007-11-26 14:11:57]
# 1

Hi,

Looking at the stack trace you're calling the WorkflowServices API notify method:

at javax.mail.internet.InternetAddress.parse(InternetAddress.java:562)

at javax.mail.internet.InternetAddress.parse(InternetAddress.java:526)

at com.waveset.notification.EmailNotifier.lookupLocaleFromEmail(EmailNotifier.java :653) at com.waveset.notification.EmailNotifier.notify(EmailNotifier.java:588)

atcom.waveset.provision.WorkflowServices.notify(WorkflowServices.java:4817)

Seems to be an error with the parse method on class javax.mail.internet.InternetAddress is there anything perculiar with the email address that's the target for the notification?

Also check that the EmailTemplate you specified actually exists.

Paul

PaulWalker999a at 2007-7-8 2:00:17 > top of Java-index,Web & Directory Servers,Directory Servers...
# 2
Thanks for the reply. I have not explicitly specified any email template. How can I set the email template?
the-gryphona at 2007-7-8 2:00:17 > top of Java-index,Web & Directory Servers,Directory Servers...
# 3

Here's an example of a working notify call from WorkflowServices, HTH:

<Activity name='Notify' hidden='true'>

<Action application='com.waveset.provision.WorkflowServices'>

<Argument name='op' value='notify'/>

<Argument name='type' value='email'/>

<Argument name='template' value='Generic Email Notification'/>

<Argument name='toAddress'>

<rule name='getNotificationEmailAddress'>

<argument name='accountId' value='$(accountId)'/>

</rule>

</Argument>

<Argument name='subjectText'>

<concat>

<s>Registration Notification for </s>

<ref>user.global.firstname</ref>

<s> </s>

<ref>user.global.lastname</ref>

</concat>

</Argument>

<Argument name='headerText'>

<concat>

<s>Welcome, </s>

<ref>user.global.firstname</ref>

<s>!</s>

</concat>

</Argument>

<Argument name='bodyText'>

<concat>

<s>Your account has been created.<br><br></s>

</concat>

</Argument>

</Action>

<Transition to='end'/>

</Activity>

PaulWalker999a at 2007-7-8 2:00:17 > top of Java-index,Web & Directory Servers,Directory Servers...
# 4

Thanks Paul, but how do I associate an Email template with Checkin View workflow service?

I am using two workflow services the first one is 'CreateView' and the second one is 'Checkin View'.

I set the values of user attributes after creating the view but, when the checkin view workflow is called, I get a NullPointerException. As you pointed out, it could be a problem with the emailtemplate.

I just cant figur out where to set the emailtemplate in this process.

the-gryphona at 2007-7-8 2:00:17 > top of Java-index,Web & Directory Servers,Directory Servers...
# 5

You're creating a new user right by creating a user view and then checking that view in, so you're calling the CreateUser process workflow. I would use the Workflow debugger to watch the process execution in particular the notify subprocess, set a breakpoint on the LighthouseApprovals subprocess as well the provisioning Activity to see which notification is causing the error. Step through the execution until you see the Notify subprocess get evaluated then watch the variables to check for the to and template values. Remember that approvals can cause an email notification to be sent as well as when the account is created.

HTH,

Paul

PaulWalker999a at 2007-7-8 2:00:17 > top of Java-index,Web & Directory Servers,Directory Servers...