How to Catch Exception out of ContentPresenter Taskflow

Design
In one of my usecase, i have a wrapper tasfkflow called MyContentPresenterTF which wraps Webcenter ContentPresenter Taskflow in it and have the same or less properties exposed.
MyContentPresenterTF has MyContentPresentPF.jsff. MyContentPresentPF is designated as both default and exception activity.
MyContentPresenterPF.jsff has some title elements with a dynamic region. The taskflowId for this dynamic region comes from a bean and that points to either ExceptionTF or Webcenter Content presenter Taskflow. ("/oracle/webcenter/doclib/view/jsf/taskflows/presenter/contentPresenter.xml#doclib-content-presenter";)
Issue :
I create a page from Webcenter Administration and click Add Content and Add MyContentPresenterTF from resource catalog. I pass the correct parameters for DataSource.
The page renders the MyContentPresenterTF without issues.
But in cases like, where i edit the page content and pass the incorrect content id or datasource, then we get a popup with ADF FACES error Please specify a valid ID object. Make sure the repository name is not null. After that whatever action i perform on that page, the same error message appears.
I want to handle all unhandled exceptions from Webcenter Taskflows if any of the input parameters are wrong or any runtime exception invoked from it and render some exception view region in the same page with some user read able information with some stack trace without disturbing the rest of the page.
Solutions tried:
To avoid this, i have created a Exception Taskflow with exception page fragment. I have a bean with method getDynamicTaskFlowId which should switch between MyContentPresenterTF and ExceptionTF depending upon the exception. In case of exception, the exception taskflow region should be rendered with some readable error message and the other parts of the page should be working as before. (note i also want to clear the exception from viewport )
But in order to do this, i need to switch the taskflows and clear the exception on Viewport if the exception was caught in the first place. But in this case, i always get the exception object null (ex, exceptionData always null).
public TaskFlowId getDynamicTaskFlowId() {
ControllerContext context =
ControllerContext.getInstance(); //context.getCurrentViewPort()
ViewPortContext currentRootViewPort = context.getCurrentRootViewPort();
ViewPortContext currentViewPort = context.getCurrentViewPort();
Exception ex = currentViewPort.getExceptionData();
Exception exceptionData = currentRootViewPort.getExceptionData();
FacesContext facesContext = FacesContext.getCurrentInstance();
facesContext.getMessages();
// facesContext.getMessages(arg0)
if (currentRootViewPort.isExceptionPresent()) {   //not going inside
exceptionData.printStackTrace();
currentRootViewPort.clearException();
return TaskFlowId.parse(taskFlowIdError);
return TaskFlowId.parse(taskFlowId);
I also tried creating CustomErrorHandler class extending DCErrorHanlder and overriding reportException and registering it in databindings.cpx. But the control is not stopped at reportException in debug mode. As i think, the DCErrorHandler might work only for Model or service Layer exceptons (like JBO and not for ADF Faces).
Whats the best way to go with the problem?
<handleError> ADF_FACES-60096:Server Exception during PPR, #2
javax.servlet.ServletException: oracle.webcenter.content.integration.RepositoryException: 03-Aug-2011 11:40:58 oracle.webcenter.content.integration.federated.internal.ContentValidator validateId
SEVERE: Please specify a valid ID object. Make sure the repository name is not null.
     at weblogic.servlet.jsp.PageContextImpl.handlePageException(PageContextImpl.java:417)
     at oracle.jsp.runtimev2.ShortCutServlet._jspService(ShortCutServlet.java:101)
     at oracle.jsp.runtime.OracleJspBase.service(OracleJspBase.java:29)
     at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:422)
     at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:802)
     at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:726)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
     at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
     at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
     at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
     at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
     at java.security.AccessController.doPrivileged(Native Method)
     at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
     at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
     at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
     at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:161)
     at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:524)
     at weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImpl.java:444)
     at weblogic.servlet.jsp.PageContextImpl.include(PageContextImpl.java:163)
     at weblogic.servlet.jsp.PageContextImpl.include(PageContextImpl.java:184)
     at oracle.adfinternal.view.faces.taglib.region.IncludeTag.__include(IncludeTag.java:440)
     at oracle.adfinternal.view.faces.taglib.region.RegionTag$1.call(RegionTag.java:153)
     at oracle.adfinternal.view.faces.taglib.region.RegionTag$1.call(RegionTag.java:128)
     at oracle.adf.view.rich.component.fragment.UIXRegion.processRegion(UIXRegion.java:503)
     at oracle.adfinternal.view.faces.taglib.region.RegionTag.doStartTag(RegionTag.java:127)
     at oracle.jsp.runtime.tree.OracleJspBodyTagNode.executeHandler(OracleJspBodyTagNode.java:50)
     at oracle.jsp.runtime.tree.OracleJspCustomTagNode.execute(OracleJspCustomTagNode.java:261)
     at oracle.jsp.runtime.tree.OracleJspNode.execute(OracleJspNode.java:89)
     at oracle.jsp.runtimev2.ShortCutServlet._jspService(ShortCutServlet.java:89)
     at oracle.jsp.runtime.OracleJspBase.service(OracleJspBase.java:29)
     at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:422)
     at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:802)
     at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:726)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
     at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
     at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
     at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
     at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
     at java.security.AccessController.doPrivileged(Native Method)
     at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
     at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
     at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
     at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:161)
     at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:524)
     at weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImpl.java:444)
     at weblogic.servlet.jsp.PageContextImpl.include(PageContextImpl.java:163)
     at weblogic.servlet.jsp.PageContextImpl.include(PageContextImpl.java:184)
     at oracle.adfinternal.view.faces.taglib.region.IncludeTag.__include(IncludeTag.java:440)
     at oracle.adfinternal.view.faces.taglib.region.RegionTag$1.call(RegionTag.java:153)
     at oracle.adfinternal.view.faces.taglib.region.RegionTag$1.call(RegionTag.java:128)
     at oracle.adf.view.rich.component.fragment.UIXRegion.processRegion(UIXRegion.java:503)
     at oracle.adfinternal.view.faces.taglib.region.RegionTag.doStartTag(RegionTag.java:127)
     at oracle.jsp.runtime.tree.OracleJspBodyTagNode.executeHandler(OracleJspBodyTagNode.java:50)
     at oracle.jsp.runtime.tree.OracleJspCustomTagNode.execute(OracleJspCustomTagNode.java:261)
     at oracle.jsp.runtime.tree.OracleJspClassicTagNode.evalBody(OracleJspClassicTagNode.java:87)
     at oracle.jsp.runtime.tree.OracleJspBodyTagNode.executeHandler(OracleJspBodyTagNode.java:58)
     at oracle.jsp.runtime.tree.OracleJspCustomTagNode.execute(OracleJspCustomTagNode.java:261)
     at oracle.jsp.runtime.tree.OracleJspClassicTagNode.evalBody(OracleJspClassicTagNode.java:87)
     at oracle.jsp.runtime.tree.OracleJspBodyTagNode.executeHandler(OracleJspBodyTagNode.java:58)
     at oracle.jsp.runtime.tree.OracleJspCustomTagNode.execute(OracleJspCustomTagNode.java:261)
     at oracle.jsp.runtime.tree.OracleJspNode.execute(OracleJspNode.java:89)
     at oracle.jsp.runtime.tree.OracleJspClassicTagNode.evalBody(OracleJspClassicTagNode.java:87)
     at oracle.jsp.runtime.tree.OracleJspBodyTagNode.executeHandler(OracleJspBodyTagNode.java:58)
     at oracle.jsp.runtime.tree.OracleJspCustomTagNode.execute(OracleJspCustomTagNode.java:261)
     at oracle.jsp.runtime.tree.OracleJspClassicTagNode.evalBody(OracleJspClassicTagNode.java:87)
     at oracle.jsp.runtime.tree.OracleJspBodyTagNode.executeHandler(OracleJspBodyTagNode.java:58)
     at oracle.jsp.runtime.tree.OracleJspCustomTagNode.execute(OracleJspCustomTagNode.java:261)
     at oracle.jsp.runtime.tree.OracleJspClassicTagNode.evalBody(OracleJspClassicTagNode.java:87)
     at oracle.jsp.runtime.tree.OracleJspBodyTagNode.executeHandler(OracleJspBodyTagNode.java:58)
     at oracle.jsp.runtime.tree.OracleJspCustomTagNode.execute(OracleJspCustomTagNode.java:261)
     at oracle.jsp.runtime.tree.OracleJspClassicTagNode.evalBody(OracleJspClassicTagNode.java:87)
     at oracle.jsp.runtime.tree.OracleJspIterationTagNode.executeHandler(OracleJspIterationTagNode.java:45)
     at oracle.jsp.runtime.tree.OracleJspCustomTagNode.execute(OracleJspCustomTagNode.java:261)
     at oracle.jsp.runtime.tree.OracleJspClassicTagNode.evalBody(OracleJspClassicTagNode.java:87)
     at oracle.jsp.runtime.tree.OracleJspBodyTagNode.executeHandler(OracleJspBodyTagNode.java:58)
     at oracle.jsp.runtime.tree.OracleJspCustomTagNode.execute(OracleJspCustomTagNode.java:261)
     at oracle.jsp.runtime.tree.OracleJspClassicTagNode.evalBody(OracleJspClassicTagNode.java:87)
     at oracle.jsp.runtime.tree.OracleJspBodyTagNode.executeHandler(OracleJspBodyTagNode.java:58)
     at oracle.jsp.runtime.tree.OracleJspCustomTagNode.execute(OracleJspCustomTagNode.java:261)
     at oracle.jsp.runtime.tree.OracleJspClassicTagNode.evalBody(OracleJspClassicTagNode.java:87)
     at oracle.jsp.runtime.tree.OracleJspBodyTagNode.executeHandler(OracleJspBodyTagNode.java:58)
     at oracle.jsp.runtime.tree.OracleJspCustomTagNode.execute(OracleJspCustomTagNode.java:261)
     at oracle.jsp.runtime.tree.OracleJspClassicTagNode.evalBody(OracleJspClassicTagNode.java:87)
     at oracle.jsp.runtime.tree.OracleJspBodyTagNode.executeHandler(OracleJspBodyTagNode.java:58)
     at oracle.jsp.runtime.tree.OracleJspCustomTagNode.execute(OracleJspCustomTagNode.java:261)
     at oracle.jsp.runtime.tree.OracleJspNode.execute(OracleJspNode.java:89)
     at oracle.jsp.runtimev2.ShortCutServlet._jspService(ShortCutServlet.java:89)
     at oracle.jsp.runtime.OracleJspBase.service(OracleJspBase.java:29)
     at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:422)
     at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:802)
     at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:726)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
     at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
     at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
     at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
     at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:175)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:524)
     at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:253)
     at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:410)
     at org.apache.myfaces.trinidad.context.ExternalContextDecorator.dispatch(ExternalContextDecorator.java:44)
     at org.apache.myfaces.trinidad.context.ExternalContextDecorator.dispatch(ExternalContextDecorator.java:44)
     at oracle.adfinternal.view.faces.config.rich.RecordRequestAttributesDuringDispatch.dispatch(RecordRequestAttributesDuringDispatch.java:44)
     at org.apache.myfaces.trinidad.context.ExternalContextDecorator.dispatch(ExternalContextDecorator.java:44)
     at org.apache.myfaces.trinidad.context.ExternalContextDecorator.dispatch(ExternalContextDecorator.java:44)
     at org.apache.myfaces.trinidad.context.ExternalContextDecorator.dispatch(ExternalContextDecorator.java:44)
     at org.apache.myfaces.trinidadinternal.context.FacesContextFactoryImpl$OverrideDispatch.dispatch(FacesContextFactoryImpl.java:267)
     at com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:469)
     at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:140)
     at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:189)
     at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:193)
     at oracle.webcenter.portalframework.sitestructure.handler.CustomViewHandler.renderView(CustomViewHandler.java:279)
     at com.baesystems.portal.navigation.handler.ApplicationViewHandler.renderView(ApplicationViewHandler.java:71)
     at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._renderResponse(LifecycleImpl.java:777)
     at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:293)
     at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:213)
     at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
     at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
     at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
     at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
     at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at oracle.portlet.client.adapter.adf.ADFPortletFilter.doFilter(ADFPortletFilter.java:32)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at oracle.webcenter.framework.events.dispatcher.EventDispatcherFilter.doFilter(EventDispatcherFilter.java:44)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:205)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:106)
     at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
     at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
     at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
     at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:271)
     at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:177)
     at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at oracle.wcps.client.PersonalizationFilter.doFilter(PersonalizationFilter.java:75)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at oracle.webcenter.content.integration.servlets.ContentServletFilter.doFilter(ContentServletFilter.java:168)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at oracle.webcenter.lifecycle.filter.LifecycleLockFilter.doFilter(LifecycleLockFilter.java:151)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:175)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
     at java.security.AccessController.doPrivileged(Native Method)
     at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
     at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
     at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
     at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:161)
     at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:136)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
     at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
     at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
     at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
     at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
     at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
     at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
     at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
     at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)
