- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
AbstractPartialFunction throws NPE
Wed, 2012-01-25, 14:04
Hi,
After rebuilding Play 2.0 with Scala virtualized (which follows very closely master) I ran tests and got:
java.lang.NullPointerException: null at scala.runtime.AbstractPartialFunction.orElse(AbstractPartialFunction.scala:41) ~[scala-library.jar:0.11.2] at akka.routing.Router$class.receive(Routing.scala:130) ~[akka-actor-2.0-M2.jar:2.0-M2] at akka.routing.RouterConfig$$anon$1.receive(Routing.scala:85) ~[akka-actor-2.0-M2.jar:2.0-M2] at akka.actor.Actor$class.$init$(Actor.scala:291) ~[akka-actor-2.0-M2.jar:2.0-M2] at akka.routing.RouterConfig$$anon$1.<init>(Routing.scala:85) ~[akka-actor-2.0-M2.jar:2.0-M2] at akka.routing.RouterConfig$class.createActor(Routing.scala:85) ~[akka-actor-2.0-M2.jar:2.0-M2] at akka.routing.RoundRobinRouter.createActor(Routing.scala:204) ~[akka-actor-2.0-M2.jar:2.0-M2] at akka.routing.RoutedActorRef$$anonfun$$init$$1.apply(Routing.scala:19) ~[akka-actor-2.0-M2.jar:2.0-M2] at akka.routing.RoutedActorRef$$anonfun$$init$$1.apply(Routing.scala:19) ~[akka-actor-2.0-M2.jar:2.0-M2] at akka.actor.ActorCell.newActor(ActorCell.scala:340) ~[akka-actor-2.0-M2.jar:2.0-M2] at akka.actor.ActorCell.create$1(ActorCell.scala:357) ~[akka-actor-2.0-M2.jar:2.0-M2] at akka.actor.ActorCell.systemInvoke(ActorCell.scala:447) ~[akka-actor-2.0-M2.jar:2.0-M2] at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:210) ~[akka-actor-2.0-M2.jar:2.0-M2] at akka.dispatch.Mailbox.run(Mailbox.scala:164) ~[akka-actor-2.0-M2.jar:2.0-M2]
The relevant line is: https://github.com/scala/scala/blob/master/src/library/scala/runtime/AbstractPartialFunction.scala#L41
By analyzing this line it looks like it is result that must be null, right? I don't have any small test-case reproducing this problem but I guess Akka guys could come up with something fairly quickly.
--
Grzegorz Kossakowski
After rebuilding Play 2.0 with Scala virtualized (which follows very closely master) I ran tests and got:
java.lang.NullPointerException: null at scala.runtime.AbstractPartialFunction.orElse(AbstractPartialFunction.scala:41) ~[scala-library.jar:0.11.2] at akka.routing.Router$class.receive(Routing.scala:130) ~[akka-actor-2.0-M2.jar:2.0-M2] at akka.routing.RouterConfig$$anon$1.receive(Routing.scala:85) ~[akka-actor-2.0-M2.jar:2.0-M2] at akka.actor.Actor$class.$init$(Actor.scala:291) ~[akka-actor-2.0-M2.jar:2.0-M2] at akka.routing.RouterConfig$$anon$1.<init>(Routing.scala:85) ~[akka-actor-2.0-M2.jar:2.0-M2] at akka.routing.RouterConfig$class.createActor(Routing.scala:85) ~[akka-actor-2.0-M2.jar:2.0-M2] at akka.routing.RoundRobinRouter.createActor(Routing.scala:204) ~[akka-actor-2.0-M2.jar:2.0-M2] at akka.routing.RoutedActorRef$$anonfun$$init$$1.apply(Routing.scala:19) ~[akka-actor-2.0-M2.jar:2.0-M2] at akka.routing.RoutedActorRef$$anonfun$$init$$1.apply(Routing.scala:19) ~[akka-actor-2.0-M2.jar:2.0-M2] at akka.actor.ActorCell.newActor(ActorCell.scala:340) ~[akka-actor-2.0-M2.jar:2.0-M2] at akka.actor.ActorCell.create$1(ActorCell.scala:357) ~[akka-actor-2.0-M2.jar:2.0-M2] at akka.actor.ActorCell.systemInvoke(ActorCell.scala:447) ~[akka-actor-2.0-M2.jar:2.0-M2] at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:210) ~[akka-actor-2.0-M2.jar:2.0-M2] at akka.dispatch.Mailbox.run(Mailbox.scala:164) ~[akka-actor-2.0-M2.jar:2.0-M2]
The relevant line is: https://github.com/scala/scala/blob/master/src/library/scala/runtime/AbstractPartialFunction.scala#L41
By analyzing this line it looks like it is result that must be null, right? I don't have any small test-case reproducing this problem but I guess Akka guys could come up with something fairly quickly.
--
Grzegorz Kossakowski
Wed, 2012-01-25, 15:21
#2
Re: AbstractPartialFunction throws NPE
On 25 January 2012 15:10, Adriaan Moors <adriaan.moors@epfl.ch> wrote:
It is in M1 but not in virtualized build I'm using. This looks like exactly the same issue so this fix might be enough. However, it's not going to be easy for me to test it now...
--
Grzegorz Kossakowski
Is https://issues.scala-lang.org/browse/SI-5300 related? I can't check right now whether that fix is in M1.
It is in M1 but not in virtualized build I'm using. This looks like exactly the same issue so this fix might be enough. However, it's not going to be easy for me to test it now...
--
Grzegorz Kossakowski
On 25 Jan 2012, at 08:03, Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> wrote: