+ Start a Discussion
mikefmikef 

ant tool kit error

Hi:

I am having an issue with the ant tool kit and hope you can help.

I ran the test just fine, but when I got to replace my class with the sample class I get this error.

"An object 'MyClassName' of type ApexClass was named in manifest but was not found in zipped directory"

I updated the package.xml file with my class name, I can login just fine, and the test worked fine.

Thank you.

JonPJonP
Can you provide the contents of your package.xml file as well as the contents (directory and file names/structure) of where your sf:deploy task is pointing?
mikefmikef
Package.xml
Code:
<—xml version="1.0" encoding="UTF-8"–>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
   <types>
        <members>PartnerLeadObject</members>
        <name>CustomObject</name>
    </types> 
    <types>
        <members>MarketingResponse</members>
        <members>SyncPartnerLead</members>
        <members>LeadScore</members>
        <members>SyncPartnerLeadTest</members>
        <members>MarketingResponseTest</members>
        <name>ApexClass</name>
    </types>
    <types>
        <members>LeadTrigger</members>
        <members>PartnerLeadTrigger</members>
        <name>ApexTrigger</name>
    </types>
    <version>11.0</version>
</Package>

 build.xml
Code:
<project name="Sample usage of Salesforce Ant tasks" default="test" basedir="." xmlns:sf="antlib:com.salesforce">

    <property file="build.properties"/>
    <property environment="env"/>
    
    <!-- Shows deploying code & running tests for package 'codepkg' -->
    <target name="deployCode">
      <!-- Upload the contents of the "codepkg" package, running the tests for just 1 class -->
      <sf:deploy username="${sf.username}" password="${sf.password}" serverurl="${sf.serverurl}" deployroot="${dev.directory}">
      </sf:deploy>
    </target>

    <!-- Shows check only; never actually saves to the server -->
    <target name="deployCodeCheckOnly">
      <sf:deploy username="${sf.username}" password="${sf.password}" serverurl="${sf.serverurl}" deployroot="${dev.directory}" checkOnly="true"/>
    </target>
</project>

dev.directory = June2008
and the classes directory is in the June2008 directory.
The package.xml is in June2008 as well.
The build.xml and build.properties files are in the parent of the June2008 directory.

I am just trying to run the deployCodeCheckOnly first.
 




Message Edited by mikef on 05-27-2008 04:27 PM
FareedFareed
I am deploying the apex classes, triggers, VF pages and S-Controls to production environment using ANT. I get the following errors while deploying

Entity of type 'ApexClass' named 'ClientTripController' not foundpackage.xml - Entity of type 'ApexClass' named 'RecreateMeetingsController' not foundpackage.xml - Entity of type 'ApexClass' named 'ItineraryDay' not foundpackage.xml - Entity of type 'ApexClass' named 'DayTitle' not foundpackage.xml - Entity of type 'ApexClass' named 'ItineraryPrintController' not foundpackage.xml - Entity of type 'ApexClass' named 'FormattedCompany' not foundpackage.xml - Entity of type 'ApexClass' named 'ItineraryComponents' not foundpackage.xml - Entity of type 'ApexClass' named 'tripCompanySummaryController' not foundpackage.xml - Entity of type 'ApexClass' named 'ICComponentController' not foundpackage.xml - Entity of type 'ApexClass' named 'FunctionalTests' not foundpackage.xml - Unknown entity:ApexComponentspackage.xml - Entity of type 'ApexPage' named 'RecreateMeetingsPage' not foundpackage.xml - Entity of type 'ApexPage' named 'ItineraryPrint' not foundpackage.xml - Entity of type 'ApexPage' named 'tripCompanySummary' not foundpackage.xml - Unknown entity:ApexTriggerspackage.xml - Unknown entity:CustomFieldspackage.xml - Unknown entity:CustomObjectspackage.xml - Unknown entity:Layoutspackage.xml - Unknown entity:Profilespackage.xml - Unknown entity:Scontrols

BUILD FAILED
/Documents/workspace/Bug Fixing/Builds/build.xml:131: The following error occurred while executing this line:
/Documents/workspace/Bug Fixing/Builds/build.xml:62: Failures:
package.xml(ClientTripController):An object 'ClientTripController' of type ApexClass was named in manifest but was not found in zipped directory
package.xml(DayTitle):An object 'DayTitle' of type ApexClass was named in manifest but was not found in zipped directory
package.xml(FormattedCompany):An object 'FormattedCompany' of type ApexClass was named in manifest but was not found in zipped directory
package.xml(FunctionalTests):An object 'FunctionalTests' of type ApexClass was named in manifest but was not found in zipped directory
package.xml(ICComponentController):An object 'ICCom

I am using Apache Ant version 1.7.0 compiled on February 29 2008, can anyone advice what might be causing this errors.

Manoj kumar.ax391Manoj kumar.ax391
while using "deployCode" replace the names with stars (see the example below)

Code for retrieveCode task
<—xml version="1.0" encoding="UTF-8"–>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>PartnerLeadObject</members>
<name>CustomObject</name>
</types>
<types>
<members>MarketingResponse</members>
<members>SyncPartnerLead</members>
<members>LeadScore</members>
<members>SyncPartnerLeadTest</members>
<members>MarketingResponseTest</members>
<name>ApexClass</name>
</types>
<types>
<members>LeadTrigger</members>
<members>PartnerLeadTrigger</members>
<name>ApexTrigger</name>
</types>
<version>11.0</version>
</Package>

Code for deployCode task
<—xml version="1.0" encoding="UTF-8"–>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>*</members>
<name>CustomObject</name>
</types>
<types>
<members>*</members>
<name>ApexClass</name>
</types>
<types>
<members>*</members>
<name>ApexTrigger</name>
</types>
<version>11.0</version>
</Package>

As all the objects would have got downloaded into the package folder, the above change in package.xml(with *) will pick all available objects and deploy them.
Michalis Douramanis 1Michalis Douramanis 1
Anyone found a solution to this issue? I am getting the same error which is like below:
"Error: An object 'CustomObject' of type CustomObject was named in package.xml, but was not found in zipped directory".

I tried the suggestion of Manoj, but then I get an error that the deploy tries to create the object:
"objects/CustomObject/CustomObject.object-meta.xml -- Error: Cannot create a new component with the namespace: CustomObject. Only components in the same namespace as the organization can be created through the API".

I am using Jenkins with Ant to do deployments to our test sandbox.