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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:36:01+00:00 2026-05-26T05:36:01+00:00

I got 2 projects. A plugin project containing some components (POJOs) and a fragment

  • 0

I got 2 projects. A plugin project containing some components (POJOs) and a fragment project containing the according unit and integration tests. I’m using Tycho to build these projects and I want to use Spring to bootstrap my integration tests.

I’ve annotated my test classes with

@ContextConfiguration(locations = { "classpath*:spring/*-config.xml" })
@RunWith(SpringJUnit4ClassRunner.class)

But when I try to build the projects with tycho (clean install) or run the test class as Plugin-Test within eclipse, Spring complains that there are no beans in the context defined. In the log I found the following lines:

DEBUG o.s.t.c.s.AbstractGenericContextLoader - Loading ApplicationContext for 
      locations [classpath*:spring/*-config.xml].
DEBUG o.s.b.f.xml.XmlBeanDefinitionReader - Loaded 0 bean definitions from 
      location pattern [classpath*:spring/*-config.xml]

I’ve put the configuration files under src/main/java/spring/ and src/main/resources/spring but spring can’t find them. I’ve also tried to add these paths explicit to the bundle-classpath in the manifest.

When I change the configuration path to "file:spring/some-config.xml" spring is loading my bean definitions but crashes when it tries to load the “context” schema with the following output:

Configuration problem: Unable to locate Spring NamespaceHandler for XML schema
namespace [http://www.springframework.org/schema/context]

Why is it not working with the classpath prefix? And why is it working with the file prefix? I thought the file prefix would only work for the file system and not for a jar file… What am I doing wrong?

Thanks in advance

Update: Here is a complete view of the (fragment) test project:

/
+-- src/main/java/
|   +-- MyTestClass.java
|
+-- src/main/resources/
|   +-- spring/
|   |   +-- some-config.xml
|   +-- log4j.properties
|
+-- META-INF/
|   +-- MANIFEST.MF
|
+-- pom.xml

After tycho has tried to execute my test class I see the following files under target:

/target
|
+-- classes/
    +-- MyTestClass.class
    +-- spring/
        +-- some-config.xml
    +-- log4j.properties
+-- work/   // contains the eclipse configuration (config.ini, etc.)
+-- MANIFEST.MF
+-- mybundle-xx.jar

I’ve ommitted the properties and surfire files. The generated config.ini under target/work/configuration/ lists all bundles that are mentioned in the manifest as required bundles. They are referenced as jar files except of my test fragment bundle. For the test bundle the following entry exists:

reference\:file\:C\:/[...]/workspaces/workspace/my.bundle.tests

Is this correct? It would at least explain why the file prefix is working…
But what about the classpath prefix? Has the manifest been copied to the right location in the target folder? I mean it’s outside of the classes folder that is referenced in the dev.properties.
Furthermore log4j complains at startup that it’s not properly configured which indicates that it can’t find the log4j.properties on the classpath.

Update: Now I’m trying another way. I’ve read this article and it seemed to be an easier way to get things running. So I’ve added the maven-surfire-plugin to my pom and changed my packaging type from “eclipse-test-plugin” to “jar” so that tycho doesn’t run it’s own surefire-plugin. But now I’m standing in front of another problem. Spring seems to provide only an ArtifactLocator for maven2 repositories and not for p2 repositories like tycho uses.
Does anyone know if there is an ArtifactLocator for p2 repositories out there?

Is anyone using the same setup with tycho, osgi and spring for integration testing?

  • 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-26T05:36:01+00:00Added an answer on May 26, 2026 at 5:36 am

    Put spring-context-xx.jar on your classpath.

    Namespaces are handled by implementations of the NamespaceHandler interface. At startup spring loads all of them, and attempts to parse each namespace with the loaded handlers. If none of them claims to be able to parse it, the exception is thrown. the context: namespace is parsed by ContextNamespaceHandler, which resides in the aforementioned jar.

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

Sidebar

Related Questions

I've got some problems using Maven on this ready-to-use project: http://wiki.javaforum.hu/display/ANDROIDSOAP/Home Basically, I just
I've got a multiple project setup, using Maven and the Findbugs plugin. I need
I'm using Eclipse-plugin to develop Android applications on mac. I've got a project and
I am using plugin here http://plugins.jquery.com/project/autogrow and I got a problem in Internet Explorer
I've got two projects, one CF2.0 project and one NET2.0 project. These projects are
I've got two projects in WPF and one project is the main one and
I got a plugin based architecture (using areas) in my solution which works fine.
I've got a plugin system in my project (running on linux), and part of
I've got a big VS.NET project with 5-6 projects and one of these projects
I've got a problem with this plugin http://odyniec.net/projects/imgareaselect/ I think that image describes 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.