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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T11:24:36+00:00 2026-05-31T11:24:36+00:00

Using Play! 1.2.4, Scala, and Squeryl with Postgres Performing a simple DB insert like

  • 0

Using Play! 1.2.4, Scala, and Squeryl with Postgres

Performing a simple DB insert like usual and all of the sudden the database has started throwing NullPointerExceptions like crazy. All started when I created an email invite handler that could auto-add someone to an account.

The code:

Member.scala where the insert takes place:

def insert(member:Member) = DB.members.insert(member)

The code above is where Play! indicates the NullPointerException takes place. When I run the debugger on val member below it shows a valid Member class with appropriate values.

def invitation(s:Option[String]) = {
    s match {
      case Some(s) => {
        val invite = Invite.getByKey(s)

        invite match {
          case Some(invite) => {
            User.search(invite.email) match {
              case Some(user) => {
                  val member = new Member(user.id,invite.accountId,null)
                  Member.insert( member )
                  session.clear()
                  flash += "notice" -> "Success! Please login to continue."
                  Action(Authentication.login)
              }
              case _ => Action(Users.`new`(s))
            }
          }
          case None => Error("Invite does not exist.")
        }
      }
      case None => Action(Application.index)
    }
  }

The stack trace:

Internal Server Error (500) for request GET /invitation?s=e3dfd60e-bc07-496a-918
1-97c6ea4b0b71

Execution exception (In /app/models/Member.scala around line 59)
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 org.squeryl.internals.FieldMetaData.get(FieldMetaData.scala:260)
!       at org.squeryl.internals.DatabaseAdapter$class.writeValue(DatabaseAdapte
r.scala:456)
!       at org.squeryl.adapters.PostgreSqlAdapter.writeValue(PostgreSqlAdapter.s
cala:24)
!       at org.squeryl.internals.DatabaseAdapter$$anonfun$writeInsert$2.apply(Da
tabaseAdapter.scala:415)
!       at org.squeryl.internals.DatabaseAdapter$$anonfun$writeInsert$2.apply(Da
tabaseAdapter.scala:415)
!       at org.squeryl.internals.DatabaseAdapter$class.writeInsert(DatabaseAdapt
er.scala:415)
!       at org.squeryl.adapters.PostgreSqlAdapter.writeInsert(PostgreSqlAdapter.
scala:70)
!       at org.squeryl.Table$$anonfun$insert$1.apply(Table.scala:39)
!       at org.squeryl.logging.StackMarker$.lastSquerylStackFrame(StatisticsList
ener.scala:52)
!       at org.squeryl.Table.insert(Table.scala:34)
!       at models.Member$.insert(Member.scala:59)
!       at controllers.Invites$.invitation(Invites.scala:24)
!       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)
!       ... 1 more

Help appreciated

Never seen this before and it might be a simple fix, your help is much appreciated.

  • 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-31T11:24:38+00:00Added an answer on May 31, 2026 at 11:24 am

    This one was an easy fix, and I’m a little surprised I didn’t get a hiccup during compile.

    When assembling my Member class I used Scala None instead of null on that third value, and it worked just fine.

    Too bad Squeryl can’t put out a better error for debugging.

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

Sidebar

Related Questions

I would like to base64 encode a generated SHA-1 hash in Scala using Play
Using play framework 1.2.4 with scala. I have few play jobs that looks like
Has anyone succeeded in using Squeryl's externalTransactionManagementAdapter with play framework 2.0?: object Global extends
I intend on writing a small webapp using the Play framework with Scala and
I'm running a Play! app using Scala templates. However, I can't find an elegant
I am thinking of writing a web app in Scala using the Play! framework
I am able to debug scala controller in play framework using netbeans IDE but
I'm thinking about using Play for a large-scale project, so, has anyone battle-tested Play
I'm using the Play! framework and I have a model (an Entity) that has
I'm using Scala Play! framework with Anorm to persist the data model to the

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.