Handing Arguments To Custom Exception

Hi,
I've written the simple custom exception class below
public class JAMException extends Exception
     public void JAMException(String area, String type)
          System.out.println("There is a " + type + " problem in " + area);
}As you can see I want to be able to take in two string arguments which will be used in the output message to the user.
I utilise the exception like so..
try
      //something
catch (JAMException("Virtual Band","InterruptedException"))     //Area, Type
}However the code above results in the following error
<identifier> expected
catch (JAMException("Virtual Band","InterruptedException"))I've never really seem a exception take in arguments so Im wondering if this is possible? Also I want the JAMException class to be a generic exception class to handle IOExceptions, EOFExceptions etc.. Is the above approach correct?
Help would be really appreciated!

Thanks for the advice, I've got my JAMException working as you suggested above but when it comes to implementing it, there are certain places where I can't throw it, for example the run() method in a thread. when I attempt to do this i get "overridden method does not throw JAMException". I understand the logic behind this I was just wondering how I can get around it...
Below is an example of a method that works
private boolean connect() throws JAMException
     exl.addMessage("Virtual Band");
     try
          data_group = InetAddress.getByName(data_address);
          data_socket = new MulticastSocket(data_port);
          data_socket.setTimeToLive(10);
          System.out.println("TTL: " + data_socket.getTimeToLive());
          data_socket.joinGroup(data_group);
          data_socket.setSoTimeout(500); // 500 ms timeout on functions like receive and send..
          Random r = new Random();
          int x = (int)(r.nextFloat() * 255.0);
          voice_address = voice_address + x;
          System.out.println("Sending my audio to multicast ip=" + voice_address);
          System.out.println("Connect ok!");
          return true;
     catch (Exception e)
          throw new JAMException("Virtual Band", "General Exception");
//          e.printStackTrace();
          //return false;
This is the way I was doing the run() method, doesn't work
public void run() throws JAMException
     System.out.println(">>>>>>> THREAD RUNNING");
          long last = System.currentTimeMillis() - send_intervall;           while (thread != null) {
          if (System.currentTimeMillis() - last > send_intervall)
               try
                    String msg = "alive:" + my_name + ":" + voice_address + ":";
                    DatagramPacket hi = new DatagramPacket(msg.getBytes(), msg.length(),
                    data_group, data_port);
                    data_socket.send(hi);
                    last = System.currentTimeMillis();
               catch(Exception e)
                    throw new JAMException("Virtual Band", "General Exception");
}Anybody got any idea how to get around this problem??

