Hello,
I am having the following problem in my CAF Application.
The user searches for a task and when it clicks on the task it goes to the details page.
On the details page and in the logs the following error appears:
"2013-11-27 14:56:17 CET (jsf:INFO) [RID:235075] - [POP.017.0017] Task ID is not valid null: [POP.017.0017] Task ID is not valid null" (example from logs)
The error does not come from our code and it has no stacktrace.
Also, the details page is filled with task data, so the problem does not happen on the initialisation.
Do you know what can trigger this problem?
Have you encountered it before?
Thank you for your ideas.
Coming with a followup:
After checking the application logs I found the stacktrace I was looking:
com.webmethods.caf.faces.data.ContentProviderException: com.webmethods.portal.PortalException: [POP.017.0017] Task ID is not valid null
at com.webmethods.caf.faces.data.task.impl.AbstractTaskContentProvider.applyChanges(AbstractTaskContentProvider.java:346)
at com.uniqagroup.rewf.taskclient.GenericTask.setPoststueckInUse(GenericTask.java:263)
at com.uniqagroup.rewf.acceptinvoiceview.AcceptInvoiceViewDefaultviewView.initialize(AcceptInvoiceViewDefaultviewView.java:337)
at com.webmethods.caf.faces.bean.BasePortletPageBean.callInitialize(BasePortletPageBean.java:181)
at com.webmethods.caf.faces.bean.BaseViewBean.beforePhase(BaseViewBean.java:84)
at com.webmethods.caf.faces.bean.FacesBeanPhaseListener.beforePhase(FacesBeanPhaseListener.java:30)
at com.webmethods.caf.faces.portlet.PortletLifecycle.phase(PortletLifecycle.java:255)
at com.webmethods.caf.faces.portlet.PortletLifecycle.render(PortletLifecycle.java:190)
at com.webmethods.caf.faces.portlet.FacesPortlet.render(FacesPortlet.java:398)
at com.webmethods.portal.framework.portletcontainer.impl.PortletApplicationHandler.process(PortletApplicationHandler.java:495)
at com.webmethods.portal.framework.portletcontainer.servlet.PortletServlet.service(PortletServlet.java:58)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
at org.mortbay.jetty.servlet.Dispatcher.include(Dispatcher.java:192)
at com.webmethods.portal.framework.portletcontainer.PortletContainer.dispatch(PortletContainer.java:221)
at com.webmethods.portal.framework.portletcontainer.PortletContainer.process(PortletContainer.java:130)
at com.webmethods.portal.framework.portletcontainer.PortletContainer.renderPortlet(PortletContainer.java:103)
at com.webmethods.portal.framework.portletcontainer.beans.PortletBean.processRequest(PortletBean.java:193)
at com.webmethods.portal.framework.portletcontainer.beans.PortletBean.getContentInternal(PortletBean.java:82)
at com.webmethods.portal.framework.portlet.beans.BasicPortletBean.getContent(BasicPortletBean.java:151)
at com.webmethods.portal.mech.portlet.impl.PortletMechanics.getPortletContent(PortletMechanics.java:96)
at com.webmethods.portal.mech.storage.page.PortletHelper.renderContent(PortletHelper.java:428)
at com.webmethods.portal.mech.storage.page.PortletHelper.renderContent(PortletHelper.java:400)
at com.webmethods.portal.framework.presentation.renderers.DefaultRenderer.renderPageContent(DefaultRenderer.java:316)
at com.webmethods.portal.framework.presentation.renderers.DefaultRenderer.render(DefaultRenderer.java:227)
at com.webmethods.portal.framework.presentation.PresentationManager.handlePres(PresentationManager.java:389)
at com.webmethods.portal.framework.dispatch.DispatchManager.pres(DispatchManager.java:640)
at com.webmethods.portal.framework.dispatch.DispatchManager.handle(DispatchManager.java:470)
at com.webmethods.portal.framework.dispatch.DispatchManager.handleDispatch(DispatchManager.java:381)
at com.webmethods.portal.framework.impl.PortalServlet.service(PortalServlet.java:300)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
at com.webmethods.portal.framework.impl.NTLMV1Filter.doFilter(NTLMV1Filter.java:50)
at com.webmethods.portal.framework.impl.NTLMFilter.doFilter(NTLMFilter.java:28)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.webmethods.caf.faces.servlet.GZIPFilter.doFilter(GZIPFilter.java:43)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.webmethods.portal.framework.impl.RequestFilter.doFilter(RequestFilter.java:56)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:451)
Caused by: com.webmethods.portal.PortalException: [POP.017.0017] Task ID is not valid null
at com.webmethods.portal.bizPolicy.biz.task.impl.TaskServiceProvider.getURI(TaskServiceProvider.java:666)
at com.webmethods.portal.bizPolicy.biz.task.impl.TaskServiceProvider.updateTask(TaskServiceProvider.java:473)
at com.webmethods.caf.faces.data.task.impl.AbstractTaskContentProvider.applyChanges(AbstractTaskContentProvider.java:317)
... 60 more
When checking the code I have found the following:
public String initialize() {
try {
boolean inUse = getAcceptInvoice().isTaskInUse(getAcceptInvoice().getTaskID());
getAcceptInvoice().setCurrentTaskId(getAcceptInvoice().getTaskID());
if (inUse) {
ReWFPageBeanHelper.addTaskInUseMessage(getAcceptInvoice().getTaskData().getMailboxData());
} else {
getAcceptInvoice().setPoststueckInUse(getAcceptInvoice().getTaskID());
// check if the logged in user uses or not the Webclient
if (!getOpenDmsWebClient()) {
// ShowDocument only if Task was selected by TaskID on ResultPortlet
if ("true".equalsIgnoreCase(getAcceptInvoiceView().getBlnTaskIDSelected())) {
ServiceResponseBase response = getAcceptInvoice().showDocument(getAcceptInvoiceView().getTaskID(),
ContextUtils.getFacesContext().getExternalContext().getRemoteUser());
ReWFPageBeanHelper.processServiceResponse(response, MessageConstants.INFO_SHOWDOCUMENT_SUCCESS,
new String[] { getInvoiceID() });
}
}
}
setMailboxData(getAcceptInvoice().getMailboxData());
return OUTCOME_OK;
} catch (Exception e) {
return OUTCOME_ERROR;
}
}
The problem appears at the point:
getAcceptInvoice().setPoststueckInUse(getAcceptInvoice().getTaskID());
where I believe that getAcceptInvoice().getTaskID() is null
the setPoststueckInUse method looks like:
public void setPoststueckInUse(String aTaskID) throws Exception {
long startTime = System.currentTimeMillis();
if (aTaskID != null) {
this.setTaskID(aTaskID);
refresh();
}
// only set "In Use" flag, if task is not completed
if (!ITaskInfo.STATUS_COMPLETED.equalsIgnoreCase(this.getTaskInfo().getStatus())) {
String currentUser = (String) resolveExpression("#{facesContext.externalContext.remoteUser}");
this.getMailboxData().getMailboxDetails().setInUseUser(currentUser);
this.getMailboxData().getMailboxDetails().setInUseTimestamp(new Date());
this.applyChanges();
}
ReWFChartLogger.info("generic_task_set_poststueck_in_use", ApplicationUtil.getCurrentUserId(),
System.currentTimeMillis() - startTime);
}
The problem here is:
Has anyone any idea why getAcceptInvoice().getTaskID() would be null?
AcceptInvoice is the name of the class that inherits from TaskContentProvider.
Also what is the difference between getting the task id like in the above sample, or by means of (as a preference):
*/
public String getTaskID() throws Exception {
return (String) getPreferenceValue("taskID", String.class);
}
Which is more reliable?
Thank you.
I have modified the initialize method code to look like this:
public String initialize() {
try {
long startTime = System.currentTimeMillis();
String taskID = getAcceptInvoice().getTaskID();
if (taskID == null){
taskID = getAcceptInvoiceView().getTaskID();
}
boolean inUse = getAcceptInvoice().isTaskInUse(taskID);
getAcceptInvoice().setCurrentTaskId(taskID);
if (inUse) {
ReWFPageBeanHelper.addTaskInUseMessage(getAcceptInvoice().getTaskData().getMailboxData());
} else {
getAcceptInvoice().setPoststueckInUse(taskID);
//other code here
}
return OUTCOME_OK;
} catch (Exception e) {
return OUTCOME_ERROR;
}
}
This way if the result of getAcceptInvoice().getTaskID() is null, I will use the result of getAcceptInvoiceView().getTaskID().
But it does not matter. The problem still reproduces.
Stacktrace below:
com.webmethods.caf.faces.data.ContentProviderException: com.webmethods.portal.PortalException: [POP.017.0017] Task ID is not valid null
at com.webmethods.caf.faces.data.task.impl.AbstractTaskContentProvider.applyChanges(AbstractTaskContentProvider.java:346)
at com.uniqagroup.rewf.taskclient.GenericTask.setPoststueckInUse(GenericTask.java:296)
at com.uniqagroup.rewf.acceptinvoiceview.AcceptInvoiceViewDefaultviewView.initialize(AcceptInvoiceViewDefaultviewView.java:340)
at com.webmethods.caf.faces.bean.BasePortletPageBean.callInitialize(BasePortletPageBean.java:181)
at com.webmethods.caf.faces.bean.BaseViewBean.beforePhase(BaseViewBean.java:84)
at com.webmethods.caf.faces.bean.FacesBeanPhaseListener.beforePhase(FacesBeanPhaseListener.java:30)
at com.webmethods.caf.faces.portlet.PortletLifecycle.phase(PortletLifecycle.java:255)
at com.webmethods.caf.faces.portlet.PortletLifecycle.render(PortletLifecycle.java:190)
at com.webmethods.caf.faces.portlet.FacesPortlet.render(FacesPortlet.java:398)
at com.webmethods.portal.framework.portletcontainer.impl.PortletApplicationHandler.process(PortletApplicationHandler.java:495)
at com.webmethods.portal.framework.portletcontainer.servlet.PortletServlet.service(PortletServlet.java:58)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
at org.mortbay.jetty.servlet.Dispatcher.include(Dispatcher.java:192)
at com.webmethods.portal.framework.portletcontainer.PortletContainer.dispatch(PortletContainer.java:221)
at com.webmethods.portal.framework.portletcontainer.PortletContainer.process(PortletContainer.java:130)
at com.webmethods.portal.framework.portletcontainer.PortletContainer.renderPortlet(PortletContainer.java:103)
at com.webmethods.portal.framework.portletcontainer.beans.PortletBean.processRequest(PortletBean.java:193)
at com.webmethods.portal.framework.portletcontainer.beans.PortletBean.getContentInternal(PortletBean.java:82)
at com.webmethods.portal.framework.portlet.beans.BasicPortletBean.getContent(BasicPortletBean.java:151)
at com.webmethods.portal.mech.portlet.impl.PortletMechanics.getPortletContent(PortletMechanics.java:96)
at com.webmethods.portal.mech.storage.page.PortletHelper.renderContent(PortletHelper.java:428)
at com.webmethods.portal.mech.storage.page.PortletHelper.renderContent(PortletHelper.java:400)
at com.webmethods.portal.framework.presentation.renderers.DefaultRenderer.renderPageContent(DefaultRenderer.java:316)
at com.webmethods.portal.framework.presentation.renderers.DefaultRenderer.render(DefaultRenderer.java:227)
at com.webmethods.portal.framework.presentation.PresentationManager.handlePres(PresentationManager.java:389)
at com.webmethods.portal.framework.dispatch.DispatchManager.pres(DispatchManager.java:640)
at com.webmethods.portal.framework.dispatch.DispatchManager.handle(DispatchManager.java:470)
at com.webmethods.portal.framework.dispatch.DispatchManager.handleDispatch(DispatchManager.java:381)
at com.webmethods.portal.framework.impl.PortalServlet.service(PortalServlet.java:300)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
at com.webmethods.portal.framework.impl.NTLMV1Filter.doFilter(NTLMV1Filter.java:50)
at com.webmethods.portal.framework.impl.NTLMFilter.doFilter(NTLMFilter.java:28)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.webmethods.caf.faces.servlet.GZIPFilter.doFilter(GZIPFilter.java:43)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.webmethods.portal.framework.impl.RequestFilter.doFilter(RequestFilter.java:56)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:451)
Caused by: com.webmethods.portal.PortalException: [POP.017.0017] Task ID is not valid null
at com.webmethods.portal.bizPolicy.biz.task.impl.TaskServiceProvider.getURI(TaskServiceProvider.java:666)
at com.webmethods.portal.bizPolicy.biz.task.impl.TaskServiceProvider.updateTask(TaskServiceProvider.java:473)
at com.webmethods.caf.faces.data.task.impl.AbstractTaskContentProvider.applyChanges(AbstractTaskContentProvider.java:317)
... 60 more
I am especially interested in the line:
at com.webmethods.portal.bizPolicy.biz.task.impl.TaskServiceProvider.getURI(TaskServiceProvider.java:666)
.
Is it something wrong with the URL, or why is the error thrown at this point?
Did no one faced similar problems?
Thank you.
The code of getURI is:
public static IURI getURI(String id) throws PortalException
{
IURI uri = null;
try {
if ((id != null) && (id.length() > 0) && (Character.isDigit(id.charAt(0)))) {
int dbID = Integer.parseInt(id);
uri = ((IMetaManager)PortalSystem.getMetaProvider()).getDefaultContext().getThingIDService().convertToCurrentFormat(dbID);
if (uri != null) return uri;
}
}
catch (NumberFormatException e)
{
}
uri = PortalSystem.getPortalSystem().acquireURI(id);
if (uri == null) {
throw new PortalException(TaskUi.class, "POP.017.0017", new Object[] { id });
}
return uri;
}
So the arg id is null and this method is ok, then I take a look at the execute chain.
TaskServiceProvider.updateTask - arg taskInfo, taskInfo.getTaskID = arg id in getURI
AbstractTaskContentProvider.applyChanges - this.m_currentTaskInfo = arg taskInfo in updateTask
I want to know your 60 more to find out where is the final problem