jobboard bootstrap question

21 views
Skip to first unread message

johndwill

unread,
Dec 22, 2009, 3:33:21 PM12/22/09
to play-framework
Hi

I just started looking at Play and am running into a couple errors
trying to bootstrap the Jobboard example.

FWIW: I've gone through the tutorial and thought it would be good to
load the fixture used for testing on the Jobboard - like what is done
in the tutorial. It seemed like a simple thing.

I copied the data.yml from test into conf/ and renamed it initial-
data.yml. I then created a Bootstrap.java that looks like:

@OnApplicationStart
public class Bootstrap extends Job {

public void doJob() {
// Check if the database is empty
if(Company.count() == 0) {
Fixtures.load("initial-data.yml");
}
}

}

The problem is I get a NullPointerException in
play.db.jpa.JPASupport.edit (line 118) because, I believe, there is no
entry for 'logo' in the yml file for the companies.

I tried adding a blank line, but then I get a NullPointerException in
play.test.Fixtures.serialize (line 167). I THINK this is again because
'logo' is null and there is no check in serialize() for null values.

Loading the fixture works when running in test mode so why wouldn't it
work in dev mode?

Thanks
John

Guillaume Bort

unread,
Dec 22, 2009, 4:04:04 PM12/22/09
to play-fr...@googlegroups.com
Hi,

> I tried adding a blank line, but then I get a NullPointerException in
> play.test.Fixtures.serialize (line 167). I THINK this is again because
> 'logo' is null and there is no check in serialize() for null values.

Yes you're right. I've fixed this in the trunk before.

About the other bug I've found the root cause. I've fixed it as well
in the trunk.

So both problems are now fixed in the trunk since 1.0-759

Thank again for your report.

++

> --
>
> You received this message because you are subscribed to the Google Groups "play-framework" group.
> To post to this group, send email to play-fr...@googlegroups.com.
> To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.
>
>
>

johndwill

unread,
Dec 22, 2009, 4:18:33 PM12/22/09
to play-framework
Great. Thanks for the quick response.

On Dec 22, 4:04 pm, Guillaume Bort <guillaume.b...@gmail.com> wrote:
> Hi,
>
> > I tried adding a blank line, but then I get a NullPointerException in
> > play.test.Fixtures.serialize (line 167). I THINK this is again because
> > 'logo' is null and there is no check in serialize() for null values.
>
> Yes you're right. I've fixed this in the trunk before.
>
> About the other bug I've found the root cause. I've fixed it as well
> in the trunk.
>
> So both problems are now fixed in the trunk since 1.0-759
>
> Thank again for your report.
>
> ++
>

Reply all
Reply to author
Forward
0 new messages