Migrating from UVM 1.1d to 1.2 issues

We are trying to migrate our test bench from UVM 1.1d to 1.2 . We are facing this issue

$cast(abc, factory.create_object_by_name(xyz,get_full_name()));
I am getting an error at create_object_by_name with following description
*E - illegal location for a hierarchical name (in a package)

This $cast code is in a class which is included in a package

This code was working perfectly fine in UVM 1.1d

In reply to Jack Bryan:

From the UVM 1.2 release notes

The undocumented uvm_pkg::factory variable has been removed, as it was unsafe during static initialization, and incompatible with the uvm_coreservice_t class. References to this variable need to be upgraded to retrieve the factory via uvm_factory::get.

In reply to dave_59:

Thanks Dave. It worked