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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T23:21:47+00:00 2026-05-29T23:21:47+00:00

Our app is Scala-based and built on the Play! framework. I’ve generated a random

  • 0

Our app is Scala-based and built on the Play! framework. I’ve generated a random number using Scala Random. This is to use as a unique key for each account in our app.

However, when I go to save the new account into the database, it throws a java.lang.NumberFormatException:

More Info: I’m converting a string of an account ID to a Scala Long. I’m looking it up using a Squeryl object, grabbing the ID, and then converting it. Here’s what it looks like:

val account_id = Account.findAccountByUnique(account.uniqueKey).id.toLong

This is what findAccountByUnique looks like:

def findAccountByUnique(criteria: String) = {
    from(DB.accounts)(a =>
      where(a.uniqueKey == criteria)
        select (a))
  }

The stack trace on error:

java.lang.NumberFormatException: For input string: "468b68c"
        at java.lang.NumberFormatException.forInputString(Unknown Source)
        at java.lang.Long.parseLong(Unknown Source)
        at java.lang.Long.parseLong(Unknown Source)
        at scala.collection.immutable.StringLike$class.toLong(StringLike.scala:209)
        at scala.collection.immutable.StringOps.toLong(StringOps.scala:31)
        at controllers.Accounts$.save(Accounts.scala:44)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at play.mvc.ActionInvoker.invokeWithContinuation(ActionInvoker.java:548)
        at play.mvc.ActionInvoker.invoke(ActionInvoker.java:502)
        at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:496)
        at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:473)
        at play.mvc.ActionInvoker.invoke(ActionInvoker.java:161)
        at play.server.PlayHandler$NettyInvocation.execute(PlayHandler.java:257)
        at play.Invoker$Invocation.run(Invoker.java:278)
        at play.server.PlayHandler$NettyInvocation.run(PlayHandler.java:235)
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

I’ve typecasted the unique key as both a Scala Long and String but it throws the same error. Any idea as to a fix?

  • 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-29T23:21:48+00:00Added an answer on May 29, 2026 at 11:21 pm

    After further investigation it looks like there was a database helper returning junk data. Essentially it was actually returning its own “sample” data which happened to be a hexadecimal. It was a lib in Squeryl, looks like something was malformed somewhere and therefore it triggered a “sample” response.

    Looks like because account.uniqueKey had been updated from a previous query, it brought some junk with it. Still investigating how it happened but at least I found the real problem.

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

Sidebar

Related Questions

Our app provides an API that people can use to submit URLs like this:
We're trying to decide whether to host our play! framework and mysql Java app
Our app (already deployed) is using an Access/Jet database. The upcoming version of our
Our app servers (weblogic) all use log4j to log to the same file on
We wanted to use a UITabBar in our iPhone app, but with one exception:
We're building an app, our first using Rails 3, and we're having to build
Our app was originally built with NHibernate and its limitations of batch processing in
Our app uses Facebook app API and as of this morning, our log out
Our app allows multiple files to be selected in a file selection dialog which
Our app uses a component that requires a license file in the directory with

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.