Similar Messages

  • How to pass OAF filed data as a argument to custom function

    Hi All,
    I am doing controller extension. I have the following doubt will you please solve my doubt.
    My doubt is how to pass the standard page filed data as an argument to custom function.
    Let us assume that in my standard page i have item details (item number, description and uom.......)
    and i need to pass item number as an argument to my custom function.
    How to do this?
    Please help me on this.
    Regards
    Zaheer.

    Hi
    Thanks a lot for replying me, Thanks again and again.
    The error which i am getting is as follows:
    Actually iam extending egocancelapplypagebuttonbarco.
    in this co we have code on Apply button iam writing my code there.
    My code is as follows:
    package oracle.apps.ego.common.webui;
    import java.sql.*;
    import oracle.apps.ego.item.eu.util.EgoItemContext;
    import oracle.apps.fnd.framework.OAApplicationModule;
    import oracle.apps.fnd.framework.server.OADBTransaction;
    import oracle.apps.fnd.framework.webui.OAPageContext;
    import oracle.apps.fnd.framework.webui.beans.OAWebBean;
    import oracle.apps.fnd.framework.webui.beans.form.OAFormValueBean;
    import oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean;
    import oracle.apps.fnd.framework.webui.beans.nav.OAButtonBean;
    import oracle.apps.fnd.framework.webui.beans.nav.OABreadCrumbsBean;
    import oracle.jbo.Transaction;
    import oracle.cabo.ui.beans.layout.PageLayoutBean;
    import oracle.cabo.ui.beans.nav.LinkBean;
    import oracle.jbo.ApplicationModule;
    // Referenced classes of package oracle.apps.ego.common.webui:
    // EgoCancelApplyPGButtonBarCO
    public class EgoCancelApplyPGButtonBarEXTCO extends EgoCancelApplyPGButtonBarCO
    public EgoCancelApplyPGButtonBarEXTCO()
    public void processRequest(OAPageContext oapagecontext, OAWebBean oawebbean)
    super.processRequest(oapagecontext, oawebbean);
         String s = null;
    OAFormValueBean oaformvaluebean = (OAFormValueBean)oapagecontext.getPageLayoutBean().findChildRecursive("cancelDestinationHidden");
    if(oaformvaluebean != null)
    s = (String)oaformvaluebean.getValue(oapagecontext);
    if(s == null)
    OABreadCrumbsBean oabreadcrumbsbean = (OABreadCrumbsBean)oapagecontext.getPageLayoutBean().getLocation();
    if(oabreadcrumbsbean != null)
    int i = oabreadcrumbsbean.getLinkCount();
    if(i >= 2)
    s = oabreadcrumbsbean.getLinkDestination(i - 2);
    if(oapagecontext.getSessionValue("EgoCritTempListPgUrl") != null && s == null)
    s = (String)oapagecontext.getSessionValue("EgoCritTempListPgUrl");
    if(s == null)
    s = oapagecontext.getCurrentUrlForRedirect();
    OAButtonBean oabuttonbean = (OAButtonBean)oawebbean.findIndexedChildRecursive("cancelButton");
    oabuttonbean.setWarnAboutChanges(false);
    oabuttonbean.setDestination(s);
    public void processFormRequest(OAPageContext oapagecontext, OAWebBean oawebbean)
    byte byte0 = 4;
    super.processFormRequest(oapagecontext, oawebbean);
    OAApplicationModule oaapplicationmodule = oapagecontext.getApplicationModule(oawebbean);
    if(oapagecontext.getParameter("applyButton") != null)
    oapagecontext.getApplicationModule(oawebbean).getTransaction().commit();
    String s = null;
    if(oapagecontext.getTransactionTransientValue("OverrideEgoCancelApplyPGButtonBarCODestination") == null)
    OAFormValueBean oaformvaluebean = (OAFormValueBean)oapagecontext.getPageLayoutBean().findChildRecursive("applyDestinationHidden");
    if(oaformvaluebean != null)
    s = (String)oaformvaluebean.getValue(oapagecontext);
    if(s == null)
    OAButtonBean oabuttonbean = (OAButtonBean)oawebbean.findIndexedChildRecursive("cancelButton");
    s = oabuttonbean.getDestination();
    try
    oapagecontext.sendRedirect(s);
    return;
    catch(Exception exception)
    return;
    if(byte0 == 4)
    EgoItemContext egoitemcontext = EgoItemContext.getItemContextObject(oapagecontext);
    String s1 = egoitemcontext.getItemNumber();
    try
    CallableStatement callablestatement = oaapplicationmodule.getOADBTransaction().getJdbcConnection().prepareCall("{XXNRITEMUPDATE(?)}");
    callablestatement.setString(1, s1);
    callablestatement.execute();
    callablestatement.close();
    catch(SQLException sqlexception)
    sqlexception.printStackTrace();
    And my error is as follows
    oracle.apps.fnd.framework.OAException: java.lang.NullPointerException at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:891) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:603) at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247) at oracle.apps.fnd.framework.webui.beans.nav.OAPageButtonBarBean.processRequest(OAPageButtonBarBean.java:351) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:980) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646) at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247) at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processRequest(OAPageLayoutHelper.java:1136) at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processRequest(OAPageLayoutBean.java:1569) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:959) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646) at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247) at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processRequest(OAFormBean.java:385) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:959) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646) at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247) at oracle.apps.fnd.framework.webui.beans.OABodyBean.processRequest(OABodyBean.java:353) at oracle.apps.fnd.framework.webui.OAPageBean.processRequest(OAPageBean.java:2336) at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1735) at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:509) at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:430) at oa_html._OA._jspService(_OA.java:82) at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119) at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:385) at oracle.jsp.JspServlet.doDispatch(JspServlet.java:259) at oracle.jsp.JspServlet.internalService(JspServlet.java:178) at oracle.jsp.JspServlet.service(JspServlet.java:148) at javax.servlet.http.HttpServlet.service(HttpServlet.java:588) at oracle.jsp.provider.Jsp20RequestDispatcher.forward(Jsp20RequestDispatcher.java:162) at oracle.jsp.runtime.OraclePageContext.forward(OraclePageContext.java:175) at oa_html._OA._jspService(_OA.java:92) at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119) at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:385) at oracle.jsp.JspServlet.doDispatch(JspServlet.java:259) at oracle.jsp.JspServlet.internalService(JspServlet.java:178) at oracle.jsp.JspServlet.service(JspServlet.java:148) at javax.servlet.http.HttpServlet.service(HttpServlet.java:588) at oracle.jsp.provider.Jsp20RequestDispatcher.forward(Jsp20RequestDispatcher.java:162) at oracle.jsp.runtime.OraclePageContext.forward(OraclePageContext.java:175) at oa_html._OA._jspService(_OA.java:92) at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119) at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:385) at oracle.jsp.JspServlet.doDispatch(JspServlet.java:259) at oracle.jsp.JspServlet.internalService(JspServlet.java:178) at oracle.jsp.JspServlet.service(JspServlet.java:148) at javax.servlet.http.HttpServlet.service(HttpServlet.java:588) at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456) at org.apache.jserv.JServConnection.run(JServConnection.java:294) at java.lang.Thread.run(Thread.java:595) ## Detail 0 ##
    java.lang.NullPointerException at oracle.apps.ego.common.webui.EgoCancelApplyPGButtonBarCO.processRequest(EgoCancelApplyPGButtonBarCO.java:81) at oracle.apps.ego.common.webui.EgoCancelApplyPGButtonBarEXTCO.processRequest(EgoCancelApplyPGButtonBarEXTCO.java:31) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:587) at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247) at oracle.apps.fnd.framework.webui.beans.nav.OAPageButtonBarBean.processRequest(OAPageButtonBarBean.java:351) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:980) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646) at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247) at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processRequest(OAPageLayoutHelper.java:1136) at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processRequest(OAPageLayoutBean.java:1569) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:959) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646) at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247) at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processRequest(OAFormBean.java:385) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:959) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926) at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646) at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247) at oracle.apps.fnd.framework.webui.beans.OABodyBean.processRequest(OABodyBean.java:353) at oracle.apps.fnd.framework.webui.OAPageBean.processRequest(OAPageBean.java:2336) at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1735) at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:509) at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:430) at oa_html._OA._jspService(_OA.java:82) at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119) at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:385) at oracle.jsp.JspServlet.doDispatch(JspServlet.java:259) at oracle.jsp.JspServlet.internalService(JspServlet.java:178) at oracle.jsp.JspServlet.service(JspServlet.java:148) at javax.servlet.http.HttpServlet.service(HttpServlet.java:588) at oracle.jsp.provider.Jsp20RequestDispatcher.forward(Jsp20RequestDispatcher.java:162) at oracle.jsp.runtime.OraclePageContext.forward(OraclePageContext.java:175) at oa_html._OA._jspService(_OA.java:92) at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119) at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:385) at oracle.jsp.JspServlet.doDispatch(JspServlet.java:259) at oracle.jsp.JspServlet.internalService(JspServlet.java:178) at oracle.jsp.JspServlet.service(JspServlet.java:148) at javax.servlet.http.HttpServlet.service(HttpServlet.java:588) at oracle.jsp.provider.Jsp20RequestDispatcher.forward(Jsp20RequestDispatcher.java:162) at oracle.jsp.runtime.OraclePageContext.forward(OraclePageContext.java:175) at oa_html._OA._jspService(_OA.java:92) at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119) at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:385) at oracle.jsp.JspServlet.doDispatch(JspServlet.java:259) at oracle.jsp.JspServlet.internalService(JspServlet.java:178) at oracle.jsp.JspServlet.service(JspServlet.java:148) at javax.servlet.http.HttpServlet.service(HttpServlet.java:588) at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456) at org.apache.jserv.JServConnection.run(JServConnection.java:294) at java.lang.Thread.run(Thread.java:595)
    I hope that u will help me untill i got the solution for this issue.
    Regards
    Zaheer.

  • Is Custom Exception is memory consuming????

    Hi Friends,
    Somebody saying that having custom exception is very costlier. Is it correct????. I found some article says that custom exception will increasing the memory footprint of code.
    can anybody explain me how this cusom exception is costlier.......
    Rgds,
    Venkatesh P.

    Hi Friends,
    Somebody saying that having custom exception is
    very costlier. Is it correct????. No.
    Every class you load and every object you instantiate, including custom exceptions, consumes some memory, but "very costlier"? No.
    At any given moment, your program will probably have thousands--maybe millions--of live objects and dozens or hundreds of classes. The handful of custom exception objects that might be live at once will not add noticeably to that.

  • What factors should be taken into account for Custom Exceptions

    hi,
    I just want to know that What factors should be taken into account for making Custom Exceptions.
    any examples will appreciated.
    regards,
    vjoy

    Do you want this to be checked exception? If so extend it from Exception or subclass of it. If it is unchecked exception (not forced by javac to be caught by callers), then extend it from RuntimeException or subclass of it. Exceptions are serializable objects and so have serialVersionID field. Also, to allow for exception chaining, define a constructor that accepts "cause" (http://java.sun.com/j2se/1.4.2/docs/guide/lang/chained-exceptions.html)

  • Does the ipod nano 7th gen work with Belkin Blue tooth In car hands free? Customer support said it did when I bought it, but the box doesn't say it does and I dont want to open it in case I have to return it.

    Does the ipod nano 7th gen work with Belkin Blue tooth In car hands free? Customer support said it did when I bought it, but the box doesn't say it does and I dont want to open it in case I have to return it.

    If the Belkin supports the A2DP (Stereo Bluetooth) profile then it will work.

  • How to access custom exception in client side in web services?

    I have an interface and implementation of a java web services. One method in it throws a custom exception indicating the error type (authrization fails, db connection lost, etc...). But in the generated proxy file, the catched exception for the correspondent method becames java.lang.Exception. I check the code and found the actual thrown exception is com.apache.soap.SOAPExcetion. In the client code, I printed out all the SOAPExcetion and related Fault messages but could not find my original custom exception info. I need this custom exception to be accessed to the client so the client knows what's wrong.

    for current user, SPGroup.ContainsCurrentUser
    http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spgroup.containscurrentuser.aspx
    Scott Brickey
    MCTS, MCPD, MCITP
    www.sbrickey.com
    Strategic Data Systems - for all your SharePoint needs

  • Native C++ Custom Exception Not Recognized

    Hi,
    I'm having a problem with the native part of my code when throwing a custom exception. It is never caught when the exception is thrown in a separate class, it always falls in the generic catch(...) section. I know this problem has something to do with JNI and Java since running a C++ test program doing the same thing recognizes the exception and catches it.
    My Program is something like this
    Java Part:
    public class RunException {
      public static void main(String args[]) {
         doSomething();
    }C++ Part:
    class CustomException: public exception {
       public :
           exception() {};
    class CatchException: public exception {
       public:
          doSomething() {
            try {
               throwException->throwException();
               throw CustomException(); //this would have been caught in catch(CustomException)
            }catch(CustomException e) {
             //never goes in here
            catch(int e) {
             //this works
            catch(...) {
            //always goes ends up here here
    class ThrowException {
      public:
        throwException() {
           throw CustomException(); //this ends up in catch(...)
           //throw 1 - throwing an integer would work
    } I'm not sure what's causing this but I'm guessing it has something to do with loading and linking or maybe some sort of JVM security policy/behavior? Any help would be greatly appreciated.
    Edited by: z3n3r on Nov 13, 2008 7:51 PM

    Never seen this. Some comments on your C++:
    class CustomException: public exception {
    public :
    exception() {};That should be CustomException() {}
    }catch(CustomException e) {That should be catch (CustomException &e). Never catch exceptions by value.
    throwException() {That should be throwException() throw(CustomException) {}, although good old MSVC still ignores it 15 years later ...

  • Webservices and custom exception handling

    hi all,
    I have one ejb method which promote as webservices.
    @WebMethod
    @Oneway
    public void test(String arg) throws STARS21BOException{
    my Custom Exception class STARS21BOException extends from EjbException and it has no-arg constructor.
    but when i deploy on server i get following exception.
    if i remove throws clause from method, it is working fine.
    javax.xml.ws.WebServiceException: Unable to create JAXBContext
         at com.sun.xml.ws.model.AbstractSEIModelImpl.createJAXBContext(AbstractSEIModelImpl.java:158)
         at com.sun.xml.ws.model.AbstractSEIModelImpl.postProcess(AbstractSEIModelImpl.java:87)
         at com.sun.xml.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:271)
         at com.sun.xml.ws.server.EndpointFactory.createSEIModel(EndpointFactory.java:351)
         at com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:201)
         Truncated. see log file for complete stacktrace
    Caused By: java.security.PrivilegedActionException: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
    java.lang.StackTraceElement does not have a no-arg default constructor.
         this problem is related to the following location:
              at java.lang.StackTraceElement
              at public java.lang.StackTraceElement[] java.lang.Throwable.getStackTrace()
              at java.lang.Throwable
              at java.lang.Exception
              at public java.lang.Exception sg.com.stee.stars21.showcase.business.jaxws.STARS21BOExceptionBean.causedByException
              at sg.com.stee.stars21.showcase.business.jaxws.STARS21BOExceptionBean
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sun.xml.ws.model.AbstractSEIModelImpl.createJAXBContext(AbstractSEIModelImpl.java:148)
         at com.sun.xml.ws.model.AbstractSEIModelImpl.postProcess(AbstractSEIModelImpl.java:87)
         at com.sun.xml.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:271)
         at com.sun.xml.ws.server.EndpointFactory.createSEIModel(EndpointFactory.java:351)
         Truncated. see log file for complete stacktrace
    Caused By: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
    java.lang.StackTraceElement does not have a no-arg default constructor.
         this problem is related to the following location:
              at java.lang.StackTraceElement
              at public java.lang.StackTraceElement[] java.lang.Throwable.getStackTrace()
              at java.lang.Throwable
              at java.lang.Exception
              at public java.lang.Exception sg.com.stee.stars21.showcase.business.jaxws.STARS21BOExceptionBean.causedByException
              at sg.com.stee.stars21.showcase.business.jaxws.STARS21BOExceptionBean
         at com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:102)
         at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:438)
         at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:286)
         at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:139)
         at com.sun.xml.bind.api.JAXBRIContext.newInstance(JAXBRIContext.java:105)
         Truncated. see log file for complete stacktrace
    >
    <Apr 23, 2010 10:51:33 AM SGT> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID '1271991082383' for task '2'. Error is: 'weblogic.application.ModuleException: Exception activating module: EJBModule(ejb-showcaseEJB.jar)

    newt.mm wrote:
    @WebMethod
    @Oneway
    public void test(String arg) throws STARS21BOException{
    }As per method signature it is asynchronous web service however you are trying to throw soap fault. Isn't the soap fault is also a kind of response?
    Do you really want your web method to be asynchronous?

  • Custom exceptions and carrying forward stack trace

    Hi, I have a question on exception handling.
    I have written an application which has several custom exceptions. When an exception occurs, sometimes I throw it and then when its caught, wrapping it in another exception like so:
    } catch (Exception e){
    throw new CollectionFailedException(this.getName() + " could not get collection", e);
    This works fine, but when I output the stacktrace, it only goes as far as the new exception, making things more difficult to debug. Is there any way of incrementing the stack trace using the first exception?
    Many thanks for any help offered!
    Marc

    Marc, this is expected behaviour. When you throw a new exception, the stacktrace starts off at the new one. A really nice explanation and sample code for creating new Exceptions and extending the Exception class is located at:
    http://www.javaworld.com/javaworld/jw-09-2001/jw-0914-exceptions.html
    Good luck, fstream

  • Raise custom exception

    Hi experts,
    I have synchronous scenario and in response inbound message I have Fault type ft_my_error_message.
    My question is: how I can raise my custom exception ft_my_error_message in mapping.
    I would like to send some information in my custom exception and catch it in ABAP proxy. With
    throw new StreamTransformationException("my message"); 
    I’m losing response message and in ABAP proxy I don’t know is my custom error occurred or something else.
    Thanks
      Vedran

    Hi Vedran
    Based on the discussion above, it looks like the JDBC call returns the error on the RESPONSE message and do not have a FAULT message type, is that right? Also, you mentioned ABAP proxy, so I'm guessing your scenario is synchronous Proxy to JDBC.
    If the JDBC call does not have a FAULT message, AFAIK I don't think you can map this back to the Proxy fault message.
    An alternative approach would be to map back the JDBC response to the Proxy response, and handle this in the ABAP proxy.
    In the proxy coding, you can check for the values in the response for an indicator of the error. If an error happens, you can raise an exception there. You can check out the link below on how to raise fault messages in the proxy.
    https://help.sap.com/saphelp_nw04/helpdata/en/5d/a45c3cff8ca92be10000000a114084/content.htm
    If you use the application log, or have access to error information from a BAPI return table, you can also use these directly to complete the fault message. In this case, you only need to call the methodCL_PROXY_FAULT=>RAISE of the proxy runtime to trigger the error:
    CALL METHOD cl_proxy_fault=>raise
      EXPORTING
       exception_class_name   = <Name of Exception Class>  
       application_log_handle = < Application Log: Handle of a Protocol>  
       bapireturn_tab         = < Table with BAPI Return Information>.
    The exception class name would be the proxy generated class based on the custom fault type that you declared for the proxy service interface.
    Once the exception is raised in the ABAP proxy, you will see this as an "Application Error" in SXMB_MONI of your ECC system.
    Rgds
    Eng Swee

  • How to use customized exception

    Hi all,
    I have a problem using struts-action-mappings.
    I have a method for update in my app module, and i'm using that method with data action.
    In that method, I have to throw my customized exception to user if there is error. I just don't know how to catch the exception and display it in page.
    I've read about struts page flow diagram elements and know there are Exceptions and Global Exceptions. But i still don't know how to use them.
    What i want to know is can I relate my custom exception with Exceptions/Global Exceptions in struts diagram? And if so, can anybody show me an example for it?
    Thanks

    1.Create a method GET_ACTORS using RH_GET_ACTORS,
    2.Create a container element 'Actors' type string with multiline.
    3.Create Task, where you can call the Method GET_ACTORS  and pass the Container values of 'Actors' from Method->Task->Workflow
    4.Create a Step type before creating the Step mail and include the previous Task.
    5.Now you can create the step Mail. Give the Recipient Type as 'Expression'-> Select the Container Element 'Actors' from WF container
    But remember the values should be Passed from the task to Workflow in Binding correctly.
    Regards,
    Sriyash

  • Raising Custom Exceptions in RMI

    hi all,
    i have a problem. i have an RMI server that makes use of some classes. in those classes, i am raising exceptions.
    problem is that the first time that those classes are called, the correct custom exception is raised.
    all the following times, i receive a java.util.EmptyStackException, and looking at the log file that i write, it seems that the call never reaches the inteded class.
    All the custom exceptions that i use extends the java.lang.Exception class
    can anyone explain me why i got this weird behaviour??
    thanx in advance and regards
    marco

    What was the resolution to this. I am getting an EmptyStackException running a application with 50 threads. I get this exception in one thread and recover OK. I get the exception in another thread and the whole process hangs! Any thoughts?

  • Mapping custom faults to custom exceptions

    Hello all,
    I defined a web service that could thow for some operations custom faults. These custom faults were manually defined in the WSDL file of the web service. I sent some request messages to the web service and I received the result and everything seems to be fine.
    I automatically generated the Java stub/client, but it seems that the client doesn't receive custom exceptions for the corresponding custom faults defined in the WSDL file. I would like that, in the Java client, for the custom faults defined in the WSDL for the operations exposed, the client to receive corresponding custom exceptions. I work with JDev 9.0.5, OC4J 10g 9.0.4. release. Is this possible in that release? I knew that there were limitations regarding JAX-RPC in that release... If not, will this be available in 10.1.3 release?
    As an additional info, I tried to generate the Java client stub with AXIS WSDL2Java tool. Also, I received a generic exception for the custom faults, due to the fact that for the custom exceptions (from code generated by axis tools) to work, you need axis both on client and the server.
    Many thanks in advance!
    Regards,
    Marinel

    Hi,
    I'm uncertain about 9.0.4/10.1.2 (I will investigate further), but 10.1.3 supports fault to exception and exception to fault mappings.

  • EDT custom exception handler

    Hi,
    Is there any posibility to add custom exception handler to EDT? I'm thinking to implement an automatic feed-back from a client aplication. When an exception occurs in EDT it will automatically send to server. The problem is that unsigned webstart application have no permissions to call Thread.setUncaughtExceptionHandler() on EDT.
    Is there any workaround?
    Anton

    Hi,
    Is there any posibility to add custom exception handler to EDT? I'm thinking to implement an automatic feed-back from a client aplication. When an exception occurs in EDT it will automatically send to server. The problem is that unsigned webstart application have no permissions to call Thread.setUncaughtExceptionHandler() on EDT.
    Is there any workaround?
    Anton

  • Throwing MbeanException wrapping custom exception

    Iam throwing a mbean exception which wraps a custom exception from mbean.
    Iam invoking this mbean from wlst(python script) and Iam trying to catch this MBeanException
    When i try to use the getCause method i get the following exception .
    "java.rmi.UnmarshalException: Problem finding error class; nested exception is:
    java.lang.ClassNotFoundException: Failed to load class oracle.webcenter.lifecycle.exception.LifecyclePortalGuidMisMatchException"
    Please note that the python script is aware of the custom exception (LifecyclePortalGuidMisMatchException).
    For testing purpose, to confirm this, i have also created an instance of LifecyclePortalGuidMisMatchException in python (before invoking the mbean)
    The complete exception stack
    java.rmi.UnmarshalException: Problem finding error class; nested exception is:
    java.lang.ClassNotFoundException: Failed to load class oracle.webcenter.lifecycle.exception.LifecyclePortalGuidMisMatchException
    javax.management.MBeanException
    at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:234)
    at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:223)
    at javax.management.remote.rmi.RMIConnectionImpl_1035_WLStub.invoke(Unknown Source)
    at weblogic.management.remote.common.RMIConnectionWrapper$16.run(ClientProviderBase.java:919)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
    at weblogic.security.Security.runAs(Security.java:61)
    at weblogic.management.remote.common.RMIConnectionWrapper.invoke(ClientProviderBase.java:917)
    at javax.management.remote.rmi.RMIConnector$RemoteMBeanServerConnection.invoke(RMIConnector.java:993)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.python.core.PyReflectedFunction.__call__(Unknown Source)
    at org.python.core.PyMethod.__call__(Unknown Source)
    at org.python.core.PyObject.__call__(Unknown Source)
    at org.python.core.PyObject.invoke(Unknown Source)
    at ora_mbs$py.invoke$8(/ade/aimmanue_pt/oracle/oracle_common/common/wlst/lib/ora_mbs.py:56)
    at ora_mbs$py.call_function(/ade/aimmanue_pt/oracle/oracle_common/common/wlst/lib/ora_mbs.py)
    at org.python.core.PyTableCode.call(Unknown Source)
    at org.python.core.PyTableCode.call(Unknown Source)
    at org.python.core.PyFunction.__call__(Unknown Source)
    at org.python.core.PyObject.__call__(Unknown Source)
    at org.python.core.PyObject.invoke(Unknown Source)
    at LifecycleHandler$py._doScopeImport$26(/ade/aimmanue_pt/oracle/as11gr1wc/common/script_handlers/LifecycleHandler.py:892)
    at LifecycleHandler$py.call_function(/ade/aimmanue_pt/oracle/as11gr1wc/common/script_handlers/LifecycleHandler.py)
    at org.python.core.PyTableCode.call(Unknown Source)
    at org.python.core.PyTableCode.call(Unknown Source)
    at org.python.core.PyFunction.__call__(Unknown Source)
    at ExpImpHandler$py.importGroupSpaces$9(/ade/aimmanue_pt/oracle/as11gr1wc/common/script_handlers/ExpImpHandler.py:113)
    at ExpImpHandler$py.call_function(/ade/aimmanue_pt/oracle/as11gr1wc/common/script_handlers/ExpImpHandler.py)
    at org.python.core.PyTableCode.call(Unknown Source)
    at org.python.core.PyTableCode.call(Unknown Source)
    at org.python.core.PyFunction.__call__(Unknown Source)
    Could you let me who why iam not able to get the cuase of the exception when the client is aware of the exception
    Edited by: user510156 on Aug 20, 2012 6:43 AM
    Edited by: user510156 on Aug 20, 2012 6:49 AM

    Hi,
    There is no API to provide this functionality. The reason is the XI message processing is through pipeline as you know. And this is nothing but SAP specific services. So you can not alter them as they are. For the request that you are asking, you will have to edit the pipeline step that populates the SAP:ERROR node. For this, we need to identify which service does this and then if it is possible to write a user exit, etc...So in this case, I would suggest you go with raising an OSS note.
    However, can you please tell us why is this required? I can understand to send a message/mail if you get an error or something like that. But I am not able to figure out in what scenarios would you require this kind of error display.
    Thanks and Regards,
    Sarath.

Maybe you are looking for

  • I am trying to connect my iPad to TV's with an Apple Composite AV cable to no avail

    I have an iPad2 which I have been trying to connect to different TV sets with an Apple Composite AV but nothing seems to work. Tried different AV connections on each TV set. Also changing the signal from PAL to NTSC and still nothing. Does anyone hav

  • Error building the BPM application

    Hello, My BPM application was running fine. When I add one more Webdynpro component as dependent project and use Its UI on certain step. Since then my BPM application has an error in building the project which is "Build fail for <project name> in var

  • Dealing with floating point numbers...

    Please I would be very happy if someone could help me on getting something right. When ever I divide 2 numbers and the denominator is greater than the numerator, it results in the number zero(0); I want to be able to plot a financial histogram on a c

  • Can I use a individual business?

    Hi. I'm Operating a business in Korea. My company employees are two people, but the only one that will use Creative Cloud. Then purchase a Individual License for commercial use is possible? And Promotion license (Photoshop CC + Lightroom 5) is possib

  • Error 1085

    what should i do to remove this error i cant add my widget and also cant install extension .... i reinstalled widget browser .. but error did not go............