Caused by: oracle.webcenter.content.integration.RepositoryException: 03-Aug-2011 11:40:58 oracle.webcenter.content.integration.federated.internal.ContentValidator validateId
SEVERE: Please specify a valid ID object. Make sure the repository name is not null.
     at oracle.webcenter.content.integration.federated.internal.ContentValidator.validateId(ContentValidator.java:49)
     at oracle.webcenter.content.integration.federated.internal.ContentValidator.validateFullId(ContentValidator.java:55)
     at oracle.webcenter.content.integration.federated.internal.NodeManagerImpl.getNodeByUUID(NodeManagerImpl.java:238)
     at oracle.webcenter.content.internal.view.template.ContentTemplateTag.include(ContentTemplateTag.java:275)
     at oracle.webcenter.content.internal.view.template.AbstractTemplateTag.doEndTag(AbstractTemplateTag.java:66)
     at oracle.jsp.runtime.tree.OracleJspBodyTagNode.executeHandler(OracleJspBodyTagNode.java:62)
     at oracle.jsp.runtime.tree.OracleJspCustomTagNode.execute(OracleJspCustomTagNode.java:261)
     at oracle.jsp.runtime.tree.OracleJspClassicTagNode.evalBody(OracleJspClassicTagNode.java:87)
     at oracle.jsp.runtime.tree.OracleJspBodyTagNode.executeHandler(OracleJspBodyTagNode.java:58)
     at oracle.jsp.runtime.tree.OracleJspCustomTagNode.execute(OracleJspCustomTagNode.java:261)
     at oracle.jsp.runtime.tree.OracleJspNode.execute(OracleJspNode.java:89)
     at oracle.jsp.runtimev2.ShortCutServlet._jspService(ShortCutServlet.java:89)
