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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:41:37+00:00 2026-06-03T07:41:37+00:00

I have a question about loading properties from custom configuration files. I have tried

  • 0

I have a question about loading properties from custom configuration files. I have tried
two different approaches to loading my oauth.properties file but I can’t
get either to work so I’m hoping someone here can help me.

The first approach I tried was to add the file to the conf directory
and reference it thusly:

String oauthPropertiesFile = ClassLoader.getSystemResource("oauth.properties").getFile();

But that just returned NULL.

The second approach I tries was to add:

@include.oauthProperties = oauth.properties

to the application.conf file and then reference it in
my controller like:

String clientId = oauthProperties.clientId;

However this doesn’t compile.

Can anyone shed some light on what I’m doing wrong here?

  • 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-03T07:41:38+00:00Added an answer on June 3, 2026 at 7:41 am

    I’m not sure if conf is part of the classpath. So I would try /conf/oauth.properties or put the file into the classpath. Furthermore you should use Play.application.classloader() instead of Classloader.

    About the include: I still think you need to call Play.application().configuration().get("clientID");

    To analyze the situation you can start the app with -Dconfig.trace=loads and analyse the configuration with Play.application().configuration().root().render().

    Hope this give you enough hints so that you can solve your problem.

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

Sidebar

Related Questions

I have a question about loading an image from a website. The code I
I have a question about how to set up the relations between two models
I have a question about wiring web server controls. From many of the examples
I have a question about viewstate and custom controls in asp.net. Say I have
I have a question about the loading message on jQuery Mobile. By default, the
Hello wonderful stackoverflow users. I have a question about url loading. In many browsers
I have a question about the following code. [name file] = uigetfile('*', 'Select an
I have a question about outputting PDF files. Currently I'm storing the PDF in
I am slowly moving into Silverlight from asp.net and have a question about how
I am new to Cocos2D and I have question about texuture loading. When I

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.