Undeclared throwable exception

Hi all,
anyone knows whats wrong? The project consits of one simple entity bean.
Only .. ejbRemove() throws RemoteException {..}
Thanks for your help!!!
Thomas
<29.03.2002 13:30:58 CEST> <Error> <Management> <Error deploying application
.\config\auktion\applications\auktionsserver.jar:
java.lang.reflect.UndeclaredThrowableException>
<29.03.2002 13:53:33 CEST> <Error> <J2EE> <Error deploying application
auktionsserver:
Unable to deploy EJB: auktionsserver.jar from auktionsserver.jar:
auktionsserver.PersonBean
at weblogic.ejb20.ejbc.EJBCompiler.setupEJB(EJBCompiler.java:131)
at weblogic.ejb20.deployer.Deployer.runEJBC(Deployer.java:295)
at weblogic.ejb20.deployer.Deployer.compileEJB(Deployer.java:684)
at weblogic.ejb20.deployer.Deployer.deploy(Deployer.java:851)
at weblogic.j2ee.EJBComponent.deploy(EJBComponent.java:30)
at weblogic.j2ee.Application.addComponent(Application.java:163)
at weblogic.j2ee.J2EEService.addDeployment(J2EEService.java:117)
at
weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(DeploymentT
arget.java:329)
at
weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(DeploymentT
arget.java:144)

I don't see an answer to this and I have the same problem. If there is no
activity for a while between my Client and WebLogic I get an Undeclared
checked exception - NoSuchObjectException. It then clears up if I restart my
client.
"Kenneth Yue" <[email protected]> wrote in message
news:3bcff6f2$[email protected]..
>
Hi all,
we are using WLS 5.1 sp10 and deployed certain RMI server objects on theserver.
Occasionally, we received "Undeclared checked exception" once we invoke aserver
method from our client application. What is the cause for that exception?
thanks!
cheers, Kenneth [email protected]