Edited by: Prasath C on 03-Aug-2011 05:22

Thanks yannick for your replies.
1) I think you must have created a JSF page(jspx) and consumed your wrapper taskflow(MyContentPresenterTF) which has the default method or exception activity (that directs to either error.jsff or MyContentPresenterPF.jsff view activities). MyContentPresenterPF.jsff contains the static region of Webcenter Content PresenterTF. Keeping this assumption in place,
You mentioned...
/*When i don't provide the correct parameters for the CP, i see the complete stacktrace in my console but it does not call the handleError method again so it will also not redirect to the error.jsff. */ ..
In this standalone test case, the error or stack trace appears in console but nothing pops up in Ui. Also as said in my previous post, the control is not getting inside
if (currentRootViewPort.isExceptionPresent()) -- This condition is always false, as the exception object is null in first place irrespctive of incorrect parameters in Content presenter taskflow. So its never going to error.jsff for me...
Also the error is only appearing in console, it doesnot disturb the JSF page anymore...
2)That is for standalone page. But try this scenario...
Deploy the taskflow as shared library to Resource catalog and create the page from Webcenter Administration. Open the page.
Go to edit mode (ctrl + shift + E) . Consume the wrapper taskflow in the page created by clicking Add content > taskflow.
Edit the properties and pass the correct parameter. Observe the page rendered correctly.
Go to edit mode again and change the parameter to incorrect value. You will see a popup appearing with error message UCM content invalid ...Even if you try to change it back to correct value and click ok..the same error appears and appears again....if you click close and try to edit some other properties in the same portal page (say edit some page parameters etc)...Still you see the same exception poped up here and there....We stuck at here and we want to get rid of these errors and show a empty region where the wrapper taskflow was consumed..

Similar Messages

  • How to catch exception in JSP????

    how to catch exception in JSP?
    I use JDeveloper 3.1
    I use connection with database .
    When I insert record in database
    when have duplicate of primary key
    how to catch this exception and
    back to previous page?
    I trying with folowing:
    <jsp:useBean id="RowEditor" class="oracle.jbo.html.databeans.EditCurrentRecord" scope="request">
    <% try {
    RowEditor.setUseJS(true);
    RowEditor.initialize(pageContext, "package2_Package2Module.Drzavi1View");
    RowEditor.setSubmitText("Save");
    RowEditor.setTargetUrl("Drzavi1View_SubmitInsertForm.jsp");
    RowEditor.createNewRow();
    RowEditor.setReleaseApplicationResources(true);
    RowEditor.render();
    catch(Exception e) {
    %>
    <script>
    alert("primary key duplication");
    history.back();
    </script>
    <% } %>
    but i't not working
    please help me

    i catch exceptions as you do, i don't have any problem...
    are you throwing the exception from your bean?
    actually i don't catch an Exception, but an SQLException...
    but it works... here is my code...
         try
    myclass.addElement(); // this is an insert into Oracle
    catch( DataBaseFailException e ) /// an exception that i throws inside after i receive an SQLException
              session.setAttribute("gMessage","e.getMessage()); // error code

  • How to catch exception of JMS when call onMessage()?

    I write a consumer client implement onMessage(),
    in my main() method ...
    try {
    _adapter = new Adapter(checkConsumer,env);
    _adapter.setSelector("client = 'Receive1'");
    _adapter.start();
    System.out.println("Hello...");
    } catch(Exception e) {
    _adapter = null;
    System.out.println("Unable to start adapter: " + e.getMessage());
    _adapter.start() will call onMessage() my onMessage like this
    public void onMessage(Adapter adpt, Message message) {
    try {
    if(message instanceof TextMessage) {
    // Write the text out as read String text = ((TextMessage)message).getText();
    // Do CHECK Process adpt.demoOut("Receive CHECK Text is :" + text);
    //System.out.println("class name is " + consumerName);
    } else {
    // This is just a message (no particular type) } } catch (Exception e) {
    try {
    adpt.warn("Error outputing data: " + message.getJMSMessageID());
    } catch(Exception ignore) {
    } adpt.warn("\tError: " + e.getMessage());
    // Do some exception process }
    If the JMS Server shutdown, how can I catch the exception?

    You might want to try with exception listener that JMS specification provides.

  • How to catch exception into a String variable ?

    I have a code
    catch(Exception e)
                e.printStackTrace();
                logger.error("\n Exception in method Process"+e.getMessage());
            }when i open log i find
    Exception in method Process null.
    But i get a long error message in the server console !! I think thats coming from e.printStackTrace().
    can i get the error message from e.printStackTrace() into a String variable ?
    I want the first line of that big stacktrace in a String variable.
    How ?

    A trick is to issue e.printStackTrace() against a memory-based output object.
    void      printStackTrace(PrintStream s)
             // Prints this throwable and its backtrace to the specified print stream.
    void      printStackTrace(PrintWriter s)
    //          Prints this throwable and its backtrace to the specified print writer.Edited by: BIJ001 on Oct 5, 2007 8:54 AM

  • How to catch exception throw bc4j

    Dear Forum
    I am user of JDeveloper Swing application.
    while exception throw from bc4j some particular
    type error such as (oracle.jbo.DMLException) JBO-26041
    message display.
    i want to catch error no 26041 inorder to display own
    messageBox.
    There is two methods
    1-:
    i used messageBundle class i overite message string but unable to change dialogBox,i want to use own dialog.
    2-:
    And i fund ,DML exception message return from JUErrorHandlerDlg class.So using this subclass how
    to catch and throw own message.
    Plase send me some code to write sub class of JUErrorHandlerDlg.

    You want this method System to throw an exception if the String[] is empty?
    public void system( ObjectOutputStream output, String cmd []  ) {
       if (cmd.length == 0)
          throw new IllegalArgumentException("Hey! This is an empty array!");
    //...rest of your method
    }You can choose for yourself which exception type is most appropriate. You can in theory always use the base Exception but is not very specific nor recommended. In this case, I think an existing unchecked exception such as IllegalArgumentException would be the most appropriate.

  • How to catch exception when have max connection pool

    hi,
    i have define in oracle user that i could have max 10 sessions at the same time.
    I have jdbc datasource & connection pool defined at glassfish server(JSF application).
    now, if in application is too many queries to the database then i have error: nullpointer exception - becouse when i try to do:
    con = Database.createConnection(); - it generates nullpointer exception becouse there isn't free connection pool
    i try to catch exception like this:
    public List getrep_dws_wnioski_wstrzymane_graph() {     int i = 0;     try {     con = Database.createConnection();     ps =    (Statement) con.createStatement();     rs = ps.executeQuery("select data, klasa, ile_dni_wstrzymana, ile_wnioskow from stg1230.dwsww_wstrzymane_dws8 order by data, klasa, ile_dni_wstrzymana, ile_wnioskow");     while(rs.next()){       rep_dws_wnioski_wstrzymane_graph.add(i,new get_rep_dws_wnioski_wstrzymane_graph(rs.getString(1),rs.getString(2),rs.getString(3),rs.getString(4)));       i++;     }     } catch (NamingException e) {         e.printStackTrace();     } catch (SQLException e) {         e.printStackTrace();     } catch (NullPointerException e) {         e.printStackTrace();         throw new NoConnectionException();  // catch null 1     } finally {     try {         con.close();     } catch (SQLException e) {         e.printStackTrace();     } catch (NullPointerException e) {         e.printStackTrace();         throw new NoConnectionException();  // catch null 2     }     } return rep_dws_wnioski_wstrzymane_graph; }
    but at line:
    con.close();
    i have nullpointerexception
    and
    at line
    throw new NoConnectionException(); // catch null 2
    i have: caused by exception.NoConnectionException
    what's wrong with my exception class? how to resolve it?
    public class NoConnectionException extends RuntimeException{     public NoConnectionException(String msg, Throwable cause){       super(msg, cause);     }     public NoConnectionException(){       super();     } }
    at web.xml i have defined:
    <error-page>         <exception-type>exception.NoConnectionException</exception-type>         <location>/NoConnectionExceptionPage.jsp</location>     </error-page>

    thanks,
    i did it and i have error:
    java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: ORA-02391: exceeded simultaneous SESSIONS_PER_USER limit
    at com.sun.gjc.spi.base.DataSource.getConnection(DataSource.java:115)
    at logic.Database.createConnection(Database.java:37): conn = ds.getConnection();
    public class Database {
         public static Connection createConnection() throws NamingException,
                    SQLException {
                Connection conn = null;
                try{
                    Context ctx = new InitialContext();
              if (ctx == null) {
                   throw new NamingException("No initial context");
              DataSource ds = (DataSource) ctx.lookup("jdbc/OracleReports");
              if (ds == null) {
                   throw new NamingException("No data source");
              conn = ds.getConnection();  // here's exception when max connections to database
              if (conn == null) {
                   throw new SQLException("No database connection");
                } catch (NamingException e) {
                    e.printStackTrace();
                    throw new NoConnectionException(); 
             } catch (SQLException e) {
                 e.printStackTrace();
                    throw new NoConnectionException(); 
                catch (NullPointerException e) {
                 e.printStackTrace();
                    throw new NoConnectionException();  // obsluga bledy na wypadek jesli braknie wolnych polaczen do bazy
            return conn;
    }and at my ealier code i have error:
    at logic.GetDataOracle.getrep_dws_wnioski_wstrzymane_graph(GetDataOracle.java:192)
    at line: con = Database.createConnection();
    in code:
    public List getrep_dws_wnioski_wstrzymane_graph() {
        int i = 0;
        try {
        con = Database.createConnection();
        ps =    (Statement) con.createStatement();
        rs = ps.executeQuery("select data, klasa, ile_dni_wstrzymana, ile_wnioskow from stg1230.dwsww_wstrzymane_dws8 order by data, klasa, ile_dni_wstrzymana, ile_wnioskow");
        while(rs.next()){
          rep_dws_wnioski_wstrzymane_graph.add(i,new get_rep_dws_wnioski_wstrzymane_graph(rs.getString(1),rs.getString(2),rs.getString(3),rs.getString(4)));
          i++;
        } catch (NamingException e) {
            e.printStackTrace();
        } catch (SQLException e) {
            e.printStackTrace();
        } catch (NullPointerException e) {
            e.printStackTrace();
            throw new NoConnectionException();
        } finally {
        try {
            if(con != null)
            con.close();
        } catch (SQLException e) {
            e.printStackTrace();
        } catch (NullPointerException e) {
            e.printStackTrace();
            throw new NoConnectionException(); 
    return rep_dws_wnioski_wstrzymane_graph;
    }so what's wrong?
    i have limit max sessions 10 at oracle so i set at my connection pool 5 connections as max. But when i get max 5 sesssins and try to execute next query then i can't catch exception..

  • How to catch exception thrown from a function module?

    Hi all,
             When we are calling a function module from JSPDynpage setting some import parameters, If in some case an exception is thrown in the function module.  How can we catch the same exception in the JSPDynpage program?
    Thanks & Regards,
    Ravi

    Hi Ravi
                                    Try this
                                                try
                    Object retMsgs = output.get(bapiretrunmsgobject);
                      if(result != null )
    IrecordSet rmsg = (IrecordSet) result
                   catch(Exception ex)
                        printException(ex, "Error getting function result");
    Lemme know for any further questions.
    Regards
    Praveen

  • Help Me, How to catch exception thrown from ejbStore

    Hi,
    I am working on application running on Iplanet Application Server 4.0. Problem is the application exception thrown from the ejbStore don't reach the calling servlet, calling servlet receive TransactionRollback exception which is system exception. But there is no sign of my application exception thrown from ejbStore. Can anybody tell me how I can get my ApplicationException thrown from ejbStore in my calling servlet.
    I am calling entity beans set method in servlet and in entity bean ejbStore method I am throwing Application exception.
    in entity bean
    public void ejbStore() throws MyException
    if(true) throw new MyException();
    in servlet
    try {
    MyEntityHome home = .......
    MyEntityRemote remote = home.findBy.....
    remote.setMyValue(MyValue value); //Transaction required Container managed
    }catch(MyException e) {
    e.printStackTrace(); // Not cahcing My Exception
    }catch(Exception e) {
    e.printStackTrace(); //catching TransactionRolledBackException
    Thanks
    Shakti

    Hi Ravi
                                    Try this
                                                try
                    Object retMsgs = output.get(bapiretrunmsgobject);
                      if(result != null )
    IrecordSet rmsg = (IrecordSet) result
                   catch(Exception ex)
                        printException(ex, "Error getting function result");
    Lemme know for any further questions.
    Regards
    Praveen

  • How to catching exceptions from another thread

    hi,guys,i have some code like this:
    public static void main(String[] args) {
    TimeoutThread time = new TimeoutThread(100,new TimeOutException("超时"));
         try{
         t.start();
         }catch(Exception e){
         System.out.println("eeeeeeeeeee");
    TimeoutThread will throws an exception when it runs ,but now i can't get "eeeeeeeeeee" from my console when i runs the main bolck code.so ,somebody help me ,thk.

    hi,ejp,this is my scene:
    getHttpParty(String name) is a method get some information from a web site,this maybe cause many times.now this method is called in my main(String args[]) method.
    i want to terminate getHttpParty if it runs 2s, can you give some simple code to do this.
    thank you very much.
    Edited by: user5449747 on 2010-11-17 上午12:03

  • How to fixe exception out of memory ?

    Hello,i did a web application (asp.net/c#/crystal reports),i used more than 35 tableAdapter and when i'm trying report after some time i remark the memory increase more and more until i get Out Put memory Exception. how can i fix this problem ?
    please help me

    Hi ghilasdz,
    Thank you for posting in MSDN forum.
    Since this forum is to discuss: Visual Studio WPF/SL Designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System, and Visual Studio Editor.
    So I’m afraid that it is not the correct forum for this issue.
    As you said that the exception out of memory for the crystal reports, I suggest you can post this issue directly to the
    SAP Crystal Reports: http://scn.sap.com/community/crystal-reports/content?filterID=contentstatus%5bpublished%5d~objecttype~objecttype%5bthread%5d
    , you will get better support for this issue.
    In addition, I find a similar thread about the exception out of memory for the crystal reports on the
    SAP Crystal Reports, maybe you will get some useful message.
    http://scn.sap.com/thread/1888746
    Thanks for your understanding.
    Best Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to catch exception while validating the username and password in hbm

    Hi,
    I do want to set the username and password dynamically in hibernate.cfg.xml
    Here below is my configuration file.
    {code<hibernate-configuration> 
    <session-factory> 
           <property name="hibernate.bytecode.use_reflection_optimizer">false</property> 
           <property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property> 
           <property name="hibernate.connection.pool_size">10</property> 
           <property name="show_sql">true</property> 
           <property name="hibernate.dialect">org.hibernate.dialect.OracleDialect</property> 
           <property name="hibernate.hbm2ddl.auto">update</property> 
           <property name="current_session_context_class">thread</property> 
           <property name="show_sql">true</property> 
         </session-factory> 
    </hibernate-configuration>{code}
    Also im getting that session factory object like the below code.
    public class Sessions {        private static SessionFactory sessionFactory;      private static Configuration configuration = new Configuration();        static {          try {              String userName = GuigenserviceImpl.userName;              String password = GuigenserviceImpl.password;              String hostName = GuigenserviceImpl.hostName;              String portNo = GuigenserviceImpl.portNo;              String sId = GuigenserviceImpl.sId;                  configuration                      .setProperty("hibernate.connection.username", userName);              configuration                      .setProperty("hibernate.connection.password", password);              configuration.setProperty("hibernate.connection.url",                      "jdbc:oracle:thin:@" + hostName + ":" + portNo + ":" + sId);                try {              configuration.configure("/hibernate.cfg.xml");              sessionFactory = configuration.buildSessionFactory();              GuigenserviceImpl.strAccpted = "true";              }              catch (Exception e) {                    e.printStackTrace();                  GuigenserviceImpl.strAccpted = "false";              }            }          catch (HibernateException hibernateException) {              GuigenserviceImpl.strAccpted = "false";              hibernateException.printStackTrace();          }          catch (Throwable ex) {                GuigenserviceImpl.strAccpted = "false";              ex.printStackTrace();              throw new ExceptionInInitializerError(ex);          }      }          public static SessionFactory getSessionFactory() {          return sessionFactory;      } 
    So, in this above scenario, suppose if im giving the wrong password means exception should be caught and the string variable "GuigenserviceImpl.strAccpted" should be assigned to false.
    But im getting the SQL Exception only in console like wrong username and password. And finally i couldn't able to catch the exception in Sessions class, static block.
    Anyone can help me in catching that SQL Exception in my Sessions class and i need to handle that SQL Exception in my class.
    Im getting this following exception message in my console.
      INFO: configuring from resource: /hibernate.cfg.xml  Apr 6, 2009 2:47:00 PM org.hibernate.cfg.Configuration getConfigurationInputStream  INFO: Configuration resource: /hibernate.cfg.xml  Apr 6, 2009 2:47:00 PM org.hibernate.cfg.Configuration doConfigure  INFO: Configured SessionFactory: null  Apr 6, 2009 2:47:00 PM org.hibernate.connection.DriverManagerConnectionProvider configure  INFO: Using Hibernate built-in connection pool (not for production use!)  Apr 6, 2009 2:47:00 PM org.hibernate.connection.DriverManagerConnectionProvider configure  INFO: Hibernate connection pool size: 10  Apr 6, 2009 2:47:00 PM org.hibernate.connection.DriverManagerConnectionProvider configure  INFO: autocommit mode: false  Apr 6, 2009 2:47:00 PM org.hibernate.connection.DriverManagerConnectionProvider configure  INFO: using driver: oracle.jdbc.driver.OracleDriver at URL: jdbc:oracle:thin:@192.168.1.12:1521:orcl  Apr 6, 2009 2:47:00 PM org.hibernate.connection.DriverManagerConnectionProvider configure  INFO: connection properties: {user=scott, password=****}  Apr 6, 2009 2:47:01 PM org.hibernate.cfg.SettingsFactory buildSettings  WARNING: Could not obtain connection metadata  java.sql.SQLException: ORA-01017: invalid username/password; logon denied        at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)      at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:131)      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:204)      at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)      at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:406)      at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:399)      at oracle.jdbc.driver.T4CTTIoauthenticate.receiveOauth(T4CTTIoauthenticate.java:799)      at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:368)      at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:508)      at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:203)      at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:33)      at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:510)      at java.sql.DriverManager.getConnection(DriverManager.java:525)      at java.sql.DriverManager.getConnection(DriverManager.java:140)      at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110)      at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:84)      at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2073)      at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1298)      at com.beyon.ezygui.server.Sessions.<clinit>(Sessions.java:39)      at com.beyon.ezygui.server.GuigenserviceImpl.testRPC(GuigenserviceImpl.java:322)      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
    Thanks in advance.
    Thanks & Regards,
    Kothandaraman N.

    Hi,
    Myself hardcoded that username and password checking like the below code.
    String name = loginData.get("userName").toString();
              String pswd = loginData.get("pswd").toString();
              String hstName = loginData.get("hName").toString();
              String prtNo = loginData.get("portNo").toString();
              String sid = loginData.get("sId").toString();
              SessionFactory sessionFactory = null;
              try {
                   if (name.trim().equals(userName) && pswd.trim().equals(password)
                             && hstName.trim().equals(hostName)
                             && prtNo.trim().equals(portNo) && sid.trim().equals(sId)) {
                        sessionFactory = Sessions.getSessionFactory();
                        strAccpted = "true";
                   } else {
                        strAccpted = "false";
              } catch (Exception e) {
                   e.printStackTrace();
                   strAccpted = "false";
              }I have my own values in string objects, then comparing that values with the values from login form. If both values are matching, then i will do configurations in hibernate.
    ResourceBundle resourceBundle = ResourceBundle
                   .getBundle("com.beyon.ezygui.server.Queries");
         public static final String connection_url = resourceBundle
                   .getString("connection.url");
         public static final String userName = resourceBundle.getString("userName");
         public static final String password = resourceBundle.getString("password");
         public static final String hostName = resourceBundle.getString("hostName");
         public static final String portNo = resourceBundle.getString("portNo");
         public static final String sId = resourceBundle.getString("sId");The above are the String objects i'm checking for the match with values from login form.
    Thanks & Regards,
    Kothandaraman N.

  • How to catch Exception in a JSP

    Hi there,
    I'm building my first JSP application. I still don't know what happens to an exception thrown inside a scrptlet in a JSP page.
    My JSP page is resultados.jsp (it processes a DB query):
    <%@ page contentType="text/html; charset=iso-8859-1" language="java"
    import="java.lang.*,java.sql.*,pcliente.*" errorPage="error.jsp" session="true" %>
    <html>
    <head>
    <title>PCliente - Hist?rico de Mainframe</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body background="imagens/sm_bg.gif">
    <TABLE border=0 cellPadding=0 cellSpacing=0>
    <TR>
    <TD width=5><IMG alt="" height=1 src="imagens/pixel.gif" width=5></TD>
    <TD vAlign=top width=125><jsp:include page="menu.jsp" flush="true" /> </TD>
    <TD width=25><IMG alt="" height=1 src="imagens/pixel.gif" width=25></TD>
    <TD vAlign=top width=365>
    <%
    try
    PCliente pcliente = new PCliente(request.getParameter("maquina"),
                        request.getParameter("acessorio"),
                        request.getParameter("contrato"),
                        request.getParameter("estabelecimento"),
                        request.getParameter("ifiscal"));
    ResultSet rs = pcliente.executarQuery();
    while (rs.next())
    out.println("<BR>" + rs.getString("nome_estab_instalacao"));
    out.print(" -----" + rs.getString("num_serie_equipamento"));
    out.print(" -----" + rs.getString("num_contrato"));
    /*** SQL exception is thrown by pcliente.executarQuery() ***/
    catch (SQLException sqlEx)
    out.println("<P>" + "There was an error doing the query:");
    out.println ("<PRE>" + sqlEx + "</PRE> \n <P>");
    application.log("Exception lan?ada", sqlEx);
    throw new Exception(sqlEx.toString());
    finally
    out.println("<P>" + "FINALLY !!!");
    %>
    </TD>
    </TR>
    </TABLE>
    </body>
    </html>
    The error.jsp is
    <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*,pcliente.*" isErrorPage="true" session="true" %>
    <html>
    <head>
    <title>PCliente - Hist?rico de Mainframe - Erro</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body>
    <strong>Pagina de Erro</strong>
    </body>
    </html>
    The java class I'm using in this JSP is pcliente/PCliente with the source code:
    package pcliente;
    import java.sql.*;
    public class PCliente
    private String numSerieMaquina, numSerieAcessorio, numContrato, numEstabelecimento, ifiscal;
    private String strQuery;
    private Connection conn;
    private ResultSet rs;
    private Statement stmt;
    public PCliente(String numSerieMaquina, String numSerieAcessorio,
                        String numContrato, String numEstabelecimento,
                        String ifiscal)
    conn = null;
    rs = null;
    stmt = null;
    this.numSerieMaquina = numSerieMaquina;
    this.numSerieAcessorio = numSerieAcessorio;
    this.numContrato = numContrato;
    this.numEstabelecimento = numEstabelecimento;
    this.ifiscal = ifiscal;
    construirQuery();
    public ResultSet executarQuery() throws SQLException
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    /* This causes SQLException as a 'c' was taken from oracle in
    "jdbc:orale:oci8:@PROD" */
    conn = DriverManager.getConnection("jdbc:orale:oci8:@PROD","histmain", "histmain");
    stmt = conn.createStatement();
    rs = stmt.executeQuery(strQuery);
    return rs;
    private void construirQuery()
    strQuery = "SELECT num_serie_equipamento, num_contrato,
    nome_estab_instalacao" +
         " FROM anmpf04" +
         " WHERE 1 = 1";
    if (numSerieMaquina != null)
    if (numSerieMaquina.indexOf('%') == -1)
    strQuery += " AND num_serie_facturacao = " + numSerieMaquina;
    else     
    strQuery += " AND num_serie_facturacao LIKE '" + numSerieMaquina + "'";
    When I execute the JSP I see a page with the text FINALLY !!!
    But an exception was thrown and I can't,
    see
    out.println("<P>" + "There was an error doing the query:");
    out.println ("<PRE>" + sqlEx + "</PRE> \n <P>");
    in the jsp page
    application.log("Exception lan?ada", sqlEx);
    don't know where to find the log file
    throw new Exception(sqlEx.toString());
    isn't caught by the error page error.jsp
    What am I missing here ? a lot of stuff no doubt !
    Can anyone give me suggestion(s) on how to detect an Exception ?
    I would also apreciate a site with documentation regarding Exception processing inside JSP.
    Many thanks,
    MGoncalv

    Hi there,
    I'm building my first JSP application. I still don't
    know what happens to an exception thrown inside a
    scrptlet in a JSP page.I believe that any scriptlet exceptions get wrapped into a ServletException. At that time, if you have an errorPage defined for you JSP page, then it will go there. If you don't then the server will try to find the particular exception type in an <error-page> stanza in the web.xml. If it finds a mapping, it will go to that mapping, otherwise it will go to a default error page (container specific).
    A quick glance at your design shows some big problems though that you may or may not hit (depending on how often you hit the page in your testing). The primary one is that in your PCliente class, you are opening up database connections/statements/results sets w/o closing them. You will run out of connections/cursors at some point b/c of this. You need to do your reads from the database and then close those resources (in a finally block to make sure they get closed). Read the data in a lightweight java object that the JSP can use to actually get the data.
    Also, you only need to register the driver manager once. You can do this in static initialization block.
    ncuka

  • How to catch exception from shared library on Linux?

    Description:
    JNI dynamically loads shared library. Shared library throws exception (class CTestException). JNI can not catch it by CTestException name, only (...) works.
    My config:
    Linux RH AS 4 (x86 64)
    gcc: 3.4.5
    glib: 2.2.5
    Java 1.5.0_06
    g++ compiler options for JNI and shared libraries:
    g++ -Wl,-E -fPIC -shared ...
    There are multiple bugs on Java bugs database regarding C++ ABI incompatibility between Java binaries and stdc++ libraries linked with native code. But I could not find any conclusions on these bugs. Only plans/suggestions to recompile Java on new gcc. These bugs were quite old (regarding Java 1.3, 1.4). Now 1.6 is available but still there is same incompatibility. Maybe I am missing something and there is a way to fix this problem? Like to use specific gcc/glib versions for compilation? How people solve such problems? Any help is appreciated.

    It isn't any different; the commands are the same. You can find the exp executable in tehe $ORACLE_HOME/bin directory.

  • How to catch exception thrown by ActionBinding "Commit"

    I need a programmatic branch after the following line if an exception is thrown:
    ((JUCtrlActionBinding) panelBinding.findCtrlBinding("Commit")).invoke();
    I am building an ADFSwing application using JDev 10.1.3.
    I have a ViewObject derived from an EntityObject that I am trying to use for an insert.
    I have placed the line above in a try block with a "catch (JboException je)" block which includes the code I need to execute upon exception. A default error dialog appears when an exception is thrown "(oracle.jbo.AttrValException) JBO-27014: ...", but the catch block I have created is not executed.
    The effect is that a commit is not fulfilled, the default error dialog appears, but the program continues undaunted.
    I have included "setBundledExceptionMode(false)" just before the try block, but that doesn't make any difference.
    The commit statement above, and the try/catch block I've described are in a JUPanel.
    Any help on how and where I can catch an exception from the action binding is really appreciated!!

    You can use code like this:
         JUCtrlActionBinding commit = (JUCtrlActionBinding)panelBinding.findCtrlBinding("Commit");
         commit.invoke();
         if (!commit.getErrors().isEmpty()) {
           /* Error list not empty. Something went wrong. */
         }

  • How to catch exception for class CL_HR_RE512W for method CHECK_CUMULATION

    Hi,
    How do I catch an exception when using method CHECK_CUMULATION in class CL_HR_RE512W.
    This method calls an instance method READ which raises NO_ENTRY if a wage type is missing on T512W.
    There is no obvious catch class to use?
    My code:
    data: r_512w type ref to cl_hr_re512w.
    start-of-selection.
    create OBJECT r_512w.
    call method r_512w->check_cumulation
    exporting
        p_molga  = molga
        p_lgart  = lgart
        p_cumul  = cumul
        p_date   = date
    receiving
          p_has_cumulation = p_flg.
    If lgart = '9999', for example, then we get an error message:
    'No entry in table T512W for key 08 9999 25.08.2009'

    Hi Gemini Twin,
    Check this link:
    https://wiki.sdn.sap.com/wiki/display/Snippets/ABAP+Objects+-+Defining+a+Class-based+exceptions
    Hope this information is help to you.
    Regards,
    José

Maybe you are looking for

  • Dual Boot on T430 Problem.

    Hi All, I am trying to install Ubuntu 12.04 on Lenovo T430 using SSD available on my Thinkpad.  Ubuntu get's installed onto SSD, But Windows only can boot.. The problem is I am not able to see Ubuntu loader during boot options.  I have follwed instru

  • Battery drain - ios6.1

    My iPhone5 battery has been draining very fast! It used to last more than 24hrs during my normal work day. But soon after 6.1 upgrade, it lasts hardly 6hrs. Hopefully apple will release a new fix soon. Anyone else having similar issues? I am still a

  • Using Weblogic LDAP JAAS credentials for 3rd party authentication

    Hello to all! I'm posting this question because I'm developing a software layer that will connect a weblogic based web application, with LDAP authentication, to a 3rd party application, also with LDAP authentication, and I'm having difficulties in ge

  • Want to change from apple to windows license

    I Have MAC which i stupidly swapped to from a windows machine and now i find that half of the programs i want to use arnt availiable on MAC and so im going to put windows on my MAC. Can i take master collection off the apple side and change the licen

  • ECC Upgrade  CUA

    Hi, We have R/3 4.6c,620 versions in CUA landscape. It was proposed to upgrade one of child system to ECC. Is Central system can be on old version ? Please advice. Thank you,