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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:01:04+00:00 2026-05-26T20:01:04+00:00

In a lift project, I put the db configurations in a file called db.properties

  • 0

In a lift project, I put the db configurations in a file called db.properties

/src/main/resources/db.properties

And in my Boot.scala, I read it as:

val input = this.getClass.getResourceAsStream("db.properties")
println("### input: " +input)

val db = new java.util.Properties
db.load(input)

val url = db.getProperty("url")  
println("#### url:" + url)

Then I start sbt:

sbt prepare-web jetty-start

The console prints some errors:

### input: null
21:48:55.906 [main] ERROR n.liftweb.http.provider.HTTPProvider - Failed to Boot! Your application may not run properly
java.lang.NullPointerException: null
    at java.util.Properties$LineReader.readLine(Properties.java:418) ~[na:1.6.0_27]
    at java.util.Properties.load0(Properties.java:337) ~[na:1.6.0_27]
    at java.util.Properties.load(Properties.java:325) ~[na:1.6.0_27]
    at bootstrap.liftweb.Boot.boot(Boot.scala:21) ~[classes/:na]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.6.

It’s strange lift can’t find the db.properties!

I’ve checked target/webapp/WEB-INF/classes, and db.properties is there! Where is wrong?

  • 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-26T20:01:05+00:00Added an answer on May 26, 2026 at 8:01 pm

    The code you posted should work – you might try

    val input = getClass.getResourceAsStream("/db.properties")

    Alternatively you might try the built-in Lift Props meccano:
    http://www.assembla.com/wiki/show/liftweb/Properties

    If you use Mapper (= persistence framework that comes with Lift) you might have a look at:
    http://www.assembla.com/spaces/liftweb/wiki/Mapper

    If everything fails – ask the friendly lift community:
    http://groups.google.com/group/liftweb

    Hope that helps
    Paul

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

Sidebar

Related Questions

I have a CSV file I want to load at boot of my Lift
I am building a scala web project using scala test, lift, jpa, hibernate, mercurial
I'm trying to set up my first scala lift project in Eclipse and it
I have Eclipse Indigo with the Scala IDE plugin. I downloaded a lift project
I'm trying to learn how to use lift. I can create project skeleton by
I'm fairly new to Lift/Scala but like the ideas of less code writing and
I'm currently using SBT to manage my Lift project. I'd like to deploy it,
How do I set up hotdeploy for Scala/Lift projects in Eclipse? Basically, I would
A standard Symply Lift RestHelper example project features code , code.lib and code.model and
I like what I read about Lift , and I like the concept of

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.