Fixtures: accept entities with no initial values
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
play framework |
Fix Committed
|
Low
|
Erwan Loisant |
Bug Description
I get the following error when I try running my app. -
@62gidn956
Internal Server Error (500) for request GET /
Java exception (In /app/Bootstrap.java around line 13)
RuntimeException occured : Cannot load fixture initial-data.yml: null
play.exceptions
ll
at play.jobs.
at Invocation.
Caused by: java.lang.
l
at play.test.
at Bootstrap.
at play.jobs.
at play.jobs.
... 1 more
Caused by: java.lang.
at play.test.
at play.test.
... 4 more
Bootstrap file :
import play.*;
import play.jobs.*;
import play.test.*;
import models.*;
@OnApplicationStart
public class Bootstrap extends Job {
public void doJob() {
// Check if the database is empty
}
}
}
yml file :
# Test data
DEPARTMENT(K):
deptId: K
departmentname: Kids
DEPARTMENT(M):
deptId: M
departmentname: Mens ware
DEPARTMENT(W):
deptId: W
departmentname: Momens ware
DEPARTMENT(H):
deptId: H
departmentname: Homeware
USERGROUPS(Store Manager):
name: Store-Manager
description: Store Manager
USERGROUPS(
name: Manager
description: Manager of KAK
USERGROUPS(
name: Co-worker
description: A member of staff
USERGROUPS(
name: Customer
description: A customer
USERGROUPS(Boss):
name: Boss
description: The boss
SUPPLIERS(The Hyde Ltd):
address1: 566 Wall Road
address2: Barmingham, UK
suppliername: The Hyde Ltd
postcode: BQ1 7WU
phoneno: 87986768
SUPPLIERS(Hanna Ltd):
address1: 78 Market Place Street
address2: Oxford
suppliername: Hanna Ltd
postcode: OR4 8ET
phoneno: 8998786
SUPPLIERS(Maner Ltd):
address1: 87 Corner Street
address2: Manchester
suppliername: Maner Ltd
postcode: MW3 7TY
phoneno: 987986778
STAFF(Paul):
address1: P . O. BOX, 8765, Kumasi
address2: West Africa
surname: White
postcode: 8765
firstname: Paul
phoneno: 798790987
password: p
STAFF(Sarah):
address1: P . O. BOX, 9876, Kumasi
address2: West Africa
surname: Walters
postcode: 9876
firstname: Sarah
phoneno: 879879988
password: p2
STAFF(Paul):
address1: P . O. BOX, 8745, Kumasi
address2: West Africa
surname: Smith
postcode: 8745
firstname: Paul
phoneno: 798711653
password: p4
STAFF(Akos):
address1: P . O. BOX, 9811, Kumasi
address2: West Africa
surname: Brown
postcode: 9811
firstname: Akos
phoneno: 879877652
password: p3
DISCOUNTRATE(H):
discntcode: H
rate: 3000.0
DISCOUNTRATE(L):
discntcode: L
rate: 1000.0
DISCOUNTRATE(M):
discntcode: M
rate: 1500.0
DISCOUNTRATE(N):
discntcode: N
rate: 0.0
CONTAINERS(3cont):
contId: 3cont
totalbales: 450
suppliercompanyent: 1
CONTAINERS(4cont):
contId: 4cont
totalbales: 450
suppliercompanyent: 2
CONTAINERS(1):
contId: 1
totalbales: 450
suppliercompanyent: 1
BALES(Men Tops):
balsize: all sort of sizes
balpic: menjeans.png
priceInPounds: 24.0
colour: All sort of colours
price: 56.0
balname: Men Tops
description: All sort of men tops
deptId: M
contId: 1
discountRateent: H
STOCKQUAN: 50
BALES(Children Clothes):
balsize: all sort of sizes
balpic: menjeans.png
priceInPounds: 34.0
colour: All sort of colours
price: 67.0
balname: Children Clothes
description: All sort of children clothes
deptId: K
contId: 3cont
discountRateent: M
STOCKQUAN: 100
BALES(Women Tops) :
balsize: all sort of sizes
balpic: menjeans.png
priceInPounds: 23.0
colour: All sort of colours
price: 45.0
balname: Women Tops
description: All sort of women tops
deptId: W
contId: 1
discountRateent: N
STOCKQUAN: 100
BALES(Men Jeans):
balsize: all sort of sizes
balpic: menjeans.png
priceInPounds: 34.0
colour: All sort of colours
price: 67.0
balname: Men Jeans
description: All sort of men jeans
deptId: M
contId: 1
discountRateent: L
STOCKQUAN: 100
If you need further details, pls let me know.
Thanks
eve
summary: |
- yml file problems + Better error reporting in Fixtures |
That's a big file, please try to remove entries to make it as small as possible while still reproducing the error.