Similar Messages

  • Undeclared checked exception

    Hi all,
    we are using WLS 5.1 sp10 and deployed certain RMI server
    objects on the server. Occasionally, we received
    "Undeclared checked exception" once we invoke a server method
    from our client application. What is the cause for that
    exception?
    thanks!
    cheers,
    Kenneth
    [email protected]

    I don't see an answer to this and I have the same problem. If there is no
    activity for a while between my Client and WebLogic I get an Undeclared
    checked exception - NoSuchObjectException. It then clears up if I restart my
    client.
    "Kenneth Yue" <[email protected]> wrote in message
    news:3bcff6f2$[email protected]..
    >
    Hi all,
    we are using WLS 5.1 sp10 and deployed certain RMI server objects on theserver.
    Occasionally, we received "Undeclared checked exception" once we invoke aserver
    method from our client application. What is the cause for that exception?
    thanks!
    cheers, Kenneth [email protected]

  • Undeclared application exceptions

    I'm using BEA WebLogic 8.1 as my EJB container, and I'm seeing some unexpected behavior. One of our session beans has a method that declares that it throws an ApplicationException. (Our ApplicationException extends from Exception, but not RuntimeException.) However in the remote interface, the same method does not declare that it throws this exception. I expected EJBC to kick up an error, but it was able to compile this bean just fine. Deploying it also worked without complaint.
    I wrote a test client to call this bean and forced it into a situation where it had to throw an ApplicationException. What the client got was the ApplicationException wrapped in a RemoteException, which is the behavior you would expect for system exceptions. When I changed the remote interface to declare ApplicationException and reran the client, I got back the unwrapped ApplicationException. Is this expected for WebLogic? It violates the EJB spec as I understand it. Do they document it anywhere? Does the container act as if it had really caught a system exception, i.e. log the exception, rollback the transaction, and kill the bean?

    An application exception should extend java.lang.Exception.An application exception does not extend java.lang.RuntimeException or java.rmi.RemoteException.
    Paul Bennett wrote:
    I'm throwing application exceptions in ejbStore() to reflect failure of the store operation due to violation of a unique constraint in the database. Apparently these get wrapped and returned in a weblogic.transaction.RolledBackException. I tried to import the latter, but it is not found, even though my compiler classpath includes weblogic.jar. Also, I'd prefer to do this without using a vendor-specific exception. For example, it's no problem when doing the same thing in ejbCreate to extract the nested application exception out of the RemoteException. Any ideas for ejbStore appreciated!

  • SevletContextImpl not serializable exception when one cluster is restarted.

    Hello,
              I am using WLS 5.1 SP8 with apache plug-in and in-memory session
              replication. There is one proxy server and two cluster: A and B. I started
              cluster A and B together and each cluster would "see" each other. I shut
              down cluster A and my session will continue working fine on cluster B.
              However, when I restart cluster A, I get the the following stack trace from
              cluster B:
              Mon Apr 02 12:04:56 PDT 2001:<I> <Cluster> Adding server
              6345049800752707933S172
              .17.17.77:[80,80,443,443,80,-1] to cluster view
              Mon Apr 02 12:04:57 PDT 2001:<E> <Kernel> ExecuteRequest failed.
              java.io.NotSerializableException:
              weblogic.servlet.internal.ServletContextImpl
              at java.lang.Throwable.fillInStackTrace(Native Method)
              at java.lang.Throwable.fillInStackTrace(Compiled Code)
              at java.lang.Throwable.<init>(Compiled Code)
              at java.lang.Exception.<init>(Compiled Code)
              at java.io.IOException.<init>(Compiled Code)
              at
              java.io.ObjectStreamException.<init>(ObjectStreamException.java:29)
              at
              java.io.NotSerializableException.<init>(NotSerializableException.java
              :31)
              at java.io.ObjectOutputStream.outputObject(Compiled Code)
              at java.io.ObjectOutputStream.writeObject(Compiled Code)
              at java.io.ObjectOutputStream.outputClassFields(Compiled Code)
              at java.io.ObjectOutputStream.defaultWriteObject(Compiled Code)
              at java.io.ObjectOutputStream.outputObject(Compiled Code)
              at java.io.ObjectOutputStream.writeObject(Compiled Code)
              at java.util.Hashtable.writeObject(Compiled Code)
              at java.lang.reflect.Method.invoke(Native Method)
              at java.lang.reflect.Method.invoke(Compiled Code)
              at java.io.ObjectOutputStream.invokeObjectWriter(Compiled Code)
              at java.io.ObjectOutputStream.outputObject(Compiled Code)
              at java.io.ObjectOutputStream.writeObject(Compiled Code)
              at
              weblogic.common.internal.WLObjectOutputStreamBase.writeObject(Compiled Code)
              at
              weblogic.servlet.internal.session.ReplicatedSession.writeExternal(Replicated
              Session.java:74)
              at
              weblogic.common.internal.WLObjectOutputStreamBase.writePublicSerializable(Co
              mpiled Code)
              at
              weblogic.common.internal.WLObjectOutputStreamBase.writeObjectBody(Compiled
              Code)
              at
              weblogic.common.internal.WLObjectOutputStreamBase.writeObject(Compiled Code)
              at
              weblogic.common.internal.WLObjectOutputStreamBase.writeObjectWL(Compi
              at
              weblogic.rmi.extensions.AbstractOutputStream2.writeObject(Compiled Code)
              at weblogic.rmi.extensions.AbstractOutputStream.writeObject(Compiled
              Code)
              at
              weblogic.cluster.replication.ReplicationManager_WLStub.create(ReplicationMan
              ager_WLStub.java:86)
              at
              weblogic.cluster.replication.ReplicationManager.createSecondary(Compiled
              Code)
              at
              weblogic.cluster.replication.ReplicationManager.checkHosts(Compiled Code)
              at
              weblogic.cluster.replication.ReplicationManager.clusterMembersChanged(Replic
              ationManager.java:582)
              at
              weblogic.cluster.MemberStash$ClusterMembersChangeDeliverer.execute(MemberSta
              sh.java:207)
              at weblogic.kernel.ExecuteThread.run(Compiled Code)
              --------------- nested within: ------------------
              weblogic.rmi.MarshalException: error marshalling arguments
              - with nested exception:
              [java.io.NotSerializableException:
              weblogic.servlet.internal.ServletContextImpl]
              at java.lang.Throwable.fillInStackTrace(Native Method)
              at java.lang.Throwable.fillInStackTrace(Compiled Code)
              at java.lang.Throwable.<init>(Compiled Code)
              at java.lang.Exception.<init>(Compiled Code)
              at java.io.IOException.<init>(Compiled Code)
              at weblogic.common.T3Exception.<init>(T3Exception.java:47)
              at weblogic.rmi.RemoteException.<init>(RemoteException.java:41)
              at weblogic.rmi.MarshalException.<init>(MarshalException.java:31)
              at
              weblogic.cluster.replication.ReplicationManager_WLStub.create(ReplicationMan
              ager_WLStub.java:90)
              at
              weblogic.cluster.replication.ReplicationManager.createSecondary(Compiled
              Code)
              at
              weblogic.cluster.replication.ReplicationManager.checkHosts(Compiled Code)
              at
              weblogic.cluster.replication.ReplicationManager.clusterMembersChanged(Replic
              ationManager.java:582)
              at
              weblogic.cluster.MemberStash$ClusterMembersChangeDeliverer.execute(MemberSta
              sh.java:207)
              at weblogic.kernel.ExecuteThread.run(Compiled Code)
              --------------- nested within: ------------------
              weblogic.rmi.extensions.RemoteRuntimeException: Undeclared checked
              exception - w
              ith nested exception:
              [weblogic.rmi.MarshalException: error marshalling arguments
               - with nested exception:
              [java.io.NotSerializableException:
              weblogic.servlet.internal.ServletContextImpl]
              at java.lang.Throwable.fillInStackTrace(Native Method)
              at java.lang.Throwable.fillInStackTrace(Compiled Code)
              at java.lang.Throwable.<init>(Compiled Code)
              at java.lang.Exception.<init>(Compiled Code)
              at java.lang.RuntimeException.<init>(RuntimeException.java:47)
              at
              weblogic.utils.NestedRuntimeException.<init>(NestedRuntimeException.java:23)
              at
              weblogic.rmi.extensions.RemoteRuntimeException.<init>(RemoteRuntimeException
              .java:22)
              at
              weblogic.cluster.replication.ReplicationManager_WLStub.create(ReplicationMan
              ager_WLStub.java:108)
              at
              weblogic.cluster.replication.ReplicationManager.createSecondary(Compiled
              Code)
              at
              weblogic.cluster.replication.ReplicationManager.checkHosts(Compiled Code)
              at
              weblogic.cluster.replication.ReplicationManager.clusterMembersChanged(Replic
              ationManager.java:582)
              at
              weblogic.cluster.MemberStash$ClusterMembersChangeDeliverer.execute(MemberSta
              sh.java:207)
              at weblogic.kernel.ExecuteThread.run(Compiled Code)
              I looked everywhere in our code and we don't store ServletContext object
              anywhere in the session level..Can someone give me some hints as to what the
              problem is?
              Thanks for your help in advance.
              Vincent
              

    You probably have a non serializable object in your session.
              You can have only serializable data in the session.
              Cheers,
              -- Prasad
              Vincent Shek wrote:
              > Hello,
              >
              > I am using WLS 5.1 SP8 with apache plug-in and in-memory session
              > replication. There is one proxy server and two cluster: A and B. I started
              > cluster A and B together and each cluster would "see" each other. I shut
              > down cluster A and my session will continue working fine on cluster B.
              > However, when I restart cluster A, I get the the following stack trace from
              > cluster B:
              >
              > Mon Apr 02 12:04:56 PDT 2001:<I> <Cluster> Adding server
              > 6345049800752707933S172
              > .17.17.77:[80,80,443,443,80,-1] to cluster view
              > Mon Apr 02 12:04:57 PDT 2001:<E> <Kernel> ExecuteRequest failed.
              > java.io.NotSerializableException:
              > weblogic.servlet.internal.ServletContextImpl
              > at java.lang.Throwable.fillInStackTrace(Native Method)
              > at java.lang.Throwable.fillInStackTrace(Compiled Code)
              > at java.lang.Throwable.<init>(Compiled Code)
              > at java.lang.Exception.<init>(Compiled Code)
              > at java.io.IOException.<init>(Compiled Code)
              > at
              > java.io.ObjectStreamException.<init>(ObjectStreamException.java:29)
              > at
              > java.io.NotSerializableException.<init>(NotSerializableException.java
              > :31)
              > at java.io.ObjectOutputStream.outputObject(Compiled Code)
              > at java.io.ObjectOutputStream.writeObject(Compiled Code)
              > at java.io.ObjectOutputStream.outputClassFields(Compiled Code)
              > at java.io.ObjectOutputStream.defaultWriteObject(Compiled Code)
              > at java.io.ObjectOutputStream.outputObject(Compiled Code)
              > at java.io.ObjectOutputStream.writeObject(Compiled Code)
              > at java.util.Hashtable.writeObject(Compiled Code)
              > at java.lang.reflect.Method.invoke(Native Method)
              > at java.lang.reflect.Method.invoke(Compiled Code)
              > at java.io.ObjectOutputStream.invokeObjectWriter(Compiled Code)
              > at java.io.ObjectOutputStream.outputObject(Compiled Code)
              > at java.io.ObjectOutputStream.writeObject(Compiled Code)
              > at
              > weblogic.common.internal.WLObjectOutputStreamBase.writeObject(Compiled Code)
              > at
              > weblogic.servlet.internal.session.ReplicatedSession.writeExternal(Replicated
              > Session.java:74)
              > at
              > weblogic.common.internal.WLObjectOutputStreamBase.writePublicSerializable(Co
              > mpiled Code)
              > at
              > weblogic.common.internal.WLObjectOutputStreamBase.writeObjectBody(Compiled
              > Code)
              > at
              > weblogic.common.internal.WLObjectOutputStreamBase.writeObject(Compiled Code)
              > at
              > weblogic.common.internal.WLObjectOutputStreamBase.writeObjectWL(Compi
              > at
              > weblogic.rmi.extensions.AbstractOutputStream2.writeObject(Compiled Code)
              > at weblogic.rmi.extensions.AbstractOutputStream.writeObject(Compiled
              > Code)
              > at
              > weblogic.cluster.replication.ReplicationManager_WLStub.create(ReplicationMan
              > ager_WLStub.java:86)
              > at
              > weblogic.cluster.replication.ReplicationManager.createSecondary(Compiled
              > Code)
              > at
              > weblogic.cluster.replication.ReplicationManager.checkHosts(Compiled Code)
              > at
              > weblogic.cluster.replication.ReplicationManager.clusterMembersChanged(Replic
              > ationManager.java:582)
              > at
              > weblogic.cluster.MemberStash$ClusterMembersChangeDeliverer.execute(MemberSta
              > sh.java:207)
              > at weblogic.kernel.ExecuteThread.run(Compiled Code)
              >
              > --------------- nested within: ------------------
              > weblogic.rmi.MarshalException: error marshalling arguments
              > - with nested exception:
              > [java.io.NotSerializableException:
              > weblogic.servlet.internal.ServletContextImpl]
              > at java.lang.Throwable.fillInStackTrace(Native Method)
              > at java.lang.Throwable.fillInStackTrace(Compiled Code)
              > at java.lang.Throwable.<init>(Compiled Code)
              > at java.lang.Exception.<init>(Compiled Code)
              > at java.io.IOException.<init>(Compiled Code)
              > at weblogic.common.T3Exception.<init>(T3Exception.java:47)
              > at weblogic.rmi.RemoteException.<init>(RemoteException.java:41)
              > at weblogic.rmi.MarshalException.<init>(MarshalException.java:31)
              > at
              > weblogic.cluster.replication.ReplicationManager_WLStub.create(ReplicationMan
              > ager_WLStub.java:90)
              > at
              > weblogic.cluster.replication.ReplicationManager.createSecondary(Compiled
              > Code)
              > at
              > weblogic.cluster.replication.ReplicationManager.checkHosts(Compiled Code)
              > at
              > weblogic.cluster.replication.ReplicationManager.clusterMembersChanged(Replic
              > ationManager.java:582)
              > at
              > weblogic.cluster.MemberStash$ClusterMembersChangeDeliverer.execute(MemberSta
              > sh.java:207)
              > at weblogic.kernel.ExecuteThread.run(Compiled Code)
              > --------------- nested within: ------------------
              > weblogic.rmi.extensions.RemoteRuntimeException: Undeclared checked
              > exception - w
              > ith nested exception:
              > [weblogic.rmi.MarshalException: error marshalling arguments
              >  - with nested exception:
              > [java.io.NotSerializableException:
              > weblogic.servlet.internal.ServletContextImpl]
              > ]
              > at java.lang.Throwable.fillInStackTrace(Native Method)
              > at java.lang.Throwable.fillInStackTrace(Compiled Code)
              > at java.lang.Throwable.<init>(Compiled Code)
              > at java.lang.Exception.<init>(Compiled Code)
              > at java.lang.RuntimeException.<init>(RuntimeException.java:47)
              > at
              > weblogic.utils.NestedRuntimeException.<init>(NestedRuntimeException.java:23)
              > at
              > weblogic.rmi.extensions.RemoteRuntimeException.<init>(RemoteRuntimeException
              > .java:22)
              > at
              > weblogic.cluster.replication.ReplicationManager_WLStub.create(ReplicationMan
              > ager_WLStub.java:108)
              > at
              > weblogic.cluster.replication.ReplicationManager.createSecondary(Compiled
              > Code)
              > at
              > weblogic.cluster.replication.ReplicationManager.checkHosts(Compiled Code)
              > at
              > weblogic.cluster.replication.ReplicationManager.clusterMembersChanged(Replic
              > ationManager.java:582)
              > at
              > weblogic.cluster.MemberStash$ClusterMembersChangeDeliverer.execute(MemberSta
              > sh.java:207)
              > at weblogic.kernel.ExecuteThread.run(Compiled Code)
              >
              > I looked everywhere in our code and we don't store ServletContext object
              > anywhere in the session level..Can someone give me some hints as to what the
              > problem is?
              >
              > Thanks for your help in advance.
              >
              > Vincent
              

  • How to throw exception in run() method of Runnable?

    Hi, everyone:
    I want to know how to throw exception in run() method of interface Runnable. Since there is no throwable exception declared in run() method of interface Runnable in Java API specification.
    Thanks in advance,
    George

    Thanks, jfbriere.
    I must add though that if your run() methodis
    executed after a call to Thread.start(), then
    it is not a good choice to throw anyRuntimeException
    from the run() method.
    The reason is that the thrown exception won't be
    handled appropriately by a try-catch block.Why do you say that "the thrown exception won't be
    handled appropriately by a try-catch block"? Can you
    explain it in more detail?
    regards,
    George
    Because the other thread runs concurrently with and independently of the parent thread, there's no way you can write a try/catch that will handle the new thread's exception: try {
        myThread.start();
    catch (TheExceptionYouWantToThrowFromRun exc) {
        handle it
    do the next thing This won't work because the parent thread just continues on after myThread.start(). Start() doesn't throw the exception--run() does. And our parent thread here has lost touch with the child thread--it just moves on to "do the next thing."
    Now, you can do some exception handling with ThreadGroup and uncaughtException(), but make sure you understand why the above won't work, in case that was what you were planning to do.

  • Exception handling in JSF

    This question has been asked time and again, without any clear answers to it. I would appreciate if some one can help me on this.
    I am developing a web application with the following architecture:
    JSF page calls backing bean methods which calls the service methods. Now my service methods can throw different exceptions like ValidationException, BusinessException, SystemException etc.
    Now, what i want to do is : If Validation/Business Exceptions are thrown show the error messages to the user on the same page from which the action was called. And if a SystemException is thrown navigate to a default error page.
    How can i handle this thing? Any clues?

    Thanks for the reply BalusC,
    I checked the log files (application log as well as server log) also and there is no other stack trace besides of the exception which i am throwing. Let me elaborate on the exact issue:
    I am trying to handle concurrency issues in my application. For example, When two users simultaneously try to edit the same record, the user who first saves the changes successfully. Now when the second user tries to save the changes i want to show him a message that "This record has been modified after you opened it for edit. Please refresh your page and reapply the changes". To show this message i am throwing a BusinessException from my service, which in turn gets propagated to my saveAction method. The saveAction method needs to handle this exception and somehow should show the above message to the user.
    To achieve this,
    1. i tried catching the exception in my saveAction and added the necessary faces message to FacesContext object. But it does not work. Later i read the reason behind this too, that in the invoke application phase a new context will be created and the messages will not be available to it.
    2. I then added the throws clause to my saveAction method, so that my default exception handler will handle it.
    saveAction method signature :
    public String saveAction () throws BusinessException {
        //some code here for save
        return null;
    }This is my code for the ErrorHandler.jsp:
    <body>
            <h1 style="color: red">Error</h1><br/><%
                 // print stack trace.
                ExceptionHandler exceptionHandler = new ExceptionHandler();
                 // unwrap ServletExceptions.
                while (exception instanceof ServletException || exception instanceof FacesException ||
                        exception instanceof ApplicationException) {
                    if(exception instanceof ServletException) {
                        exception = ((ServletException) exception).getRootCause();
                    } else if(exception instanceof FacesException) {
                        exception = ((FacesException) exception).getCause();
                    } else if(exception instanceof ApplicationException) {
                        exception = ((ApplicationException) exception).getCause();
      %><font color="red"><%=exceptionHandler.handleException(exception)%></font><br/></body>and this is my code for the handleException method defined in the ExceptionHandler.java:
    public static String getMessage(final String msgKey, final Object args[]) {
            String message = messages.getProperty(msgKey);
            if(args != null) {
                final String replaceArgs[] = (String[]) args;
                for(int i = 0; i < replaceArgs.length; i++)
                    message = message.replaceFirst("{" + i + "}", replaceArgs);
    return message;
    public String handleException(final Throwable exception) {
    logger.debug("handleException called..");
    String errorMessage = "Unknown error occured.";
    String stackTrace = "Stacktrace can not be found. Please check the logs for more details.";
    String errorString = null;
    final StringWriter stringWriter = new StringWriter();
    if(exception != null) {
    exception.printStackTrace (new PrintWriter (stringWriter));
    stackTrace = stringWriter.toString();
    errorMessage = getMessage(exception.getMessage(), null);
    errorString = "<b>" + errorMessage + "</b> <br> </br> <br> <input id=\"show\" type=\"button\" value=\"Show Details >>\" onClick=\"toggle();\" /> <div id=\"errorStackTrace\" style=\"display:none;\" > <pre>" + stackTrace + "</pre> </div>";
    return errorString;
    With the help of this code, i am simply trying to navigate to the error page if an exception occurs and display the appropriate error message with the stacktrace.
    The strange thing is, the ErrorHandler.jsp page correctly gets called, which in turn calls the handleException method which returns the formatted error string. (I checked this by adding log statements everywhere). But the system does not actually navigates to the ErrorHandler.jsp page and shows an alert with the following message : "Request error, status : 500 Internal Server Error message : "
    Can someone help me figure out what exactly the problem is?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Is there a way to handle custom java exception in OSB?

    For example, i created a exception that extends RuntimeException.
    My exception has a new field called "code".
    I want to handle this exception in Oracle Service Bus process and retrieve this code to throws another exception with a XML structure that includes the code.
    Is there a way to do that ?
    <con:fault xmlns:con="http://www.bea.com/wli/sb/context">
         <con:errorCode>BEA-382515</con:errorCode>
         <con:reason>Callout to java method "public static org.apache.xmlbeans.XmlObject ...</con:reason>
         <con:java-exception xmlns:con="http://www.bea.com/wli/sb/context">
             <con:java-content ref="jcid:33a6c126:14006f3df18:-7fd9"/>
         </con:java-exception>
         <con:location xmlns:con="http://www.bea.com/wli/sb/context">
             <con:node>optmusPipeline</con:node>                    
             <con:pipeline>optmusPipeline_request</con:pipeline>
             <con:stage>processStage</con:stage>
             <con:path>request-pipeline</con:path>   
         </con:location>
    </con:fault>
    it is not enough to recover the information i needed.

    Hi Sandro,
    I've got the same situation. I agree that returning xml from function is not a best choice as you have to manually check if return status is an error or not. Processing exception in error handler is better and this is how I do it:
    I am doing a java callout to a function that can throw exception. Then I add ErrorHandler to stage containing this callout (all the exception are caught here).
    In the error handler I check if $fault/ctx:java-exception is not null. If not then I pass thrown exception to my utility function that converts it to xml similar to yours:
    import org.apache.xmlbeans.XmlException;
    import org.apache.xmlbeans.XmlObject;
    public static XmlObject exceptionToXML(Throwable exception)
      throws XmlException {
      String xmlString = exceptionToString(exception);
      return XmlObject.Factory.parse(xmlString);
    public static String exceptionToString(Throwable exception) {
      String cause = "";
      if (exception.getCause() != null) {
      cause = exceptionToString(exception.getCause());
      return String
      .format("<exception><name>%s</name><description>%s</description>%s</exception>",
      exception.getClass().getName(), exception.getMessage(),
      cause);
    Calling exceptionToXML with $fault/ctx:java-exception/ctx:java-content returns:
    <exception>
         <name>pl.app.MyException</name>
         <description>Exception message</description>
    </exception>
    Then you can check the exception class (IF action: $exception/name/text() = "pl.app.MyException") and handle it accordingly.
    Good luck,
    Krzysiek

  • How to clear ClassNot found Exception

    Hi
    I am running a simple RMI program in linux. It will give class not found exception.(could not find class(Hello_stub) at code base() )
    1.HelloInterface.java( Remote Interface)
    2.Hello.java(Remote Object Implementation)
    3.HelloClient.java(Client program that invokesa method of the remote interface)
    Steps are followed.
    1.compilation can be done successfully.
    javac HelloInterface.java Hello.java HelloClient.java
    2.run the rmiregistry command. this step also successfully done.
    rmiregistry &
    3.rmic Hello
    this step also done suceessfully.
    this step was create a stub and skeleton classes in the current folder
    All the java codes and the class files are there in a single folder.
    /home/manohar/
    4.Then next step is to run the server program. Here i got an exception ;
    java Hello &
    Exception in SERVER undeclared Checked Exception: nested exception is:
    java.lang.ClassNotFoundException: could not find(Hello_stub) class at codebase().
    This RMI example program run in the windows.
    I am a fresher and new to RMI.If any one knows please help me.
    Thanks and Regards
    Manohar.M

    You either need to have the stub and interface files available in the classpath of the client and server, OR, you need to tell the server JVM to tell the client where it can find RMI files not in the client classpath:
    -Djava.rmi.server.codebase="file:///jars/shared.jar"

  • Try to understand Throwable

    I saw some sample codes like:
    [Base Exception Class]
    public class BaseException extends Exception {
    public BaseException() {super();}
    public BaseException(Throwable exception) {
    super();
    this.nestedException = exception;
    }//end constructor
    [Sub Exception]
    public class TestException extends BaseException {
    public TestException(Throwable exception) {
    super(exception);
    public TestException() {
    super();
    [Calling Class]
    public Result getData() throws TestException {
    try {
    connection = ConnectionHelper.getConnection(...);
    } catch (SQLException e){
    TestException te = new TestException(e);
    te.setErrorCode("10000");
    throw te;
    --What is the purpose of passing the e as Throwable in
    new TestException(e);
    It seems to me that if use:
    TestException te = new TestException();
    will also create the object. And
    te.setErrorCode("10000");
    throw te;
    will be just fine. Then why should use the Throwable e to initiate the Object
    TestException? Or what is the usage of use the Throwable?
    Thanks
    Scott

    Throwable is the superclass of Exception (or somewhere up there).
    The purpose is that you catch an exception in your code, but want to throw a new one, but want to include the original one that started it all.
    Generally, I don't normally do that, but it does happen in some places. I've seen this in JSP all the time (what Tomcat does, not what I've done in JSP).

  • Handle exception on server side and display a customized jsp error page

    Hi,
    I am developing a java/j2EE web application using servlet, jsp, ejb3 with JBOSS and ECLIPSE.
    Two cases can occur on the server side :
    1) either I have not an expected result in a method and in this case I want to display an error page (a JSP page I suppose) with a personnalized error message
    2) or I have an exception thrown and I want to display the exception message in the former JSP page
    I don't know how to cope with this problem of personnalized error message (or the message of a thrown exception) with a JSP page.
    Does anybody can help me ? Thank you
    Edited by: xflamant on Jun 20, 2009 10:51 AM

    For the case of an unknown Error, simply use a default error page.
    The redirection to this page can be accomplished by inserting folowing code into your web.xml:
         <error-page>
            <exception-type>java.lang.Throwable</exception-type>
            <location>/WEB-INF/jsp/error.jsp</location>       
        </error-page>Known exception can be caught via a try-catch block.
    Then simply dispatch to the page you want displayed an add an attribute containing the error message to the response object.
    This attribute can then be used in the target page to diplay the error.

  • Handling exceptions in setters

    In a form I need to set some values based on an id that is a member of the form. The problem is that, to set these values, I have to retrieve the object that has the given id; this operation can cause an exception to be thrown.
    I noticed that, while a getter propagates the exception and allows me to go to the error page, the setter just goes on with the original operation. I can see something doesn't work because, after the page is "normally" loaded, when I click on a command link nothing happens.
    This seems to be a bug, but I couldn't find anything in the bug database. Does anyone know if this is expected behaviour, what the rationale is, and if there is a way to solve the problem?
    Thanks

    Let's see your code.I made a very simple example. Here are the files.
    index.jsp:
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <html>
         <body>
              <f:view>
                   <h:form>
                        <h:inputText id="testField" value="#{test.testField}"/><br>
                        <h:commandLink id="submit" value="submit" action="#{test.submit}"/>
                   </h:form>
              </f:view>
         <body>
    </html>
    Test.java:
    package my.testpackage;
    public class Test
         public String getTestField() throws Exception
    //          if ( testField != null && testField.length() > 0 )
    //               throw new Exception( "Getter exception" );
              return testField;
         public void setTestField( String field ) throws Exception
              if ( field.length() > 0 )
                   throw new Exception( "Setter exception" );
              testField = field;
         public String submit()
              return null;
         private String testField;
    faces-config.xml
    <faces-config>
         <managed-bean>
              <managed-bean-name>
                   test
              </managed-bean-name>
              <managed-bean-class>
                   my.testpackage.Test
              </managed-bean-class>
              <managed-bean-scope>
                   request
              </managed-bean-scope>
         </managed-bean>
    </faces-config>
    web.xml:
    <web-app>
         <display-name>Test</display-name>
         <!-- Faces Servlet -->
         <servlet>
              <servlet-name>Faces Servlet</servlet-name>
              <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
              <load-on-startup>1</load-on-startup>
         </servlet>
         <!-- Faces Servlet Mapping -->
         <servlet-mapping>
              <servlet-name>Faces Servlet</servlet-name>
              <url-pattern>*.faces</url-pattern>
         </servlet-mapping>
         <error-page>
              <exception-type>java.lang.Throwable</exception-type>
              <location>/error.jsp</location>
         </error-page>
    </web-app>
    If I uncomment the code in the setter to throw the exception (that is, as I posted it) the application doesn't send me to the error page, although the exception is thrown. With the exception in the setter commented, and only the getter throwing an exception, I correctly go to the error page.

  • What does throws exception mean?

    I know how to try and catch exceptions. I don't understand why some methods can simply throw an exception. What happens when the method throws an exception?
    No links please. I am just looking for a simple plain english answer in laymen terms.

    First of all throwable Exceptions have two subclasses: Error and Exception.
    Instances of Error are internal errors involving the JVM (runtime environment). There is not much you can do about these: Either catch them or throw them yourself. There are Runtime exceptions e.g ArrayOutOfBoundsException or NullPointerException. The RuntimeException and Error classes do not need to be specifically thrown by the programmer but instead are thrown by Java runtime itself. These are unchecked exceptions. And the exceptions you, as the programmer, should throw are other exceptions like the EOFException, or conveniently named 'checked exceptions'.
    When you throw these exceptions, or when Java does it for you, chances are that the application quits and show mysterious errors on the screen. When your program stops working without successfully finishing what it is supposed to do, an exception is thrown. An example is when you have to type the following in a program:
    public static void main(String[] args) throws IOException
    * adding a throws clause like this to your methods definition simply means
    * that the methods throws an exception if something goes wrong, not that it actually will.
    * But when this exception is actually thrown, it will be able to give you a very good idea
    * of what is wrong with your program and help you work towards fixing the issue.
    One may ask why these checks are in place, it is so that your program is less likely to crash with fatal errors because you know up front the kind of exceptions that can be thrown by the methods a program uses.

  • Catch exceptions out of catch block

    Hello,
    Here in my job we was using Log4J , but since some of our logs need complex things like replication for
    some databases analise log t see where we will send in and lots of emails too , so we are developing our own log framework, my question is , there is a way to caught exceptions not declared in a try catch block?
    Example: IndexOutOfBound some time are not cought in a try catch block, or some files sometimes came null and throws uncauht exceptions some times, there is a way to me listen to all execptions wich was throwed to the system and have a no catch block??
    Thank You
    Ricardo

    When an uncaught exception occurs, the JAVA runtime system determins the ThreadGroup of the current thread and calls "uncaughtException" on that ThreadGroup object. However, the java.lang.ThreadGroup object performs the printing of the stack trace, which you will normally see in such cases.
    If you want to modify this behaviour, you could write your own ThreadGroup class, which extends java.lang.ThreadGroup and provides a different implementation of uncaughtException. E.g. you could write a log message to your own log file or whatever you want.
    Now you must guarantee, that all threads in your system are childs of that customized ThreadGroup. I did this in my main class:
    public class Application implements Runnable {
        private String[] argv;
        public static void main(String[] argv) {
            this.argv = argv; // save this for use in the run method
            ThreadGroup tg = new MyThreadGroup();
            // start a thread in the new thread group and terminate the original main thread
            new Thread(tg, this, "main").start();
        public void run() {
            // perform all other tasks here
    public class MyThreadGroup extends ThreadGroup {
        public MyThreadGroup()  {
            super("MyThreadGroup");
        public void uncaughtException(Thread thread, Throwable exception) {
            // ignore death of thread
            if (exception instanceof ThreadDeath)
                return;
            // ---- perform your actions here ----
    }All other threads, which are created later, are also in the new thread group, because they inherit the group from their creator.

  • Task.cancel() throw exception

    Hi,
    I'm new to JavaFx and recently try out example on javafx.concurrent.Task:
    Example is from a book:
    The following is the model class
    private static class Model {
            public Worker<String> worker;
            public AtomicBoolean shouldThrow = new AtomicBoolean(false);
            private Model() {
                worker = new Task<String>() {
                    @Override
                    protected String call() throws Exception {                   
                        updateTitle("Example Task");
                        updateMessage("Starting...");
                        final int total = 250;
                        updateProgress(0, total);
                        for (int i = 1; i <= total; i++) {
                            try {
                                Thread.sleep(20);
                            } catch (InterruptedException e) {
                                if (isCancelled()) //I modified this part to check for isCancelled()
                                    return "Cancelled at " + System.currentTimeMillis();
                            if (shouldThrow.get()) {
                                throw new RuntimeException("Exception thrown at " + System.currentTimeMillis());
                            updateTitle("Example Task (" + i + ")");
                            updateMessage("Processed " + i + " of " + total + " items.");
                            updateProgress(i, total);
                        return "Completed at " + System.currentTimeMillis();
        }On JavaFx, it has 2 Label that are bind to Worker.value and Worker.exception as shown below:
    value.textProperty().bind(
                    model.worker.valueProperty());
                exception.textProperty().bind(new StringBinding() {
                        super.bind(model.worker.exceptionProperty());
                    @Override
                    protected String computeValue() {
                        final Throwable exception = model.worker.getException();
                        if (exception == null) return "";
                        return exception.getMessage();
                });Next: There are 3 buttons "Start", "Cancel" and "Exception". Following is the method to hook up events to all three buttons:
    private void hookupEvents() {
            view.startButton.setOnAction(new EventHandler<ActionEvent>() {
                @Override
                public void handle(ActionEvent actionEvent) {
                    new Thread((Runnable) model.worker).start();
            view.cancelButton.setOnAction(new EventHandler<ActionEvent>() {
                @Override
                public void handle(ActionEvent actionEvent) {
                    model.worker.cancel();
            view.exceptionButton.setOnAction(new EventHandler<ActionEvent>() {
                @Override
                public void handle(ActionEvent actionEvent) {
                    model.shouldThrow.getAndSet(true);
        }Now, first test is when Task is successfully executed. Value label will be filled with the return value i.e: Completed at ......................
    Second is throw exception and the result is as what in the book, the exception label is filled with the exception property. i.e. Exception thrown at ..................
    But when I test the Cancel button, it throws and exception instead of return a String value.
    The exception label is filled with:
    "Task must only be used from the FX Application Thread"
    Instead of having Value label filled with: "Cancelled at .................."
    Can anybody help me please?
    Regards,
    Henri

    i got the same problem and I'm interested in an answer too.
    My Workaround was to have a secon AtomicBoolean-Var
    public AtomicBoolean cancel = new AtomicBoolean(false);
    if (cancel.get()) {
        return "Cancelled at " + System.currentTimeMillis();
    }this code works but it cannot be the answer.

  • Exception in inserting record for entity service

    Hello Everybody,
    I have created simple entity service: Employee.
    I have included 3 fields in it.
    Created one finder method "GetAllEmployee".
    I have rebuilt and deployed project on the server.
    When i tried to insert new record for this entity service from service browser:
    http://<server>:<port>/webdynpro/dispatcher/sap.com/cafUIservicebrowser/ServiceBrowser?cafsource=true
    I got following exception:
    ERROR. Exception in method create.
    What should be the reason behind this?
    Regards,
    Bhavik

    Hi Aliaksei,
    I have changed the severity level of the trace. Then I got this exception.
    Error in CAF:RT:oal:handleException(Throwable)
    [EXCEPTION]
    com.sap.caf.rt.exception.ServiceException: Exception in method create.
         at com.sap.caf.rt.services.serviceaccess.ServiceWrapper.handleException(ServiceWrapper.java:821)
         at com.sap.caf.rt.services.serviceaccess.ServiceWrapper.createDependentObject(ServiceWrapper.java:452)
         at com.sap.caf.rt.services.serviceaccess.ServiceWrapper.createDataContainerBean(ServiceWrapper.java:194)
         at com.sap.caf.rt.services.serviceaccess.CAFServiceAccessBeanImpl.createDataObject(CAFServiceAccessBeanImpl.java:159)
         at com.sap.caf.rt.services.serviceaccess.CAFServiceAccessLocalLocalObjectImpl20.createDataObject(CAFServiceAccessLocalLocalObjectImpl20.java:647)
         at com.sap.caf.rt.ui.cool.generic.AspectServiceAccess.insertAspectRow(AspectServiceAccess.java:211)
         at com.sap.caf.rt.ui.cool.generic.Aspect.insertRows(Aspect.java:1426)
         at com.sap.caf.rt.ui.cool.generic.Aspect.sendChanges(Aspect.java:1542)
         at com.sap.caf.ui.ptn.objecteditor.ObjectEditorCC.executeCoolAction(ObjectEditorCC.java:519)
         at com.sap.caf.ui.ptn.objecteditor.wdp.InternalObjectEditorCC.executeCoolAction(InternalObjectEditorCC.java:243)
         at com.sap.caf.ui.ptn.objecteditor.ui.OElayout.onActionGenericAction(OElayout.java:315)
         at com.sap.caf.ui.ptn.objecteditor.ui.wdp.InternalOElayout.wdInvokeEventHandler(InternalOElayout.java:279)
         at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)
         at com.sap.tc.webdynpro.progmodel.controller.Action.fire(Action.java:67)
         at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doHandleActionEvent(WindowPhaseModel.java:417)
         at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:132)
         at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:415)
         at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:101)
         at com.sap.tc.webdynpro.clientserver.cal.ClientManager.doProcessing(ClientManager.java:650)
         at com.sap.tc.webdynpro.clientserver.cal.ClientManager.processRequest(ClientManager.java:155)
         at com.sap.tc.webdynpro.clientserver.session.core.ApplicationHandle.doProcessing(ApplicationHandle.java:105)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:63)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:50)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:95)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:159)
    Caused by: com.sap.engine.services.ejb.exceptions.BaseEJBException: Exception in method create.
         at com.lti.carpool.besrv.employee.EmployeeServiceLocalLocalObjectImpl0.create(EmployeeServiceLocalLocalObjectImpl0.java:321)
         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:324)
         at com.sap.caf.rt.services.serviceaccess.ServiceWrapper.createDependentObject(ServiceWrapper.java:430)
         ... 37 more
    Caused by: com.sap.engine.services.ejb.exceptions.BaseRuntimeException: Cannot create an instance of the stateless bean.
         at com.sap.engine.services.ejb.session.stateless_sp5.BeanFactory.getActiveBean(BeanFactory.java:192)
         at com.sap.engine.services.ejb.session.stateless_sp5.StatelessContainerFP.getActiveBean(StatelessContainerFP.java:183)
         at com.lti.carpool.besrv.employee.EmployeeServiceLocalLocalObjectImpl0.create(EmployeeServiceLocalLocalObjectImpl0.java:312)
         ... 42 more
    Caused by: java.lang.NoSuchFieldError: DATASOURCE_LOCAL_DA
         at com.lti.carpool.besrv.employee.EmployeeServiceBean.ejbCreate(EmployeeServiceBean.java:34)
         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:324)
         at com.sap.engine.services.ejb.session.stateless_sp5.BeanFactory.createObject(BeanFactory.java:113)
         at com.sap.engine.services.ejb.util.pool.ContainerPoolImpl.doResizeOneStepUp(ContainerPoolImpl.java:374)
         at com.sap.engine.services.ejb.util.pool.ContainerPoolImpl.ensureNotEmpty(ContainerPoolImpl.java:343)
         at com.sap.engine.services.ejb.util.pool.ContainerPoolImpl.pop(ContainerPoolImpl.java:291)
         at com.sap.engine.services.ejb.session.stateless_sp5.BeanFactory.getActiveBean(BeanFactory.java:188)
         ... 44 more
    It cannot find field DATASOURCE_LOCAL_DA. What this field mean?
    Thanks,
    Bhavik

Maybe you are looking for