Rory Lester
Rory Lester

Reputation: 2918

Spring dependencies conflicting - legacy code

I am rather new to Spring and am having some issues. I have an application that has a legacy jar file dependency. The application now needs to be expanded, but it requires the use of a newer jar version of the legacy code.

If I remove the legacy dependency, the code breaks. If I use the new version of the code only, the code breaks. Basically I want to use both jar files: legacy and the newer version. How do I tell spring to differentiate since the class names are the same in both jar files? If possible, would you please provide an example?

The ideal solution would be to remove the legacy code, however for this particular instance, I just need to make a quick modification to it.

Upvotes: 0

Views: 72

Answers (1)

eis
eis

Reputation: 53462

If full class names (including their packages) are identical, there's no way spring or any other standard java class path mechanism can see both classes at the same time; only one or the other. You'll need to do a bigger change, probably getting rid of legacy code.

Upvotes: 1

Related Questions