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

  • Home
  • SEARCH
  • 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 7969187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:11:50+00:00 2026-06-04T07:11:50+00:00

Play 1.2.4 Morphia 1.2.6a I have tried to update a record a few different

  • 0

Play 1.2.4
Morphia 1.2.6a

I have tried to update a record a few different ways over far too many days. I have read a couple books, reviewed nearly every comment on Play and I still cannot figure this out.???

MODEL:

@Entity
public class MyModel extends Model{
   public String fullname;
   public String email;
}

ROUTES:

PUT /test1/? Application.Update1(format:'json')
PUT /test2/? Application.Update2(format:'json')
PUT /test3/? Application.Update2(format:'json')

CONTROLLER:

public static void Update1(MyModel mydata){
}

public static void Update2(JsonObject json){
}

public static void Update3(@Valid MyModel mydata){
}

SEND:

PUT
Content-Type: application/json
Accept: application/json
{ "id": "4fa932fa036494e78debbc14",
  "fullname" : "test"
}

Calling Update1, Update2, and Update3, all report exceptions and quit.

CALL UPDATE1:

Oops: RuntimeException
An unexpected error occured caused by exception RuntimeException: play.exceptions.UnexpectedException: Unexpected Error

play.exceptions.UnexpectedException: Unexpected Error
    at play.mvc.ActionInvoker.invoke(ActionInvoker.java:258)
    at Invocation.HTTP Request(Play!)
Caused by: java.lang.RuntimeException: play.exceptions.UnexpectedException: Unexpected Error
    at play.modules.morphia.Model.create(Model.java:73)

CALL UPDATE2:

NullPointerException occured : null

play.exceptions.JavaExecutionException
    at play.mvc.ActionInvoker.invoke(ActionInvoker.java:231)
    at Invocation.HTTP Request(Play!)
Caused by: java.lang.NullPointerException
    at controllers.ApplicationController.Update2(ApplicationController.java:49)
    at play.mvc.ActionInvoker.invokeWithContinuation(ActionInvoker.java:548)
    at play.mvc.ActionInvoker.invoke(ActionInvoker.java:502)
    at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:478)
    at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:473)
    at play.mvc.ActionInvoker.invoke(ActionInvoker.java:161)

UPDATE 3:

Oops: RuntimeException
An unexpected error occured caused by exception RuntimeException: play.exceptions.UnexpectedException: Unexpected Error

play.exceptions.UnexpectedException: Unexpected Error
    at play.data.validation.ValidationPlugin.beforeActionInvocation(ValidationPlugin.java:59)
    at play.plugins.PluginCollection.beforeActionInvocation(PluginCollection.java:594)
    at play.mvc.ActionInvoker.invoke(ActionInvoker.java:134)
    at Invocation.HTTP Request(Play!)
Caused by: java.lang.RuntimeException: play.exceptions.UnexpectedException: Unexpected Error
    at play.modules.morphia.Model.create(Model.java:73)
    at play.modules.morphia.MorphiaPlugin.bind(MorphiaPlugin.java:601)
    at play.PlayPlugin.bind(PlayPlugin.java:68)
    at play.plugins.PluginCollection.bind(PluginCollec

Help?

  • 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-06-04T07:11:51+00:00Added an answer on June 4, 2026 at 7:11 am

    I think this is more about JSON binding than a morphia problem. AFAIK, play 1.x does not support JSON automatic bind. So probably what you need is:

    public static void Update(String myData){
       MyModel model = new Gson().fromJSON(myData, MyModel.class);
       ...
    }
    

    In your client side, you must send a ajax message with the name “myData”:

    $.post("the/url", {myData: {...}}, function(response){...});
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Play Framework (1.2.4) project with PlayMorphia that has two different database
I have the following Play Framework entity (using Morphia for persistence) as part of
Right now, I have configuration setting for morphia talks to one MongoDB from Play!.
Using play framework 1.2.4 with scala. I have few play jobs that looks like
I have tried to play a youtube video by its URL by my android
I'm using Play-Morphia to create my application, and I have a class which has
How do I set a 2D index in play morphia? Example: db.places.ensureIndex( { loc
Does play automatically cache data? I'm trying to read this code that someone else
Does Play Framework 2.0 have any built-in equivalent to 1.2.x's jsAction ? If not,
Play frameworks comes with an old Hibernate version (3.6.1). How can I update Hibernate

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.