function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Rajesh ShahRajesh Shah 

Error : Not in package.xml

I am trying to deploy certain components like Trigger, Apex Classes or LAyouts through Force.com IDE. Sometimes when I do validate Deployment, it gives me an error saying 'Not in package.xml'. I am not sure what is the meaning of this error. Can anybody please explain me?
 
Thanks
Best Answer chosen by Admin (Salesforce Developers) 
Rajesh ShahRajesh Shah

I found that one of the reasons the error for package.xml came was because of the difference between the API verion of Eclipse generated xml and the one on Salesforce. If the same component was migrated using the latest Force.com Plugin, it worked. But this is one of the reason, I got the error for other components too where the versions matched.

 

 

All Answers

advlgxadvlgx
I believe that means that your package.xml file, which is in the root of the /src directory in your project, does not contain the same objects as what you are trying to upload.

In other words......

When you created you project, you selected what objects would be available, like components, triggers, etc. Say, for example you did not select "classes" to be in your project. Well, then if you try to upload a class file from your project and deploy to the server, you might get this error because "Classes" is not an object type that is in your project, defined in the package.xml file.
Rajesh ShahRajesh Shah
what I did was, I created a Empty project. Then updated the package.xml to include only the stuffs that I needed to migrate. I checked the src after refreshing. It did contained those components. However while doing a validate deployment, it gave that particular error. Not sure why it comes.
advlgxadvlgx
You might try creating a new project and using the GUI to select the components to let the package.xml be created by Eclipse, then compare the differences between your custom package.xml and the system generated one.
Rajesh ShahRajesh Shah

I found that one of the reasons the error for package.xml came was because of the difference between the API verion of Eclipse generated xml and the one on Salesforce. If the same component was migrated using the latest Force.com Plugin, it worked. But this is one of the reason, I got the error for other components too where the versions matched.

 

 

This was selected as the best answer