1 Reply Latest reply on Jan 14, 2005 12:56 AM by william sundberg

    JSP SessionBenn Exception problem

    william sundberg Newbie

      The following code will show my allertbox:

      try {
      ...
      dcm_ejb.util.ValidateMgr oVMgr = new dcm_ejb.util.ValidateMgr();

      oVMgr.checkUniqueStr("price_list",
      "price_list_id",
      oPriceListValue.getPrice_list_id(),
      "PriceListId");
      ...
      }
      catch(dcm_ejb.util.ValidateException vex)
      {
      %>

      <!--
      alert("Error: <%= vex.getMessage() %>");
      //-->

      <%
      ...

      But when I move the same code as above(call to dcm_ejb.util.ValidateMgr) into a Stateles Sessionbean and call it with:

      try {
      ...
      oPriceListSession.validate(oPriceListValue);
      ...
      }
      catch(dcm_ejb.util.ValidateException vex)
      {
      %>

      <!--
      alert("Error: <%= vex.getMessage() %>");
      //-->

      <%
      ...

      I receive a StackTrace in JBoss"Concole window" but No alertbox which is what I wanted as above. The validate() throws the same ValidateException .

      StackTrace:
      20:13:44,273 ERROR [LogInterceptor] EJBException in method: public abstract void dcm_ejb.interfaces.PriceListMgr.valida
      e(dcm_ejb.interfaces.PriceListValue) throws dcm_ejb.util.ValidateException,dcm_ejb.util.ApplicationException,java.rmi.R
      moteException:
      dcm_ejb.util.ValidateException: PriceListId Exist
      ...
      -------------------

      So I am wondering if anyone have any ideer about this?
      Thank you/