Project

General

Profile

Bug #3263

com.goldencode.p2j.Version class always loaded from p2jspi.jar

Added by Eric Faulhaber about 7 years ago. Updated about 7 years ago.

Status:
WIP
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
Due date:
% Done:

100%

billable:
No
vendor_id:
GCD
case_num:
version:

History

#1 Updated by Eric Faulhaber about 7 years ago

The command

java -jar { p2j.jar | p2admin.jar | p2jpl.jar | p2jspi.jar }

always will find and load the com.goldencode.p2j.Version class in the p2jspi.jar file which is stored in the Java extensions directory (if there is one on the target system), before finding the instance of this class stored in the local jar which is the intended target of the command.

Likewise, it will find the wrong instance of the class when accessed at runtime (for instance, during server bootstrap), thus potentially reporting the wrong version of the actual runtime environment, if the p2jspi.jar file installed in the Java extensions directory is out of date. Unfortunately, since the collation class stored in the p2jspi.jar is nearly never updated, it is easy to forget to update the spi jar when moving to a new version of the FWD conversion and runtime.

This defeats the purpose of the runtime version check. I think we should remove the Version class from the build of the p2jspi.jar file. This will require a more involved process to check the version of that file; namely unzipping the META-INF/MANIFEST.MF from the jar and reading it. But I think that is a reasonable trade-off to ensure that the correct FWD version is reported in the common use case.

#2 Updated by Eric Faulhaber about 7 years ago

From Hynek via email:

this is not good. A simple solution could be to create a unique version class for p2jspi.jar. Unless somebody else has better idea.

#3 Updated by Hynek Cihlar about 7 years ago

Fix checked in to 1521b revision 11146.

p2jspi.jar is loaded by java bootstrap class loader and so any version request to Version class would end up in p2jspi.jar. Fixed by introducing new version class SpiVersion used only by p2jspi.jar and removing Version class from p2jspi.jar.

Please review.

#4 Updated by Hynek Cihlar about 7 years ago

  • % Done changed from 0 to 100
  • Status changed from New to WIP

Also available in: Atom PDF