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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T17:33:34+00:00 2026-05-19T17:33:34+00:00

lately a requirement came up to outsource the database settings out of Spring applicationContext.xml.

  • 0

lately a requirement came up to outsource the database settings out of Spring applicationContext.xml. Therefore we wanted to have a jdbc.properties file outside the builded jars, so the user can easily change the jdbc.settings. So far all worked fine within the eclipse workspace, but as soon as I build the distribution with ant, the applicationContext.xml doesnt find the jdbc.properties anymore.

The applicationContext.xml looks like the following:

<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
  <property name="locations">
    <value>classpath:jdbc.properties</value>
  </property>
</bean>

<bean id="dataSource"  class="org.springframework.jdbc.datasource.DriverManagerDataSource"> 
  <property name="driverClassName" value="${jdbc.driver}"/>
  <property name="url" value="${jdbc.url}"/>
  <property name="username" value="${jdbc.user}"/>
  <property name="password" value="${jdbc.password}"/>
</bean>

Within eclipse I used following classpath, so the jdbc.properties (which is placed in an eclipse project folder “config”) gonna get found:

classpath file:

<classpath>
        ...
 <classpathentry kind="src" path="config"/>
        ...
</classpath>

Until here all works fine. Now I build the project with Ant. The project.jar gets created, and a seperate config folder right next to it as well with the jdbc.properties file in it. Within the Manifest.mf there is an entry:

config/jdbc.properties

But when I now start the server, the jdbc.properties are not found. I noticed, when I change the Manifest.mf entry to:

config/.

it works fine again. But I dont understand why this is different. Can anyone explain me this behaviour? Or maybe even knows what I am doing wrong? Obviously I have to change the Ant file somehow, so he just adds the config folder in the manifest file, and not only the jdbc.properties-file itself?

Thank you in advance!

  • 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-19T17:33:34+00:00Added an answer on May 19, 2026 at 5:33 pm

    Solution was to define an classpathelement within the Ant-buildscript.

    <classpath>
      <pathelement location="${dir.build}/config/."/>
    <classpath>
    

    Unfortunatly I still dont know, why refering directly to the file didnt solve this issue as well.

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

Sidebar

Related Questions

Lately I have become a huge fan of XSL, XPath and XML, but I've
Lately I have been trying my hands on Eclipse IDE for java development. I
Lately, I have taken to the pattern of having a lot of diagnostic logging
Lately I have been experiencing Eclipse Galileo (3.5) slowing down under Java 1.5b12 OR
Lately I have been playing around with intents and bundles. I thought I had
Lately I have to precompile my assets to see my css changes in my
I started using rails_admin engine lately and can't quite figure out how I can
I have an XML file that references an XSL file (like ya do) that
I am running tcsh/csh shell on my machine. lately i have realized my stderr
Lately I have been reading about the Rack architecture in Passenger/Rails, and how it

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.