Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6085461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:38:28+00:00 2026-05-23T11:38:28+00:00

I have been playing around with java play framework and following tutorial. While was

  • 0

I have been playing around with java play framework and following tutorial. While was trying to implement this section “Using Fixtures to write more complicated tests” I faced such an error in tests:

A java.lang.RuntimeException has been caught, Cannot load fixture data.yml: play.exceptions.UnexpectedException: Unexpected Error

In /test/BasicTest.java, line 137 :
Fixtures.loadModels("data.yml");

Stacktrace:

java.lang.RuntimeException: Cannot load fixture data.yml: play.exceptions.UnexpectedException: Unexpected Error
    at play.test.Fixtures.loadModels(Fixtures.java:221)
    at BasicTest.fullTest(BasicTest.java:137)
    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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
    at play.test.PlayJUnitRunner$StartPlay$2$1.evaluate(PlayJUnitRunner.java:98)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
    at play.test.PlayJUnitRunner.run(PlayJUnitRunner.java:48)
    at org.junit.runners.Suite.runChild(Suite.java:128)
    at org.junit.runners.Suite.runChild(Suite.java:24)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:136)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:117)
    at play.test.TestEngine.run(TestEngine.java:101)
    at controllers.TestRunner.run(TestRunner.java:67)
    at sun.reflect.GeneratedMethodAccessor145.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at play.mvc.ActionInvoker.invokeWithContinuation(ActionInvoker.java:540)
    at play.mvc.ActionInvoker.invoke(ActionInvoker.java:498)
    at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:474)
    at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:469)
    at play.mvc.ActionInvoker.invoke(ActionInvoker.java:157)
    at play.server.PlayHandler$NettyInvocation.execute(PlayHandler.java:237)
    at play.Invoker$Invocation.run(Invoker.java:265)
    at play.server.PlayHandler$NettyInvocation.run(PlayHandler.java:217)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:680)
Caused by: java.lang.RuntimeException: play.exceptions.UnexpectedException: Unexpected Error
    at play.db.jpa.GenericModel.create(GenericModel.java:50)
    at play.db.jpa.JPAPlugin.bind(JPAPlugin.java:81)
    at play.plugins.PluginCollection.bind(PluginCollection.java:469)
    at play.data.binding.Binder.bind(Binder.java:309)
    at play.data.binding.Binder.bind(Binder.java:302)
    at play.test.Fixtures.loadModels(Fixtures.java:196)
    ... 52 more
Caused by: play.exceptions.UnexpectedException: Unexpected Error
    at play.db.jpa.GenericModel.edit(GenericModel.java:156)
    at play.db.jpa.GenericModel.create(GenericModel.java:48)
    ... 57 more
Caused by: play.exceptions.UnexpectedException: Unexpected Error
    at play.data.binding.BeanWrapper$Property.setValue(BeanWrapper.java:230)
    at play.data.binding.BeanWrapper.bind(BeanWrapper.java:70)
    at play.db.jpa.GenericModel.edit(GenericModel.java:153)
    ... 58 more
Caused by: java.lang.IllegalArgumentException: Can not set java.sql.Date field models.Post.postedAt to java.util.Date
    at play.data.binding.BeanWrapper$Property.setValue(BeanWrapper.java:225)
    at play.data.binding.BeanWrapper.bind(BeanWrapper.java:70)
    at play.db.jpa.GenericModel.edit(GenericModel.java:153)
    at play.db.jpa.GenericModel.create(GenericModel.java:48)
    at play.db.jpa.JPAPlugin.bind(JPAPlugin.java:81)
    at play.plugins.PluginCollection.bind(PluginCollection.java:469)
    at play.data.binding.Binder.bind(Binder.java:309)
    at play.data.binding.Binder.bind(Binder.java:302)
    at play.test.Fixtures.loadModels(Fixtures.java:196)
    at BasicTest.fullTest(BasicTest.java:137)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
    at play.test.PlayJUnitRunner$StartPlay$2$1.evaluate(PlayJUnitRunner.java:98)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
    at play.test.PlayJUnitRunner.run(PlayJUnitRunner.java:48)
    at org.junit.runners.Suite.runChild(Suite.java:128)
    at org.junit.runners.Suite.runChild(Suite.java:24)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:136)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:117)
    at play.test.TestEngine.run(TestEngine.java:101)
    at controllers.TestRunner.run(TestRunner.java:67)
    at play.mvc.ActionInvoker.invokeWithContinuation(ActionInvoker.java:540)
    at play.mvc.ActionInvoker.invoke(ActionInvoker.java:498)
    at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:474)
    at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:469)
    at play.mvc.ActionInvoker.invoke(ActionInvoker.java:157)
    at Invocation.HTTP Request(Play!)

Lines, where error occurs:

@Test
public void fullTest() {
    Fixtures.loadModels("data.yml");

    // count everyrhing
    assertEquals(2, User.count());

Also I have

@Before
public void setup() {
    Fixtures.deleteDatabase();
}

But it doesn’t help.

data.yml file contains this information, it should be valid cause it was downloaded from official site.

# Test data

User(bob):
    email:          bob@gmail.com
    password:       secret
    fullname:       Bob
    isAdmin:        true

User(jeff):
    email:          jeff@gmail.com
    password:       secret
    fullname:       Jeff    

Post(firstBobPost):
    title:          About the model layer
    postedAt:       2009-06-14
    author:         bob
    content:        >
                    The model has a central position in a Play! application. It is the domain-specific 
                    representation of the information on which the application operates.

                    Martin fowler defines it as:

                    Responsible for representing concepts of the business, information about the 
                    business situation, and business rules. State that reflects the business situation 
                    is controlled and used here, even though the technical details of storing it are 
                    delegated to the infrastructure. This layer is the heart of business software.

Post(secondBobPost):
    title:          Just a test of YABE
    postedAt:       2009-03-25
    author:         bob
    content:        >
                    Well, it's just a test.

Post(jeffPost):
    title:          The MVC application
    postedAt:       2009-06-06
    author:         jeff
    content:        >
                    A Play! application follows the MVC architectural pattern as applied to the 
                    architecture of the Web.

                    This pattern splits the application into separate layers: the Presentation 
                    layer and the Model layer. The Presentation layer is further split into a 
                    View and a Controller layer.

Comment(c1):
    author:         Guest
    content:        >
                    You are right !
    postedAt:       2009-06-14
    post:           firstBobPost

Comment(c2):
    author:         Mike
    content:        >
                    I knew that ...
    postedAt:       2009-06-15
    post:           firstBobPost    

Comment(c3):
    author:         Tom
    content:        >
                    This post is useless ?
    postedAt:       2009-04-05
    post:           secondBobPost    

What mistake have I done?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T11:38:29+00:00Added an answer on May 23, 2026 at 11:38 am

    I know you say you solved it by changing the format, but I believe there is another issue here. In your logs there is this message:

    Can not set java.sql.Date field models.Post.postedAt to java.util.Date
    

    It looks to me that your Post class is including java.sql.Date instead of java.util.Date, and that may be causing the issue in the first place (formatting being a red herring of the real conflict)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently learning about basic networking in java. I have been playing around
I have been playing around with the MVP pattern using winforms for the last
I have been playing around with NSURLConnection. Now I'm trying to grab some data
I have been playing around with the merge command in R and am trying
I've been playing around with developing Android apps in Java for a while and
I have been playing around with node.js, and coming from a Java background, I
I have been playing around with the twisted framework for about a week now(more
I have been playing around with GTK since a couple of days now,while going
I have been playing around with this and wanted to get a second opinion.
I'm just getting the hang of OOP and have been playing around with Java

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.