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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T04:28:36+00:00 2026-05-30T04:28:36+00:00

I have an interesting problem, I have two web services defined in a spring-conf.xml

  • 0

I have an interesting problem, I have two web services defined in a spring-conf.xml file and I have two test classes that live in the same package and every class has its own link to this spring-conf.xml file to call their particular webservice.
I am able to get beans from one of my test classes but from the other one I can’t and the code is equal in both classes.

In one I have this

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class WSFirstTest {

private ApplicationContext context = new ClassPathXmlApplicationContext(
        "WEB-INF/spring-conf.xml");
private WSFirst ws = (WSFirst) context
        .getBean("serviceFirstDefault");

in the other one I have this

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class WSSecondTest {

private ApplicationContext context2 = new ClassPathXmlApplicationContext(
        "WEB-INF/spring-conf.xml");
private WSSecond ws = (WSSecond) context2
        .getBean("serviceSecondDefault");

In the second one my program can’t find the spring-conf file, but in the other one is able.
What’s the problem?

PS Both wservices work fine when I call them from remote, only in local I have this problem.

The test’s error:

org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [WEB-INF/spring-conf.xml]; nested exception is java.io.FileNotFoundException: class path resource [WEB-INF/spring-conf.xml] cannot be opened because it does not exist

Thank you for your advises.

  • 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-30T04:28:38+00:00Added an answer on May 30, 2026 at 4:28 am

    As I know Spring interprets an application context path without starting “/” as a relative path from the same package in which the test class is defined and pathes with starting “/” as fully qualified class path locations (at least in the testing environment). Maybe you should try to use a starting “/”.

    It turned out that different test run configurations caused the problem (see comments below).

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

Sidebar

Related Questions

I have an interesting problem. The basis of the problem is that my last
I have an interesting problem, which is a function that returns a Dictionary<String,HashSet<String>> .
I have an interesting problem, that i am sure has a simple answer, but
We have an interesting problem that I was hoping someone could help to shed
I have a rather interesting problem. I have a parent page that will create
I have an interesting (to me) problem... There are two threads, one for capturing
I have an interesting problem to solve here that may require some creative direction.
Ok, I've got an interesting problem here. I have two tables, tips and votes.
An interesting (and probably simple) problem for you all, I have two arrays, and
So I have an interesting problem that's been the fruit of lots of good

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.