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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:31:14+00:00 2026-05-26T14:31:14+00:00

For my simple maven project this doesn’t work: ApplicationContext context = new ClassPathXmlApplicationContext(config.xml); config.xml

  • 0

For my simple maven project this doesn’t work:

ApplicationContext context = new ClassPathXmlApplicationContext("config.xml");

config.xml is resided at the same class level

How,actually,add config.xml to classpath?
note: my project is a lib,if I do the same in other web project with configuration in
web.xml:

        <context-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>classpath*:config.xml</param-value>
        </context-param>

that it works OK

Here I needn’t web.xml, just correct classpath.

  • 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-26T14:31:15+00:00Added an answer on May 26, 2026 at 2:31 pm

    When you enter classpath*:config.xml, the classpath* is a wild card indicates that you want to load every file matching config.xml on the entire classpath, not just the single file config.xml. This may be why your solution is working otherwise.

    When instantiating a new ClassPathXmlApplicationContext, try giving the full classpath as an argument: com\sergionni\myproj\config.xml.

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

Sidebar

Related Questions

just set up a simple project to test the functionality of the maven exec
I run a simple CXF maven project http://cxf.apache.org/docs/using-cxf-with-maven.html , and get error below [INFO]
I currently have a project built with maven-archetype-webapp artifact. The default packaging for this
I'm trying to create an archtype for a simple project, this project contains some
I have a maven library project with some classes to deal xml messages. Whenever
I am trying to build a simple Java project with Maven. In my pom-file
I am new to Maven and using it to build a project on my
I am getting this infamous maven 0.13 error out of a simple basic POM.
I have a simple application using netbeans for developing and maven for building et
I have a java maven project , i installed scala plugin for eclipse and

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.