-
Followers
viktorklang (Assigned To) , Jonas Bonér , Peter Vlugter , piotr.findeisen
AttachmentsNo attachmentsAssociationsNo associationsActivity
on Feb 14, 2012 @ 02:34pm UTC * By piotr.findeisen
Description changed from The method <pre><code>akk... to The method <pre><code>akk...
on Feb 14, 2012 @ 02:36pm UTC * By piotr.findeisen
Description changed from The method <pre><code>akk... to The method <pre><code>akka....As a workaround one can writetry { akka.dispatch.Await.result(future, duration) if (Boolean.FALSE) throw new java.util.concurrent.TimeoutException("this will never be thrown"); } catch (java.util.concurrent.TimeoutException e) { .... }
but i bet this is not was intended here
on Feb 14, 2012 @ 02:40pm UTC * By piotr.findeisen
Btw. is thejava.lang.InterruptedExceptionthrown too?
on Feb 14, 2012 @ 02:45pm UTC * By piotr.findeisen
Summary changed from Await.result throws checked excepception but does not declare it to Await.result throws checked exception but does not declare it
on Feb 14, 2012 @ 02:47pm UTC * By piotr.findeisen
Hm... maybe it is by design? ApparentlyTypedActoralso features this philosophy:java.lang.reflect.UndeclaredThrowableException at $Proxy42.submit(Unknown Source) at com.example.ActorConsumer.init(ActorConsumer.java:37) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.beans.factory.support.DisposableBeanAdapter.invokeCustomDestroyMethod(DisposableBeanAdapter.java:300) at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:226) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:498) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:474) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:442) at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1066) at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1040) at org.springframework.context.support.AbstractApplicationContext$1.run(AbstractApplicationContext.java:958) Caused by: akka.pattern.AskTimeoutException at akka.pattern.AskSupport$class.ask(AskSupport.scala:75) at akka.pattern.package$.ask(package.scala:43) at akka.actor.TypedActor$TypedActorInvocationHandler.invoke(TypedActor.scala:364) ... 16 more
on Feb 16, 2012 @ 09:58am UTC * By Patrik Nordwall
We have to add@throws(classOf[Throwable])
to the signature. It is not only for the TimeoutException, but the actual future can be completed with a checked exception, that should be possible to catch here. It will be extremely ugly in the callertry { String result = (String) Await.result(f, Duration.create(1, SECONDS)); } catch (TimeoutException e) { } catch (Throwable t) { }
on Feb 16, 2012 @ 12:36pm UTC * By viktorklang
Assigned to set to viktorklangStatus changed from New to Test
on Feb 19, 2012 @ 10:50pm UTC * By viktorklang
Status changed from Test to FixedTime ExpenditureLoading
throws checked exception
java.util.concurrent.TimeoutExceptionbut does not declare it when used from Java code. I.e. the following does not compile:However the
java.util.concurrent.TimeoutExceptionis indeed thrown when timeout occurs.