I am trying to publish a component using core services in Java but on running the code, I am getting this error :-
Exception in thread "main" com.sdltridion.contentmanager.coreservice.ICoreServicePublishCoreServiceFaultFaultFaultMessage: Value cannot be null. Parameter name: publishInstruction.ResolveInstruction.
Here's my code
ReadOptions readOptions = new ReadOptions();
ArrayOfstring componentsArray=new ArrayOfstring();
componentsArray.getString().add("tcm:1010-2312-16");
ArrayOfstring publicationTarget=new ArrayOfstring();
publicationTarget.getString().add("tcm:0-2-65537");
PublishInstructionData publishInstructionData = new PublishInstructionData();
ResolveInstructionData resolveInstructionData = new ResolveInstructionData();
resolveInstructionData.setIncludeChildPublications(false);
JAXBElement<ResolvePurpose> resolvePurpose = new JAXBElement<ResolvePurpose>(new QName("http://www.sdltridion.com/ContentManager/R6","Purpose"), ResolvePurpose.class, ResolvePurpose.PUBLISH);
resolveInstructionData.setPurpose(resolvePurpose);
JAXBElement<ResolveInstructionData> jaxbElement = new JAXBElement<ResolveInstructionData>(new QName("http://www.sdltridion.com/ContentManager/CoreService/2011","com.sdltridion.contentmanager.coreservice._2011.Publish"), ResolveInstructionData.class, resolveInstructionData);
publishInstructionData.setResolveInstruction(jaxbElement);
RenderInstructionData renderInstructionData = new RenderInstructionData();
JAXBElement<RenderMode> renderMode = new JAXBElement<RenderMode>(new QName("http://www.sdltridion.com/ContentManager/R6","RenderMode"), RenderMode.class, RenderMode.PUBLISH);
renderInstructionData.setRenderMode(renderMode);
JAXBElement<RenderInstructionData> renderInstruction = new JAXBElement<RenderInstructionData>(new QName("http://www.sdltridion.com/ContentManager/CoreService/2011","com.sdltridion.contentmanager.coreservice._2011.Publish"), RenderInstructionData.class, renderInstructionData);
publishInstructionData.setRenderInstruction(renderInstruction);
ArrayOfPublishTransactionData ad= endpoint.publish(componentsArray, publishInstructionData, publicationTarget, PublishPriority.LOW, readOptions);