The reason for this, I think, is that pack.getPackageVersion() does return the PackageVersion, but not its lazy loaded data, like package history.
Perhaps try something like this:
PackageVersionCriteria c = new PackageVersionCriteria();
c.addFilterId( pack.getPackageVersion().getId() );
c.fetchInstalledPackageHistory( true );
PackageVersion pv = remoteClient.getContentManager().findPackageVersionsByCriteria( subject, c ).get(0); // assumes a single result, may want to protect against null here
pv.getInstalledPackageHistory(); // should be there, I think
It worked fine.
thank you very much.
You're welcome. In short the "getters" on the entity objects will not have any of the lazy loaded data, for efficiency reasons we don't pull everything at all times. We have a whole bunch of "Criteria" objects and methods that allow you to perform fetches with powerful filtering (c.addFilterXXX) and also the ability to request optional data (c.fetchXXX).
The Criteria stuff is really useful when using the RHQ Remote API and CLI.