NullPointer when try to read property

Bug #520910 reported by all
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
play framework
Status tracked in 1.0
1.0
Fix Released
Undecided
Unassigned
1.1
Fix Committed
Undecided
Unassigned

Bug Description

Using play-1.0.1

When I try to read a property of an object I've got a NullPointerException.

The object is not part of my model.

Just try this code in a new play application. :

---------------------------------------------------------------------

import java.awt.Point;

public class Application extends Controller {

    public static void index() {
     Point p = new Point();
     p.x=5;
     System.out.println(p.x);
        render();
    }

}

-------------------------------------------------------------------

It fires an exception :

play.exceptions.JavaExecutionException
        at play.mvc.ActionInvoker.invoke(ActionInvoker.java:229)
        at Invocation.HTTP Request(Play!)
Caused by: java.lang.NullPointerException
        at play.classloading.enhancers.PropertiesEnhancer$FieldAccessor.invokeReadProperty(PropertiesEnhancer.java:171)
        at controllers.Application.index(Application.java:14)
        at play.utils.Java.invokeStatic(Java.java:129)
        at play.mvc.ActionInvoker.invoke(ActionInvoker.java:138)
        ... 1 more

--------------------------------------------------------------

Did I miss something ?

Revision history for this message
Guillaume Bort (guillaume-bort) wrote : Re: [Bug 520910] [NEW] NullPointer when try to read property

Ah yes. I've already fixed that in the trunk. Please check with the
latest 1.0 nightly

On 12 févr. 2010, at 11:53, all <email address hidden> wrote:

> Public bug reported:
>
> Using play-1.0.1
>
> When I try to read a property of an object I've got a
> NullPointerException.
>
> The object is not part of my model.
>
> Just try this code in a new play application. :
>
> ---------------------------------------------------------------------
>
> import java.awt.Point;
>
> public class Application extends Controller {
>
> public static void index() {
> Point p = new Point();
> p.x=5;
> System.out.println(p.x);
> render();
> }
>
> }
>
> -------------------------------------------------------------------
>
> It fires an exception :
>
> play.exceptions.JavaExecutionException
> at play.mvc.ActionInvoker.invoke(ActionInvoker.java:229)
> at Invocation.HTTP Request(Play!)
> Caused by: java.lang.NullPointerException
> at play.classloading.enhancers.PropertiesEnhancer
> $FieldAccessor.invokeReadProperty(PropertiesEnhancer.java:171)
> at controllers.Application.index(Application.java:14)
> at play.utils.Java.invokeStatic(Java.java:129)
> at play.mvc.ActionInvoker.invoke(ActionInvoker.java:138)
> ... 1 more
>
> --------------------------------------------------------------
>
> Did I miss something ?
>
> ** Affects: play
> Importance: Undecided
> Status: New
>
> --
> NullPointer when try to read property
> https://bugs.launchpad.net/bugs/520910
> You received this bug notification because you are subscribed to play
> framework.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.