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 8960207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:37:10+00:00 2026-06-15T15:37:10+00:00

My Model : @Entity(name = WORKFLOW_ROLE) public class WorkflowRole extends GenericModel { @Id @Column(name

  • 0

My Model:

@Entity(name = "WORKFLOW_ROLE")
public class WorkflowRole extends GenericModel {

   @Id
   @Column(name = "IDNR", unique = true, nullable = false, precision = 22, scale = 0)
   @Required
   @Min(0)
   public long id;
}

My Controller-Action:

public static void postNewRole(@Valid models.WorkflowRole role) {
    try
    {
      role.workflow = models.Workflow.findById(role.workflow.id);

      if (validation.hasErrors()) {
        params.flash(); // add http parameters to the flash scope
        validation.keep(); // keep the errors for the next request
        newRole();
      }

      role.create();
      flash.success("Rolle erstellt");
      index();
    }
    catch (Exception e)
    {
        params.flash();
        validation.keep();
        flash.put("error", e.getMessage());
        newRole();
    }
}

Now i get follwowing exception if i try to pass the WorkflowRole.id as a String in my form:

@6chopgia8
Internal Server Error (500) for request POST /workflowrole/postnewrole

Oops: UnexpectedException
An unexpected error occured caused by exception UnexpectedException: Unexpected Error

play.exceptions.UnexpectedException: Unexpected Error
    at play.data.validation.ValidationPlugin.beforeActionInvocation(ValidationPlugin.java:80)
    at play.plugins.PluginCollection.beforeActionInvocation(PluginCollection.java:639)
    at play.mvc.ActionInvoker.invoke(ActionInvoker.java:134)
    at Invocation.HTTP Request(Play!)
Caused by: play.exceptions.UnexpectedException: Unexpected Error
    at play.db.jpa.JPAPlugin.bind(JPAPlugin.java:84)
    at play.plugins.PluginCollection.bind(PluginCollection.java:579)
    at play.data.binding.Binder.bind(Binder.java:112)
    at play.mvc.ActionInvoker.getActionMethodArgs(ActionInvoker.java:651)
    at play.data.validation.ValidationPlugin$Validator.validateAction(ValidationPlugin.java:117)
    at play.data.validation.ValidationPlugin.beforeActionInvocation(ValidationPlugin.java:72)
    ... 3 more
Caused by: java.lang.NumberFormatException: For input string: "sdf"
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
    at java.lang.Long.parseLong(Long.java:410)
    at java.lang.Long.parseLong(Long.java:468)
    at play.data.binding.Binder.internalDirectBind(Binder.java:612)
    at play.data.binding.Binder.directBind(Binder.java:529)
    at play.db.jpa.JPAPlugin.bind(JPAPlugin.java:76)
    ... 8 more

Is anybody experiencing similar problems with the binding of generic models in play 1.2.5?

  • 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-15T15:37:10+00:00Added an answer on June 15, 2026 at 3:37 pm

    Edit: Yes, this appears to be a bug. Patch here: https://gist.github.com/4242156


    Try making your ID a Long instead of a long – I suspect this is why the binder crashes. There is special logic for primitive vars – and I think your case demonstrates a bug. However, I think if you switch to Long the code should work as expected.

    In general, you should avoid primitive values for database bound objects unless you can be 100% certain there are no null values in the database. (but your code should have worked – so there is a bug)

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

Sidebar

Related Questions

Here is the BlogPost model : @Entity @Table(name = blog_posts) public class BlogPost extends
Here's my model Document : @Entity @Table(name = "documents") public class Document extends Model
I have a Model: @Entity @Table(name = User) public class User implements Serializable {
I have the following model classes: @Entity @Table(name = title) public final class Title
I'm using Ebean, and define such a model: @Entity @Table(name = users) public class
I have an entity: <class name=name.dargiri.model.Entity table=ENTITY optimistic-lock=version> <version name=version column=ver type=long /> </class
I have the following model entity: public class ScheduledTask { public virtual int ScheduledTaskId
I have an unowned relationship in my Domain model @Entity public class A {
The model class: @Entity @Table(name = CSU_AUDIT) @NamedQuery(name = findAllEventsForObjectId, query = from AuditEvent
how can i change the name of my model's entity more than once :

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.