Unreported Exception : must be caught or declared to be thrown error at servlet

hello all,

firstly i don't know wheter i'm in a right place to ask a question about the servlet...:D
my problem is..i have a servlet file names myServlet.java which is calling a method from myJavaProvisioning.java. when i compile this both file, i've got an error says "Unreported Exception : ....must be caught or declared to be thrown" in my servlet. perhaps anybody could help me to solve this problem..


script at myServlet.java

  public void handleAction(HttpServletRequest request,
                           HttpServletResponse response) throws
      ServletException, IOException {
 
    String result = null;
    boolean status = false;
    myJavaProvisioning subscriber = new myJavaProvisioning();

     if (doaction.equals("createCFAll")) {
      status = subscriber.createIPCentrexFeature(userId,forwardTo);
     }

     if (status) {
      result = "success";
     }
     else {
      result = "failure";
     }

}

and script at myJavaProvisioning.java something like this

  public boolean createIPCentrexFeature(String userId, String forwardTo) throws
      ObjectAlreadyExistException, InvalidParameterException,
      ObjectNotFoundException, SystemException, Exception {

    boolean status = false;
   
    try {

        TestUserManager userManager = new TestUserManager();
        myUser ipcfManager= userManager.getUser(userId);

        CallForwardAll cfAll = ipcfManager.createCallForwardAll(forwardTo);
        status = true;
 
    }
    catch (ObjectAlreadyExistException ex) {
      logger.error("Unable to " + doaction + " : " + ex.getMessage());
      if (this.isDebug()) {
        ex.printStackTrace();
      }
    }
    catch (InvalidParameterException ex) {
      logger.error("Unable to " + doaction + " : " + ex.getMessage());
      if (this.isDebug()) {
        ex.printStackTrace();
      }
    }
    catch (ObjectNotFoundException ex) {
      logger.error("Unable to " + doaction + " : " + ex.getMessage());
      if (this.isDebug()) {
        ex.printStackTrace();
      }
    }
    catch (SystemException ex) {
      logger.error("Unable to " + doaction + " : " + ex.getMessage());
      if (this.isDebug()) {
        ex.printStackTrace();
      }
    }
    catch (Exception ex) {
      logger.error("Unable to " + doaction + " : " + ex.getMessage());
      if (this.isDebug()) {
        ex.printStackTrace();
      }
    }
    return status;
  }


a really appreacite for any help input..
eg4Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

objectsCommented:
u need to handle the possible exception returned by createIPCentrexFeature(), or declare that your method may throw it

u could use something like the following to handle it:

tr
{
    status = subscriber.createIPCentrexFeature(userId,forwardTo);
}
catch (Exception ex)
{
   throw new ServletException("error calling createIPCentrexFeature");
}
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
eg4Author Commented:
thanx and it works!!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java EE

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.