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

  • Home
  • SEARCH
  • 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 7498005
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T19:18:01+00:00 2026-05-29T19:18:01+00:00

Under WEB-INF/classes folder i have java class files structured in package hierarchy(e.g: com.company.app )

  • 0

Under WEB-INF/classes folder i have java class files structured in package hierarchy(e.g: com.company.app) and resources folder that contains spring context xml, jdbc.properties file, log4j.properties file and other resources that I use in mu app. To load spring context and configure log4j in web.xml i use

<context-param>
        <param-name>log4jConfigLocation</param-name>
        <param-value>classpath:log4j.properties</param-value>
    </context-param> 
<context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath:applicationContext.xml</param-value>
    </context-param>

and in applicationContext.xml I use property-placeholder to locate jdbc.properties file

<context:property-placeholder location="classpath:jdbc.properties"/>

However tomcat says that that classpath resource can not be resolved. I use ant to build a war file and have next target to compile java sources and copy evererything except java sources from src folder to WEB-INF/classes

<target name="javac" description="Compile java source to bytecode">
        <mkdir dir="${war_web_inf}/classes" />
        <javac srcdir="src" includes="**" encoding="utf-8" destdir="WebContent/WEB-INF/classes" source="1.5" target="1.5" nowarn="true" debug="true" debuglevel="lines,vars,source">
            <classpath refid="project.class.path" />
        </javac>
        <copy todir="${war_web_inf}/classes">
            <fileset dir="src" excludes="**/*.java" />
        </copy>

    </target>

How can I have access to resources in web.xml as classpath:log4j.properties for example?

  • 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-29T19:18:03+00:00Added an answer on May 29, 2026 at 7:18 pm

    The contents of your resources dir should be copied directly to WEB-INF/classes, so if your structure is:

    src/
      java/
      resources/
    

    You should use something like

    <copy todir="${war_web_inf}/classes">
      <fileset dir="src/resources" />
    </copy>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a number of jsp files under web-inf folder. Inside my web.xml i
It is a JSP application. Under /WEB-INF/src I have A.java and B.java, both in
I am trying to get a File under my WEB-INF/classes folder using Spring. <bean
I am using hibernate in my webpoject.I have my log4j.propertes under WEB-INF/classes.I want seperate
I am using JSF2.0 and Glassfish v3. I have a ValidatorMessage.properties file under WEB-INF>Classes
I have one web app works perfectly under linux with jetty-6.1.22. However, when I
i have an xml file under WEB-INF called pretty-config.xml , it's for prettyFaces rewrite
I have put my jar files in folder named myLibs under lib folder of
I have a web app that runs under Tomcat on Windows XP that needs
This Java web-app I am using that other developers wrote is structured in 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.