Possible to determine exception thrown in a finally block?

I believe the answer to this is 'no', but I thought I would ask just to confirm.
If an exception is thrown in a try block, is there a way in the finally block to determine what exception was thrown? I tried using Throwable#fillinStackTrace and Thread#getStackTrace and did not get anywhere. I did see other methods like Thread#getAllStackTraces and perhaps going up to a parent ThreadGroup and inspecting other child Thread instances, but at least in my debugger, I did not see anything useful.
The basic idea I am trying to achieve is to detect if an exception is thrown in the try, if yes, chain any exception thrown in the finally block to the original exception. I know I can do this on a case-by-case basis by storing the exception caught and then manually chaining it in the finally block. I was looking for something more generic/applicable to all finally blocks.
Thanks.
- Saish

Thanks JSchell, have done that many times in the past.
I was looking for a more generic (not generics) solution to the problem. So that an error handler could be written to automatically chain exceptions thrown in the finally clause (granted, one still needs to invoke the error handler). My hope was the stack in the finally clause would look different if an exception was thrown in the try block versus none at all.
- Saish

Similar Messages

  • Determining Exception in finally clause

    Is it possible to determine if an Exception has been thrown in a finally clause?
    This is in reaction to the anti-pattern log and throw.
    Bad:
    try
        someCall();
    catch (someException e)
        log(e.getMessage());
        throw someException("oops", e);
    }What I want:
    try
        someCall();
    finally
        boolean exceptionThrown = magicHere();
        if (exceptionThrown)
            // get the exception message, log the message
    }of course, this may be an anti-pattern as well.

    The 'Log and throw' antipattern just says that you should either log or throw, not both, i.e. that somebody somewhere must catch and absorb the exception, log it, and do something about it, and that that somebody should be unique. Logging it more than once doesn't add anything useful to the log and it also destroys the original stack trace. If you need to know whether an exception occurred here, the antipattern implies that you should logging it here and doing something about it here.
    But I agree that antipatterns aren't set in stone, and once you set out the underlying assumptions as above it is easy to devise counter-examples where they don't apply.

  • Exception thrown in a midlet constuctor

    The following message is being displayed each on my curve 8310 each time I try to launch java applications.
    "Uncaught exception: Exception thrown in a midlet constuctor"
    It happens for all java apps and re-installing them doesn't help.
    Does anyone know if it is possible to fix this problem without re-installing the OS?  I don't want to risk losing my application data. 

    Nee333 wrote:
    I have a web service created in JAVA.. The modules throw certain exceptions and i am having auto generated JSP created from the WSDL's , which i can obviously edit. i want to catch these exceptions in this JSP page.. Any clue how to do this? It is not possible to catch the Exception in a JSP. You can however put any logging or even an if statement into your JSP to display the error or control the flow based on the error.

  • Return in finally block hides exception in catch block

    Hi,
    if the line marked with "!!!" is commented out, the re-thrown exception is not seen by the caller (because of the return in the finally block). If the line is commented in, it works as I would expect. Is this is bug or a feature? I assume the return removes the call to troubleMaker() from the call stack - including the associated exception...
    Christian Treber
    [email protected]
    public class ExceptionDemo extends TestCase
    public void testException()
    String lResult = "[not set]";
    try
    lResult = troubleMaker();
    System.out.println("No exception from troubleMaker()");
    } catch(Exception e)
    System.out.println("Caught an exception from troubleMaker(): " + e);
    System.out.println("Result: " + lResult);
    public String troubleMaker()
    boolean lErrorP = false;
    try
    if(6 > 5)
    throw new RuntimeException("Initial exception");
    return "normal";
    } catch (RuntimeException e)
    System.out.println("Caught runtime exception " + e);
    lErrorP = true;
    throw new RuntimeException("Exception within catch");
    } finally
    System.out.println("Finally! Error: " + lErrorP);
    if(!lErrorP)
    return "finally";

    This is specified in the Java Language Specification, section 14.19.2 .
    -- quote
    If execution of the try block completes abruptly because of a throw of a value V, then there is a choice:
    * If the run-time type of V is assignable to the parameter of any catch clause of the try statement, then the first (leftmost) such catch clause is selected. The value V is assigned to the parameter of the selected catch clause, and the Block of that catch clause is executed. Then there is a choice:
    o If the catch block completes normally, then the finally block is executed. Then there is a choice:
    + If the finally block completes abruptly for any reason, then the try statement completes abruptly for the same reason.
    -- end quote
    "completing abruptly" (in this instance) means a throw or a return, as specified in section 14.1
    Ok? It's not a bug, it's the defined behaviour of the language. And when you think about it, this behaviour gives you the option to do what you want in your finally block.

  • Catching an exception thrown from another thread

    I have a SocketServer that creates new threads to handle incoming clients. If one of the threads throw a SQLException is it possible to catch that exception in the SocketServer that created that thread.
    I tried implementing this code and I cannot get the server to catch an exception thrown in the thread. Are my assumptions correct?
    I was reading something about Thread Groups and implementing an uncoughtException() method, but this looked like overkill.
    Thanks for your time!
    Some Example code would be the following where the ClientThread will do a database query which could cause an SQLException. I'd like to catch that exception in my Socket Server
          try
                 new ClientThread( socketServer.accept() , host, connection ).start();
          catch( SQLException e )
                 System.out.println( "DataSource Connection Problem" );
                  e.printStackTrace();
          }

    hehe, why?
    The server's job is to listen for an incoming message from a client and pass it off to a thread to handle the client. Otherwise the server will have to block on that incoming port untill it has finished handling the client and usually there are many incoming clients continuously.
    The reason I would want to catch an exception in the server based on the SQLException thrown in the thread is because the SQLException is usually going to be due to the fact the datasource connection has become unavalable, or needs to be refreshed. This datasource connection is a private variable stored in the socket server. The SocketServer now needs to know that it has to refresh that datasource connection. I would normally try to use somesort of flag to set the variable but to throw another wrench into my dilemma, the SocketServer is actually its own thread. So I can't make any of these variables static, which means I can't have the thread call a method on teh socket server to change the status flag. :)
    I guess I need implement some sort of Listener that the thread can notify when a datasource connection goes down?
    Thanks for the help so far, I figured java would not want one thread to catch another thread's exceptions, but I just wanted to make sure.

  • Client side handling of exceptions thrown by a webservice

    I have a webservice that is deployed in Tomcat 5.5 running on Windows XP, Java version is 1.5, using jwsdp 1.5. My client, when run as an applet in a browser (have tried IE 6 and FireFox 1), seems to be unable to parse any exception thrown from the webservice. Instead the following exception is caught by the client:
    ==========================================================
    Checking the security service exception that occurred [Runtime exception; nested exception is:
    XML parsing error: com.sun.xml.rpc.sp.ParseException:1: Document root element is missing]
    com.irista.security.services.data.SecurityServiceException: Runtime exception; nested exception is:
    XML parsing error: com.sun.xml.rpc.sp.ParseException:1: Document root element is missing
    at com.irista.security.services.webclient.SecurityServiceProxy.removeAuthenticatio nProfile(SecurityServiceProxy.java:1276)
    at com.irista.security.ui.applet.AuthenticationProfilesListPanel.deleteAction(Auth enticationProfilesListPanel.java:131)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.irista.ui.webapp.framework.WebAppletPane.performAction(WebAppletPane.java:1 80)
    at com.irista.ui.webapp.framework.WebAppletPane.performAction(WebAppletPane.java:1 51)
    at com.irista.ui.webapp.framework.WebAppToolbar$ButtonActionListener.actionPerform ed(WebAppToolbar.java:368)
    at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
    at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
    at java.awt.Component.processMouseEvent(Unknown Source)
    at javax.swing.JComponent.processMouseEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
    ==========================================================
    If I run the client outside of a browser it catches the exception that is actually thrown by the webservice.
    Is there possibly a problem with the java 5 plugin handling exceptions thrown by webservices?
    I have not found any bug reports or forumn posts regarding this so any assistance would be greatly appreciated.
    thanks,
    scott

    Thanks for the reply, here is what the printStackTrace() output:
    java.rmi.RemoteException: Runtime exception; nested exception is:
         XML parsing error: com.sun.xml.rpc.sp.ParseException:1: Document root element is missing
         at com.sun.xml.rpc.client.StreamingSender._handleRuntimeExceptionInSend(StreamingSender.java:318)
         at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:300)
         at com.irista.security.services.webservice.SecurityServiceIF_Stub.removeAuthenticationProfile(SecurityServiceIF_Stub.java:1963)
         at com.irista.security.services.webclient.SecurityServiceProxy.removeAuthenticationProfile(SecurityServiceProxy.java:1266)
         at com.irista.security.ui.applet.AuthenticationProfilesListPanel.deleteAction(AuthenticationProfilesListPanel.java:131)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at com.irista.ui.webapp.framework.WebAppletPane.performAction(WebAppletPane.java:180)
         at com.irista.ui.webapp.framework.WebAppletPane.performAction(WebAppletPane.java:151)
         at com.irista.ui.webapp.framework.WebAppToolbar$ButtonActionListener.actionPerformed(WebAppToolbar.java:368)
         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
         at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
         at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at javax.swing.JComponent.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    Caused by: XML parsing error: com.sun.xml.rpc.sp.ParseException:1: Document root element is missing
         at com.sun.xml.rpc.streaming.XMLReaderImpl.next(XMLReaderImpl.java:120)
         at com.sun.xml.rpc.streaming.XMLReaderBase.nextContent(XMLReaderBase.java:23)
         at com.sun.xml.rpc.streaming.XMLReaderBase.nextElementContent(XMLReaderBase.java:41)
         at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:123)
         ... 34 more

  • Exception thrown while trying to connect to Primavera using Web service.

    Dear all,
         We are trying to connect primavera from a .net application using Web service.It is working fine with P6 V7, but while trying to connect to V.8 there is an exception thrown by SoapHeaderException.
    The Contents in the Exception is like this
    System.Web.Services.Protocols.SoapHeaderException: This class does not support SAAJ 1.1
       at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
       at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
       at Primavera.AuthenticationService.AuthenticationService.Login(Login Login1) in E:\Manesh\Code\PROTOTYPES\PrimaveraAuthentrication\SampleDemo\Web References\AuthenticationService\Reference.cs:line 100
       at Primavera.Form1.TestConnection(String& sErr) in E:\Manesh\Code\PROTOTYPES\PrimaveraAuthentrication\SampleDemo\Form1.cs:line 66
    Here i am specifying the C# code which makes the above exception
    public int TestConnection(ref string sErr)
                try
                    AuthenticationService.AuthenticationService authService = new AuthenticationService.AuthenticationService();               
                    try
                        authService.Url = Url;
                        authService.CookieContainer = new CookieContainer();
                        AuthenticationService.Login lg = new AuthenticationService.Login();
                        lg.UserName = LoginName;
                        lg.Password = Password;
                        lg.DatabaseInstanceId = 1;
                        lg.DatabaseInstanceIdSpecified = true;
                       AuthenticationService.LoginResponse lp = authService.Login(lg);   //This line which makes the exception
                        cookieContainer = authService.CookieContainer;                  
                    finally
                        if (authService != null)
                            authService.Dispose();                  
                    return 1;               
                catch (Exception eX)
                    return -1;
    We are looking forward for a solution
    Thanks in Advance.
    Regards
    Jinosh

    http://otn.oracle.com/tech/java/sqlj_jdbc/htdocs/jdbc_faq.htm#_59_
    The thin drivers are classes12.zip/classes111.zip. classes12.zip being the most recent release. You can download it from
    http://otn.oracle.com/software/tech/java/sqlj_jdbc/htdocs/winsoft.html
    (the general download site is http://otn.oracle.com/software/tech/java/sqlj_jdbc/content.html )
    Jamie

  • SDK: Uncaught exception thrown in native code

    We are using java and the DQM SDK, our XML validates and while we are trying to create a MultiRecordTransform, we get the following exception with no information to help diagnose the issue.
    com.sap.emdq.EmdqException: Uncaught exception thrown in native code
    We are using the dquractransformu shared object and have NCOALink enabled.  We have successfully used the URAC transform without NCOALink.  We receive no other errors or logs when starting up, and if we turn off NCOALink, it gets past creating the MR transform.
    Is there any other information we can get to help us determine what the issue is?

    FYI: We found our setting in the XML that enabled NCOA processing to begin ( <PROVIDER_TYPE> ), but it would be much easier if the error indicated what was missing, instead of the generic "Uncaught exception thrown in native code".  Maybe there is a config setting to get more informative exception messages?

  • Exception thrown in EJB not captured in ManagedBean

    Hi. Im new in community.
    I have an EE project using JSF 1.2, EJB 3.0 deployed in Weblogic 10.3.6.
    My EJB that throws an Exception that is captured in my ManagedBean. However the exception does not reach to my ManagedBean.
    This exception should reload the page with an error message stating that the group already exists, but as the exception does not reach the ManagedBean, the page is not displayed with the error message.
    I appreciate the help. Rgrds.
    My web.xml
      <error-page>
        <exception-type>java.lang.Exception</exception-type>
        <location>/PRErrorPageView.faces</location>
      </error-page>
    My EJB:
    try {
                List<Grupo> grupos = findGrupoByName(grupo.getNomeGrupo());
                if (!grupos.isEmpty() && !alteraPermissao)
                    throw new GrupoException("msgErroGrupoNomeCadastrado");
    My ManagedBean:
    Here is the call of my EJB
    grupoServices.persisteGrupo(grupo, listCR, listCC, listCM, listCP, listMo, alteraGrupo, codigoTela, codigoUsuarioLogado);         
    cancelar();
    FacesUtil.addSuccessMessage("Grupo criado com sucesso!");
    } catch (GrupoException e) {
    logger.warning(e.getMsg());
    FacesUtil.addErrorMessage(e.getMsg());
    My class GrupoException:
    public class GrupoException extends ComponentException{
        /** The serialVersionUID */
        private static final long serialVersionUID = -6912605895523623154L;
            public GrupoException(String key){
            super(key);
    My ComponentException:
    public class ComponentException extends RuntimeException{
        /** The serialVersionUID */
        private static final long serialVersionUID = -2534006938034008594L;
        private String            msg;
        public ComponentException(String key) {
            String msgBundle = ResourcesUtil.getString(ResourcesUtil.MENSAGENS_FILE, key);
            this.msg = msgBundle;
    Weblogic log:
    ]] Root cause of ServletException.
    javax.faces.FacesException: #{cadastroGrupo.gravar}: javax.ejb.EJBException: EJB Exception: : br.com.telefonica.portal.services.exceptions.GrupoException
        at br.com.telefonica.portal.services.impl.GrupoServiceImpl.persisteGrupo(GrupoServiceImpl.java:93)
        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 com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
        at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
        at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
        at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
        at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
        at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at com.oracle.pitchfork.spi.MethodInvocationVisitorImpl.visit(MethodInvocationVisitorImpl.java:34)
        at weblogic.ejb.container.injection.EnvironmentInterceptorCallbackImpl.callback(EnvironmentInterceptorCallbackImpl.java:54)
        at com.oracle.pitchfork.spi.EnvironmentInterceptor.invoke(EnvironmentInterceptor.java:42)
        at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at com.bea.core.repackaged.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
        at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
        at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
        at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
        at $Proxy87.persisteGrupo(Unknown Source)
        at br.com.telefonica.portal.services.impl.GrupoServiceImpl_k21zc8_GrupoServicesLocalImpl.__WL_invoke(Unknown Source)
        at weblogic.ejb.container.internal.SessionLocalMethodInvoker.invoke(SessionLocalMethodInvoker.java:39)
        at br.com.telefonica.portal.services.impl.GrupoServiceImpl_k21zc8_GrupoServicesLocalImpl.persisteGrupo(Unknown Source)
        at br.com.telefonica.portal.web.views.CadastroGrupoBean.gravar(CadastroGrupoBean.java:310)
        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 com.sun.el.parser.AstValue.invoke(AstValue.java:187)
        at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:297)
        at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
        at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
        at javax.faces.component.UICommand.broadcast(UICommand.java:387)
        at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
        at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:756)
        at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
        at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
        at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
        at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
        at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
        at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:301)
        at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3730)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3696)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
        at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2273)
        at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179)
        at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1490)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
    ; nested exception is: br.com.telefonica.portal.services.exceptions.GrupoException
        at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:118)
        at javax.faces.component.UICommand.broadcast(UICommand.java:387)
        at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
        at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:756)
        at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
        Truncated. see log file for complete stacktrace
    Caused By: javax.faces.el.EvaluationException: javax.ejb.EJBException: EJB Exception: : br.com.telefonica.portal.services.exceptions.GrupoException
        at br.com.telefonica.portal.services.impl.GrupoServiceImpl.persisteGrupo(GrupoServiceImpl.java:93)
        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 com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
        at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
        at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
        at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
        at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
        at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at com.oracle.pitchfork.spi.MethodInvocationVisitorImpl.visit(MethodInvocationVisitorImpl.java:34)
        at weblogic.ejb.container.injection.EnvironmentInterceptorCallbackImpl.callback(EnvironmentInterceptorCallbackImpl.java:54)
        at com.oracle.pitchfork.spi.EnvironmentInterceptor.invoke(EnvironmentInterceptor.java:42)
        at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at com.bea.core.repackaged.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
        at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
        at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
        at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
        at $Proxy87.persisteGrupo(Unknown Source)
        at br.com.telefonica.portal.services.impl.GrupoServiceImpl_k21zc8_GrupoServicesLocalImpl.__WL_invoke(Unknown Source)
        at weblogic.ejb.container.internal.SessionLocalMethodInvoker.invoke(SessionLocalMethodInvoker.java:39)
        at br.com.telefonica.portal.services.impl.GrupoServiceImpl_k21zc8_GrupoServicesLocalImpl.persisteGrupo(Unknown Source)
        at br.com.telefonica.portal.web.views.CadastroGrupoBean.gravar(CadastroGrupoBean.java:310)
        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 com.sun.el.parser.AstValue.invoke(AstValue.java:187)
        at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:297)
        at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
        at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
        at javax.faces.component.UICommand.broadcast(UICommand.java:387)
        at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
        at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:756)
        at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
        at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
        at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
        at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
        at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
        at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:301)
        at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3730)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3696)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
        at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2273)
        at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179)
        at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1490)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
    ; nested exception is: br.com.telefonica.portal.services.exceptions.GrupoException
        at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:102)
        at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
        at javax.faces.component.UICommand.broadcast(UICommand.java:387)
        at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
        at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:756)
        Truncated. see log file for complete stacktrace
    Caused By: javax.ejb.EJBException: EJB Exception: : br.com.telefonica.portal.services.exceptions.GrupoException
        at br.com.telefonica.portal.services.impl.GrupoServiceImpl.persisteGrupo(GrupoServiceImpl.java:93)
        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 com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
        at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
        at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
        at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
        at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
        at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at com.oracle.pitchfork.spi.MethodInvocationVisitorImpl.visit(MethodInvocationVisitorImpl.java:34)
        at weblogic.ejb.container.injection.EnvironmentInterceptorCallbackImpl.callback(EnvironmentInterceptorCallbackImpl.java:54)
        at com.oracle.pitchfork.spi.EnvironmentInterceptor.invoke(EnvironmentInterceptor.java:42)
        at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at com.bea.core.repackaged.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
        at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
        at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
        at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
        at $Proxy87.persisteGrupo(Unknown Source)
        at br.com.telefonica.portal.services.impl.GrupoServiceImpl_k21zc8_GrupoServicesLocalImpl.__WL_invoke(Unknown Source)
        at weblogic.ejb.container.internal.SessionLocalMethodInvoker.invoke(SessionLocalMethodInvoker.java:39)
        at br.com.telefonica.portal.services.impl.GrupoServiceImpl_k21zc8_GrupoServicesLocalImpl.persisteGrupo(Unknown Source)
        at br.com.telefonica.portal.web.views.CadastroGrupoBean.gravar(CadastroGrupoBean.java:310)
        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 com.sun.el.parser.AstValue.invoke(AstValue.java:187)
        at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:297)
        at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
        at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
        at javax.faces.component.UICommand.broadcast(UICommand.java:387)
        at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
        at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:756)
        at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
        at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
        at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
        at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
        at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
        at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:301)
        at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3730)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3696)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
        at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2273)
        at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179)
        at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1490)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
    ; nested exception is: br.com.telefonica.portal.services.exceptions.GrupoException
        at weblogic.ejb.container.internal.EJBRuntimeUtils.throwEJBException(EJBRuntimeUtils.java:156)
        at weblogic.ejb.container.internal.BaseLocalObject.handleSystemException(BaseLocalObject.java:887)
        at weblogic.ejb.container.internal.BaseLocalObject.handleSystemException(BaseLocalObject.java:818)
        at weblogic.ejb.container.internal.BaseLocalObject.postInvoke1(BaseLocalObject.java:517)
        at weblogic.ejb.container.internal.BaseLocalObject.__WL_postInvokeTxRetry(BaseLocalObject.java:455)
        Truncated. see log file for complete stacktrace
    Caused By: br.com.telefonica.portal.services.exceptions.GrupoException
        at br.com.telefonica.portal.services.impl.GrupoServiceImpl.persisteGrupo(GrupoServiceImpl.java:93)
        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)
        Truncated. see log file for complete stacktrace

    Tao,
              > If your ejb method is in a transaction context, then you throw application
              exception, the container will try to commit the transaction.
              In the case of an application exception, the caller will be responsible for
              committing or rolling back the transaction. (A runtime exception will roll
              back the transaction automatically.) That is why, if you use CMT, that the
              EJB methods call from outside the EJB container (such as from a servlet)
              should never be able to throw runtime exceptions.
              Peace,
              Cameron Purdy
              Tangosol, Inc.
              http://www.tangosol.com
              +1.617.623.5782
              WebLogic Consulting Available
              "Tao Zhang" <[email protected]> wrote in message
              news:3a33c04a$[email protected]..
              >
              > Hi,
              > It's ok because you look after the transaction yourself. probably you use
              the default transaction attribute 'Supports'.
              >
              > If your ejb method is in a transaction context, then you throw application
              exception, the container will try to commit the transaction.
              >
              > Hope this can help.
              > Tao Zhang
              >
              > "Gormless" <[email protected]> wrote:
              > >
              > >When I throw an application exception from within a statless session bean
              which uses jdbs for DB Lookup Only I get
              > >"Exception thrown in non-transactional EJB invoke".
              > >
              > >As this is a llokup only I have no Transaction Management
              >
              

  • Exception thrown from servlet function

    Hi,
    I have a servlet "main.java" which connects to a database and displays a table. The table contains a check box in front of each table row. It has three buttons at the bottom "add" modify" "delete". When the user clicks on some check boxes and clicks on "delete" button how can i know in the script delete.java that these are the check boxes that have been checked or selected. I tried to do in the following way
                           String[] checkedBoxes = new String[100];
                           checkedBoxes = req.getParameterValues("sel");where sel is the name of the checkboxes
    but I am getting the following error:
    [21/Aug/2001:10:36:54] failure ( 1118): Internal error: exception thrown from the servlet service function (uri=/servlet/delete.class):java.lang.NullPointerException, Stack: java.lang.NullPointerException
    Any help would be appreciated.
    Thanks

    Does every checkbox have the same name, i.e. "sel".
    In this case you're dealing with a checkbox group. Similar to a select-style dropdown or radio button group.
    I know I've had problems with dropdowns in Netscape where the select parameter was not being passed at all, so I'd get null values. I got around this by having the form submission re-assign the value from the select list to a hidden variable and then getting the value from the request.getParameter("hiddenFieldName") instead of the "dropdownFieldName".
    You could try to name each checkbox individually using an appended ID, such as sel1, sel2, etc. and then have these parameters picked up using a loop construct, request.getParameter("sel" + i) -- you may want to pass some value back that would also indicate how many total checkboxes you had so you could determine how many iterations of the loop to go through.
    On the form side, you could probably set the checkboxes up using a similar looping mechanism so that you wouldn't have to explicitly write each checkbox name.
    If this is in fact similar to the Netscape issue I was having with dropdowns, I'd be interested to hear if it'll work in IE.
    I got a bit off-topic, but hope it helps.

  • ERROR: ProviderCaller.run(): exception thrown from IMChannel

    Not sure whether this is better addressed here or in the Instant Messaging forum.
    Basically we're having a problem with the presence service in Portal Server, and it throws a huge exception stack when you do anything except have a blank contact list with noone logged in.
    Portal Server, Access Manager, and IM Server are all installed on the same server in this configuration, and I've tried applying patches to the IM Server APIs to fix the problems to no avail.
    JES 2005Q1
    IM Server patched: 118787-01 118790-01
    Portal server unpatched
    Basically all of this is still a default install, with only minimal customization so customers don't have to configure anything.
    tail -f /var/opt/SUNWam/debug/desktop.debug says:
    07:34:25,192 INFO xmppd [com.sun.im.service.util.Worker 4] Authenticating using Identity Server SSO
    06/20/2005 07:34:25:310 AM PDT: Thread[Thread-677,5,main]
    ERROR: ProviderCaller.run(): exception thrown from IMChannel
    com.sun.portal.providers.ProviderException: JSPProvider.processJSPFile(): jsp=IMContent.jsp, java.lang.NoSuchMethodError: org.jaxen.BaseXPath.<init>(Ljava/lang/String;Lorg/jaxen/Navigator;)V
    at com.sun.portal.providers.jsp.JSPProvider.processJspFile(JSPProvider.java:916)
    at com.sun.portal.providers.jsp.JSPProvider.processJspFile(JSPProvider.java:810)
    at com.sun.portal.providers.jsp.JSPProvider.getContent(JSPProvider.java:579)
    at com.sun.im.portal.provider.IMProvider.getContent(IMProvider.java:94)
    at com.sun.portal.desktop.context.ReusableProviderCaller.run(ReusableProviderCaller.java:160)
    java.lang.NoSuchMethodError: org.jaxen.BaseXPath.<init>(Ljava/lang/String;Lorg/jaxen/Navigator;)V
    at net.outer_planes.jso.xpath.JSOXPath.<init>(JSOXPath.java:81)
    at net.outer_planes.jso.xpath.JSOXPath.<init>(JSOXPath.java:78)
    at net.outer_planes.jso.DataFactory.createXPath(DataFactory.java:128)
    at net.outer_planes.jso.DataFactory.createXPath(DataFactory.java:117)
    at net.outer_planes.jso.AbstractElement.getLocaleXPath(AbstractElement.java:175)
    at net.outer_planes.jso.AbstractElement.findElementsForLocale(AbstractElement.java:629)
    at net.outer_planes.jso.AbstractElement.findElementsForLocale(AbstractElement.java:626)
    at net.outer_planes.jso.PresencePacket.getStatus(PresencePacket.java:155)
    at net.outer_planes.jso.PresencePacket.getStatus(PresencePacket.java:152)
    at com.sun.im.service.xmpp.XMPPPresenceService.getPresence(XMPPPresenceService.java:374)
    at com.sun.im.service.xmpp.XMPPPresenceService.fetchPresence(XMPPPresenceService.java:164)
    at com.sun.im.service.xmpp.XMPPPresenceSession.fetch(XMPPPresenceSession.java:47)
    at com.sun.im.service.xmpp.XMPPPresenceSession.fetch(XMPPPresenceSession.java:55)
    at com.sun.im.portal.taglib.GetContactGroupTag.doStartTag(GetContactGroupTag.java:51)
    at jsps.etc._opt._SUNWps._desktop._sampleportal_en_US._IMChannel._html._IMContent_jsp._jspService(_IMContent_jsp.java:799)
    at com.sun.portal.providers.jsp.jasper3.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
    at com.sun.portal.providers.jsp.JspServletWrapper.service(JspServletWrapper.java:182)
    at com.sun.portal.providers.jsp.JSPProvider.processJspFile(JSPProvider.java:896)
    at com.sun.portal.providers.jsp.JSPProvider.processJspFile(JSPProvider.java:810)
    at com.sun.portal.providers.jsp.JSPProvider.getContent(JSPProvider.java:579)
    at com.sun.im.portal.provider.IMProvider.getContent(IMProvider.java:94)
    at com.sun.portal.desktop.context.ReusableProviderCaller.run(ReusableProviderCaller.java:160)
    We're looking to implement JES in the next month or so. I've seen mention of this error with other jaxen flavors, but none mentioning the JES Instant Messaging or Portal Servers

    Does every checkbox have the same name, i.e. "sel".
    In this case you're dealing with a checkbox group. Similar to a select-style dropdown or radio button group.
    I know I've had problems with dropdowns in Netscape where the select parameter was not being passed at all, so I'd get null values. I got around this by having the form submission re-assign the value from the select list to a hidden variable and then getting the value from the request.getParameter("hiddenFieldName") instead of the "dropdownFieldName".
    You could try to name each checkbox individually using an appended ID, such as sel1, sel2, etc. and then have these parameters picked up using a loop construct, request.getParameter("sel" + i) -- you may want to pass some value back that would also indicate how many total checkboxes you had so you could determine how many iterations of the loop to go through.
    On the form side, you could probably set the checkboxes up using a similar looping mechanism so that you wouldn't have to explicitly write each checkbox name.
    If this is in fact similar to the Netscape issue I was having with dropdowns, I'd be interested to hear if it'll work in IE.
    I got a bit off-topic, but hope it helps.

  • Why StorageFolder.CreateFileAsync(String) creates file fail without any exception thrown?

    I need to develop a windows phone store app to test file system. And I use
    StorageFolder.CreateFileAsync to create a file on ApplicationData.Current.LocalFolder path and write
    1MB text content, and read it, modify it, and re-write it. But after about 5000 times write/read.I found that the applicaition blocked at
    StorageFolder.CreateFileAsync through a test method of log. However, there isn't any exception thrown. Why did the
    StorageFolder.CreateFileAsync  fail? And how to solve this problem? We need to write/read about 150000 times.

    Hi jinchanglin,
    Have you ever tried with profiling the app while debug the app,
    Analyze app performance and
    Analyze memory usage (VB, C#, C++)
    Is it possible that CPU or memory usage reach to the limitation as you need execute the same code with nearly 150,000 times. Also you mentioned, 5000 times is ok, personally I think the code is fine, but you may need to care more about performance behavior.
    As I know if you are working with a Phone device, there is some limitation for memory usage, you cannot let your app use more memory set than that value, try to find the limitation from
    AppMemoryUsageLimit | appMemoryUsageLimit property
    --James
    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support
    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

  • Client Drops - No Exception Thrown

    Hi All,
    I have a client server application which has been tested extensively and works fine. I have recently migrated the server to a linux environment (it was on windows) and now am experiencing a problem.
    Any exception thrown in the client is programmed to be caught and displayed, as well as emailed to me. I am experiencing problems with one of the clients, they are being dropped after sending and receiving a couple of objects to the server - no exception is thown and no error log is created. It is at the same point every time - about 2 seconds after they connect. On the server side a java.net.SocketException: Broken pipe is thrown when it tries to send the second object to the client (the first data transfer always goes through fine). This is the only client experiencing this issue, it happens at the same spot everytime for them and it works for them when the server is hosted on a windows machine. It's frustrating because even when I run this client from the command line no exception is thrown (even though the part where it fails is in a try catch block), and no error log is created - it simply stops running therefore I don't know how to debug it.

    Presumably you are catching throwable.
    It is quite possible that one end is closing down correctly (so no exception) while the other end is expecting something else to happen and thus an exception occurs.
    If you are sending messages, not data, and there are no message errors then this is not a problem. Simply catch the exception, note in the code that it not a problem, and eat it.

  • Jdev11g: Possibility to determine component which has the focus ?

    Hi,
    we have a customer request to display (internal) informations about the field and the corresponding VO which has the cursor focus at the moment (for problem analysis purpose)
    If the mouse cursor is in an input field and the user press a button or select a context menu he want to see this information e.g. in a popup.
    Is it possible to determine the component ID of the field which has the focus? (hopefully the input field does not loos the focus if user opens e.g. the context menue)
    If yes, whats the best way to find from the component ID to the corresponding VO?
    11g, ADF BC
    regards
    Peter

    Peter, sorry for the mix up.
    getContextComponent(..) is one of my private helper methods for a special case. I think you don't need it in your case. Check the UIComponent you get back from actionEvent.getSource() if it's the input field you are looking for, if not check its parent.
    In my method I walk down the component tree to get a special component I'm interested in.
    Heres the code:    private UIComponent getContextComponent(UIComponent aUI)
            try
                UIComponent ui3 = aUI.getParent().getParent();
                Map<String, Object> attr = ui3.getAttributes();
                String obj2 = (String) attr.get("_launchId");
                UIComponent uiXXXX = JSFUtils.findComponentInRoot((String) obj2);
                if (uiXXXX.getChildCount() > 0)
                    UIComponent uiC = uiXXXX.getChildren().get(0);
                    return uiC;
                else
                    return uiXXXX;
            catch (Exception e)
            return null;
        }Timo

  • Uncaught exceptions thrown in overridden ThreadGroup.uncaughtException

    Hi,
    To process uncaught exceptions in threads I spawn, I have created a ThreadGroup and overridden the uncaughtException method. This works flawlessly, but it brought up the following question:
    What happens to an exception that is thrown in an overridden uncaughtException method that is not caught?
    I assumed that an uncaught exception in an uncaughtException method would call the uncaughtException method in the parent thread group, but this does not seem to be the case. The uncaught exception just seems to disappear.
    Can somebody please confirm my finding that an uncaught exception thrown there just disappears and does not get handled anywhere else? Can somebody point me to the right sections of the Java Language Specs or the JVM Specs that deal with this issue?
    Below is a test program that I wrote to investigate. It throws an exception in an "outer thread", part of an "outer group" thread group; an exception in an "inner thread", part of an "inner group" thread group; and an exception in the uncaughtException method of the "inner group" thread group. I expected that the first two invoke the uncaughtException of the "outer group", while the last one invokes the method of the "inner group". Contrary to my expectations, the exception thrown in the uncaughtException method of the "inner group" does not seem to invoke anything.
    Thanks in advance.
    Yours,
    --Mathias
    public class ThrowInUncaughtExceptionHandler {
    public static void main(String[] args) {
    (new ThrowInUncaughtExceptionHandler()).run();
    public void run() {
    ThreadGroup outerGroup = new ThreadGroup("outer") {
    public void uncaughtException(Thread t, Throwable e) {
    System.out.println("in outerGroup.uncaughtException: "+e);
    final Thread outerThread = new Thread(outerGroup, new Runnable() {
    public void run() {
    System.out.println("in outerThread.run");
    System.out.println("\tthread group: "+Thread.currentThread().getThreadGroup());
    System.out.flush();
    ThreadGroup innerGroup = new ThreadGroup("inner") {
    public void uncaughtException(Thread t, Throwable e) {
    System.out.println("in innerGroup.uncaughtException: "+e);
    System.out.println("\tthrowing another exception...");
    throw new RuntimeException("thrown in innerGroup.uncaughtException");
    final Thread innerThread = new Thread(innerGroup, new Runnable() {
    public void run() {
    System.out.println("in innerThread.run");
    System.out.println("\tthread group: "+Thread.currentThread().getThreadGroup());
    System.out.flush();
    throw new RuntimeException("thrown in innerThread");
    innerThread.start();
    try { innerThread.join(); }
    catch(InterruptedException ioe) { /* ignore */ }
    throw new RuntimeException("thrown in outerThread");
    outerThread.start();
    }

    Hi tigerxx:
    Thank you for your reply. Unfortunately, your suggestion does not help. I had tried it already, even though according to the Java API Javadocs, this is not necessary anyway: If no thread group is specified as parent of a thread group, then the current thread's thread group is used. Since innerGroup is created by a thread in outerGroup, innerGroup's parent is outerGroup.
    Thanks again, though, for taking the time to read and reply.
    --Mathias                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Maybe you are looking for