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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T10:45:08+00:00 2026-06-07T10:45:08+00:00

Spring-namespaces allows you to define your own structure how spring beans could be configured.

  • 0

Spring-namespaces allows you to define your own structure how spring beans could be configured. Very cool.

I have to use a 3rd party software (Assentis Docbase) which defines in its spring.schemas the following (example below simplified)

http\://com.apress.prospring2/ch07/custom.xsd=custDir:/custom.xsd

Meaning: If user defines in its spring-xml with schema-location: “http://com.apress.prospring2/ch07/custom.xsd” spring will validate this file against custom.xsd.

custDir is a directory OUTSIDE the provided jar. Does anyone have an idea how I can set this custDir to point to a valid path during junit test? I already tried -DcustDir=/pathToXsd/ but it did not work.

If I remove custDir than everything works as expected, but I can not remove it from provided spring.schemas since it is 3rd party software.

Maybe this is an issue how property-files are handled in java but I have no idea.

  • 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-06-07T10:45:10+00:00Added an answer on June 7, 2026 at 10:45 am

    The syntax of spring.schemas I provided in my question is a properitary definition of 3.rd party software. They implemented there own EntityResolver which manually reacts on "custDir:" and starts some magic algorithm. So I came to the following workaround.

    You have to create your own my_spring.schemas which must be live in META-INF/. Than you have to make sure that spring loads my_spring.schemas and NOT spring.schemas.

    I achieved it with implementing my own TestingContext which is a subclass of ClassPathXmlApplicationContext. In TestingContext I overwrote method protected void loadBeanDefinitions(DefaultListableBeanFactory beanFactory) throws IOException and filled it with implementation from org.springframework.context.support.AbstractXmlApplicationContext. The only change I made was to line beanDefinitionReader.setEntityResolver(new ResourceEntityResolver(this)) to beanDefinitionReader.setEntityResolver(new PluggableSchemaResolver(getClassLoader(), "META-INF/my_spring.schemas). And voila if I use TestingContext my own my_spring.schemas is loaded.

    Drawback with this solution is that you have to provide all xsd in your jar because the default name, where spring looks up definitions has been changed.

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

Sidebar

Related Questions

I wrote my own custom namespace for a Spring based project I'm working on.
We have a commenting system built into our engine that allows programmers to put
I am trying to use PreAuthFilter (for Siteminder) with Spring Security 3.0. <http use-expressions=true>
I have the following web service that allows me uploading files: [WebService(Namespace = http://tempuri.org/)]
The Attribute [DebuggerDisplay] ( Using DebuggerDisplayAttribute ) allows to define the display in the
I have a simple little email app that allows a user to pick certain
I have a web application secured with Spring Security that needs two separate login
I have a winforms project which allows future developers to create plugins for the
I have a C# WCF REST Service which allows the addition of a bookmark,
I have made a page that allows users to upload files to the server

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.