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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T18:33:29+00:00 2026-06-01T18:33:29+00:00

I am developing a library that will be used to marshall and unmarshall data

  • 0

I am developing a library that will be used to marshall and unmarshall data into an xml format for transmission. I now have two versions of a Jar containing a com.mycorp.Marshaller class that I want to test for compatibility (as we cannot update all clients at the same time).

Does anyone know if it is possible to write a unit test that can load both version A and version B of the class and use them in unison to ensure xml outputted by B can be parsed by A.

I cannot use the fully qualified name as this is identical in both cases, and I cannot change it as version B is intended to be a drop-in replacement.


Does anybody have any idea how to load two different versions (from different jars) of a class with the same fully qualified name?

  • 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-01T18:33:31+00:00Added an answer on June 1, 2026 at 6:33 pm

    You could do this: create a class loader that loads the class by name from one of the jars. Then invode the marshalling and create the XML. After this, create another instance of the class loader (or another classloader altogether) to load the class by name from the other jar, and parse the XML with the object created via this second class loader.

    If you run into trouble, you could always create two tests: one to create the xml with version A, then another to parse the XML with version B. The two tests can be run in separate JVMs, one after the other

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

Sidebar

Related Questions

I am developing a class library that will be used in several projects. In
I have been developing a library that is getting pretty large, and now I
I'm developing a class library that will be used in a number of different
I am developing a class library (C#) that i will use it for my
I'm developing a static library that will be distributed to other developers, who may
I'm developing a class library in .NET that other developers will consume eventually. This
I'm about to set out on developing a .NET class library that will be
I am developing a library that initializes plain-old data objects from data retrieved from
We are developing products that will be used in the following way: Various shared
I'm building a class library that will have some public & private methods. 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.