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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:56:12+00:00 2026-05-23T14:56:12+00:00

I am trying to run my first junit class in eclipse. When I right

  • 0

I am trying to run my first junit class in eclipse. When I right click on the new class and select run as junit it gives me a failed to load applicationcontext error. The direct path to the spring-servlet.xml is correct.

Here’s the code:

import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations={"file:C:/MyProject/WEB-INF/spring-servlet.xml" 
}) 
public class MyUnitTest {
@Autowired
private ApplicationContext applicationContext;

@Before
public void setUp() {
}

@Test
public void testFunctionality() throws Exception {
    assertTrue(true);
}
}

error –

Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'aop:scoped-proxy'.
  • 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-23T14:56:13+00:00Added an answer on May 23, 2026 at 2:56 pm

    The direct path to the
    spring-servlet.xml is correct.

    No, it’s not. If it was, JUnit would have found it.

    I think it should look like this:

    @ContextConfiguration(locations={"file:///C:/MyProject/WEB-INF/spring-servlet.xml"
    

    http://en.wikipedia.org/wiki/File_URI_scheme

    UPDATE:

    The error message you posted says you did read the context XML, but there’s an error.

    I find that it’s helpful to paste any error message I get into Google. When I did that with yours, it sent me this:

    http://forum.springsource.org/showthread.php?35417-The-matching-wildcard-is-strict-but-no-declaration-can-be-foun…-aop-scoped-proxy

    Check for missing JARs.

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

Sidebar

Related Questions

Got these error while trying to run my first Java webservice tutorial in Eclipse.
Currently I'm trying to run Eclipse Classic under Windows 7 x64, without success. First,
I am trying to run a select using sqllite. Its my first time using
So I'm trying to run my first hello world prog written in C. I
First steps in FreeBSD: trying to run my installation script. Fast help needed: #
I'm trying to build my first generic list and have run into some problems.
Im trying to develop my first ASP.NET MVC web app and have run into
When trying to run an Eclipse Dynamic Web Project under a Tomcat setup using
I'm trying to run my first example with spring. So I downloaded SpringSource Tool
I'm trying to run the first two lines of the gWidgetsRGtk2 examples but 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.