I am trying to programmatically publish content instances in V8. Here is the code I am using.
Site site = Site.findByName("test");SiteRef siteRef = new SiteRef(site);DeploymentClient dc = new DeploymentClient(siteRef, stageId);DeploymentJobDefinition deploymentJobDef = new DeploymentJobDefinition( "Test Job", JobType.PUBLISH);ManagedObjectVCMRef moRef = new ManagedObjectVCMRef( "33082be44b6cd210VgnVCM10000065c9a8c0STFL");ContentInstancePattern cip = new ContentInstancePattern(moRef);deploymentJobDef.setContentPattern(cip, false);deploymentJobDef.setDescription("Automated PUBLISH");deploymentJobDef.setRequestor("Admin");JobReport jobReport = dc.createJob2(deploymentJobDef);ObjectId jobId = jobReport.getJobData().getId();if (jobReport.isJobValid()) { dc.launchJob(jobId);} else { dc.releaseJob(jobId);}
It fails during createJob2 call and throws a ClassNotFound exception for Environ class. This class is in a different jar (not vgn-appsvcs-cda or cma) that should not be included in any case. Just for the heck of it, I included that jar and it still failed while trying to get the stageName. I have validated that the stageId that I am passing to the constructor of DeploymentClient is actually valid.
Anyone else ran into this issue? Do you know how to fix it?