resolverFactory.getServiceResourceResolver(param);is the correct way of getting resolver. If you are getting Nullpointer exception, check if the system user exists on publish.Try changing the user like giving 'OAuthUser' in the User Mapper Service if the issue persists.