cancel
Showing results for 
Search instead for 
Did you mean: 

Ant build failed due to dependencies even though they're included.

vamirr
Champ on-the-rise
Champ on-the-rise
I'm new to ant and working through putting together a build.xml for my alfresco extensions.   The build is failing due to dependencies but I don't understand why..  I have included the required dependencies in the build.xml.

I would appreciate another pair of eyes. 



<project default="package-amp">
   <property name="module.id" value="my-extensions" />
   <property name="src-dir" location="/local/alfresco-src/4.2.1/alfresco/TAGS/ENTERPRISE/V4.2.1/root/projects" />
   <property name="3rdparty" location="${src-dir}/3rd-party/lib" />
   <property name="core" location="${src-dir}/core/build" />
   <property name="repository" location="${src-dir}/repository/build" />
   <property name="model" location="${src-dir}/data-model/build" />
   
   <property name="project.dir" value="."/>
   <property name="build.dir" value="${project.dir}/build"/>
   <property name="config.dir" value="${project.dir}/config"/>
   <property name="jar.file" value="${build.dir}/lib/${module.id}.jar"/>
   <property name="amp.file" value="${build.dir}/dist/${module.id}.amp"/>

   <target name="mkdirs">
      <mkdir dir="${build.dir}/dist" />
      <mkdir dir="${build.dir}/lib" />
   </target>
   
   <path id="class.path">
      <dirset dir="${build.dir}" />
      <fileset dir="${model}" includes="**/*.class" />
      <fileset dir="${3rdparty}" includes="**/*.jar" />
      <fileset dir="${core}" includes="**/*.class" />
      <fileset dir="${repository}" includes="**/*.class" />
   </path>
   
   <target name="compile">
      <mkdir dir="${build.dir}/classes" />
      <javac classpathref="class.path" srcdir="${project.dir}/source" destdir="${build.dir}/classes" />
   </target>

   <target name="package-jar" depends="compile">
      <jar destfile="${jar.file}" >
         <fileset dir="${build.dir}/classes" excludes="**/custom*,**/*Test*" includes="**/*.class" />
      </jar>
   </target>

   <target name="package-amp" depends="mkdirs, package-jar" description="Package the Module" >
      <zip destfile="${amp.file}" >
         <fileset dir="${project.dir}/build" includes="lib/*.jar" />
         <fileset dir="${project.dir}" includes="config/**/*.*" excludes="**/module.properties" />
         <fileset dir="${project.dir}/config/alfresco/module/${module.id}" includes="module.properties" />
      </zip>
   </target>
</project>




Here's the output when I run the build.xml
<code>
Buildfile: C:\local\alfresco-src\My Extensions\build.xml
compile:
    [javac] C:\local\alfresco-src\My Extensions\build.xml:35: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
    [javac] Compiling 4 source files to C:\local\alfresco-src\My Extensions\build\classes
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\impl\MetricsServiceImpl.java:7: error: package org.alfresco.repo.security.authentication does not exist
    [javac] import org.alfresco.repo.security.authentication.AbstractAuthenticationService;
    [javac]                                                 ^
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\impl\MetricsServiceImpl.java:8: error: package org.alfresco.service does not exist
    [javac] import org.alfresco.service.ServiceRegistry;
    [javac]                            ^
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\impl\MetricsServiceImpl.java:9: error: package org.alfresco.service.cmr.model does not exist
    [javac] import org.alfresco.service.cmr.model.FileFolderService;
    [javac]                                      ^
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\impl\MetricsServiceImpl.java:10: error: package org.alfresco.service.cmr.repository does not exist
    [javac] import org.alfresco.service.cmr.repository.ContentService;
    [javac]                                           ^
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\impl\MetricsServiceImpl.java:11: error: package org.alfresco.service.cmr.repository does not exist
    [javac] import org.alfresco.service.cmr.repository.NodeService;
    [javac]                                           ^
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\impl\MetricsServiceImpl.java:12: error: package org.alfresco.service.cmr.security does not exist
    [javac] import org.alfresco.service.cmr.security.PermissionService;
    [javac]                                         ^
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\impl\MetricsServiceImpl.java:20: error: cannot find symbol
    [javac]    private ServiceRegistry serviceRegistry;
    [javac]            ^
    [javac]   symbol:   class ServiceRegistry
    [javac]   location: class MetricsServiceImpl
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\impl\MetricsServiceImpl.java:21: error: cannot find symbol
    [javac]    private NodeService nodeService;
    [javac]            ^
    [javac]   symbol:   class NodeService
    [javac]   location: class MetricsServiceImpl
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\impl\MetricsServiceImpl.java:22: error: cannot find symbol
    [javac]    private FileFolderService fileFolderService;
    [javac]            ^
    [javac]   symbol:   class FileFolderService
    [javac]   location: class MetricsServiceImpl
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\impl\MetricsServiceImpl.java:23: error: cannot find symbol
    [javac]    private ContentService contentService;
    [javac]            ^
    [javac]   symbol:   class ContentService
    [javac]   location: class MetricsServiceImpl
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\impl\MetricsServiceImpl.java:24: error: cannot find symbol
    [javac]    private PermissionService permissionService;
    [javac]            ^
    [javac]   symbol:   class PermissionService
    [javac]   location: class MetricsServiceImpl
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\impl\MetricsServiceImpl.java:25: error: cannot find symbol
    [javac]    private AbstractAuthenticationService authenticationService;
    [javac]            ^
    [javac]   symbol:   class AbstractAuthenticationService
    [javac]   location: class MetricsServiceImpl
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\impl\MetricsServiceImpl.java:27: error: cannot find symbol
    [javac]    public void setServiceRegistry(ServiceRegistry serviceRegistry) {   
    [javac]                                   ^
    [javac]   symbol:   class ServiceRegistry
    [javac]   location: class MetricsServiceImpl
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\impl\MetricsServiceImpl.java:35: error: cannot find symbol
    [javac]    public void setAuthenticationService(AbstractAuthenticationService authenticationService){   this.authenticationService = authenticationService;   }
    [javac]                                         ^
    [javac]   symbol:   class AbstractAuthenticationService
    [javac]   location: class MetricsServiceImpl
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:7: error: package org.alfresco.model does not exist
    [javac] import org.alfresco.model.ContentModel;
    [javac]                          ^
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:8: error: package org.alfresco.repo.jscript does not exist
    [javac] import org.alfresco.repo.jscript.BaseScopableProcessorExtension;
    [javac]                                 ^
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:9: error: package org.alfresco.repo.model does not exist
    [javac] import org.alfresco.repo.model.Repository;
    [javac]                               ^
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:10: error: package org.alfresco.repo.security.authentication does not exist
    [javac] import org.alfresco.repo.security.authentication.AuthenticationUtil;
    [javac]                                                 ^
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:11: error: package org.alfresco.repo.security.authentication.AuthenticationUtil does not exist
    [javac] import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
    [javac]                                                                    ^
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:12: error: package org.alfresco.repo.security.permissions does not exist
    [javac] import org.alfresco.repo.security.permissions.AccessDeniedException;
    [javac]                                              ^
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:14: error: package org.alfresco.service does not exist
    [javac] import org.alfresco.service.ServiceRegistry;
    [javac]                            ^
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:15: error: package org.alfresco.service.cmr.model does not exist
    [javac] import org.alfresco.service.cmr.model.FileFolderService;
    [javac]                                      ^
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:16: error: package org.alfresco.service.cmr.repository does not exist
    [javac] import org.alfresco.service.cmr.repository.ContentReader;
    [javac]                                           ^
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:17: error: package org.alfresco.service.cmr.repository does not exist
    [javac] import org.alfresco.service.cmr.repository.ContentService;
    [javac]                                           ^
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:18: error: package org.alfresco.service.cmr.repository does not exist
    [javac] import org.alfresco.service.cmr.repository.NodeRef;
    [javac]                                           ^
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:19: error: package org.alfresco.service.cmr.repository does not exist
    [javac] import org.alfresco.service.cmr.repository.NodeService;
    [javac]                                           ^
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:20: error: package org.alfresco.service.cmr.repository does not exist
    [javac] import org.alfresco.service.cmr.repository.StoreRef;
    [javac]                                           ^
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:21: error: package org.alfresco.service.cmr.search does not exist
    [javac] import org.alfresco.service.cmr.search.ResultSet;
    [javac]                                       ^
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:22: error: package org.alfresco.service.cmr.search does not exist
    [javac] import org.alfresco.service.cmr.search.ResultSetRow;
    [javac]                                       ^
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:23: error: package org.alfresco.service.cmr.search does not exist
    [javac] import org.alfresco.service.cmr.search.SearchParameters;
    [javac]                                       ^
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:24: error: package org.alfresco.service.cmr.search does not exist
    [javac] import org.alfresco.service.cmr.search.SearchService;
    [javac]                                       ^
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:25: error: package org.alfresco.service.cmr.security does not exist
    [javac] import org.alfresco.service.cmr.security.AuthenticationService;
    [javac]                                         ^
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:26: error: package org.alfresco.service.cmr.security does not exist
    [javac] import org.alfresco.service.cmr.security.AuthorityService;
    [javac]                                         ^
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:27: error: package org.alfresco.service.namespace does not exist
    [javac] import org.alfresco.service.namespace.QName;
    [javac]                                      ^
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:41: error: cannot find symbol
    [javac] public class MetricsScriptApi extends BaseScopableProcessorExtension {
    [javac]                                       ^
    [javac]   symbol: class BaseScopableProcessorExtension
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:43: error: cannot find symbol
    [javac]    protected ServiceRegistry serviceRegistry;
    [javac]              ^
    [javac]   symbol:   class ServiceRegistry
    [javac]   location: class MetricsScriptApi
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:44: error: cannot find symbol
    [javac]    private NodeService nodeService;
    [javac]            ^
    [javac]   symbol:   class NodeService
    [javac]   location: class MetricsScriptApi
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:45: error: cannot find symbol
    [javac]    private SearchService searchService;
    [javac]            ^
    [javac]   symbol:   class SearchService
    [javac]   location: class MetricsScriptApi
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:46: error: cannot find symbol
    [javac]    private AuthenticationService authenticationService;
    [javac]            ^
    [javac]   symbol:   class AuthenticationService
    [javac]   location: class MetricsScriptApi
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:47: error: cannot find symbol
    [javac]    private AuthorityService authorityService;   //private Repository repository;
    [javac]            ^
    [javac]   symbol:   class AuthorityService
    [javac]   location: class MetricsScriptApi
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:48: error: cannot find symbol
    [javac]    private FileFolderService fileFolderService;
    [javac]            ^
    [javac]   symbol:   class FileFolderService
    [javac]   location: class MetricsScriptApi
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:49: error: cannot find symbol
    [javac]    private ContentService contentService;
    [javac]            ^
    [javac]   symbol:   class ContentService
    [javac]   location: class MetricsScriptApi
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:52: error: cannot find symbol
    [javac]    public void setSearchService(SearchService searchService) {   this.searchService = searchService;   }
    [javac]                                 ^
    [javac]   symbol:   class SearchService
    [javac]   location: class MetricsScriptApi
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:54: error: cannot find symbol
    [javac]    public void setNodeService(NodeService nodeService) {   this.nodeService = nodeService;   }
    [javac]                               ^
    [javac]   symbol:   class NodeService
    [javac]   location: class MetricsScriptApi
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:55: error: cannot find symbol
    [javac]    public void setAuthenticationService(AuthenticationService authenticationService) {   this.authenticationService = authenticationService;   }
    [javac]                                         ^
    [javac]   symbol:   class AuthenticationService
    [javac]   location: class MetricsScriptApi
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:56: error: cannot find symbol
    [javac]    public void setAuthorityService(AuthorityService authorityService) {   this.authorityService = authorityService;   }
    [javac]                                    ^
    [javac]   symbol:   class AuthorityService
    [javac]   location: class MetricsScriptApi
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:57: error: cannot find symbol
    [javac]    public void setFileFolderService(FileFolderService fileFolderService) {   this.fileFolderService = fileFolderService;   }
    [javac]                                     ^
    [javac]   symbol:   class FileFolderService
    [javac]   location: class MetricsScriptApi
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:58: error: cannot find symbol
    [javac]    public void setContentService(ContentService contentService) {   this.contentService = contentService;   }
    [javac]                                  ^
    [javac]   symbol:   class ContentService
    [javac]   location: class MetricsScriptApi
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:137: error: cannot find symbol
    [javac]    public void deleteWorkspace(final String StoreName) throws AccessDeniedException{
    [javac]                                                               ^
    [javac]   symbol:   class AccessDeniedException
    [javac]   location: class MetricsScriptApi
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:73: error: cannot find symbol
    [javac]       return Context.getCurrentContext().newArray(getScope(), actives);   
    [javac]                                                   ^
    [javac]   symbol:   method getScope()
    [javac]   location: class MetricsScriptApi
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:85: error: cannot find symbol
    [javac]       return Context.getCurrentContext().newArray(getScope(), all);      
    [javac]                                                   ^
    [javac]   symbol:   method getScope()
    [javac]   location: class MetricsScriptApi
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:116: error: cannot find symbol
    [javac]       StoreRef storeRef = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, StoreName);
    [javac]       ^
    [javac]   symbol:   class StoreRef
    [javac]   location: class MetricsScriptApi
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:116: error: cannot find symbol
    [javac]       StoreRef storeRef = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, StoreName);
    [javac]                               ^
    [javac]   symbol:   class StoreRef
    [javac]   location: class MetricsScriptApi
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:116: error: cannot find symbol
    [javac]       StoreRef storeRef = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, StoreName);
    [javac]                                        ^
    [javac]   symbol:   variable StoreRef
    [javac]   location: class MetricsScriptApi
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:123: error: cannot find symbol
    [javac]          throw new AccessDeniedException("Access Denied - Current User Must Be Admin");
    [javac]                    ^
    [javac]   symbol:   class AccessDeniedException
    [javac]   location: class MetricsScriptApi
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:125: error: cannot find symbol
    [javac]       StoreRef storeRef = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, StoreName);
    [javac]       ^
    [javac]   symbol:   class StoreRef
    [javac]   location: class MetricsScriptApi
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:125: error: cannot find symbol
    [javac]       StoreRef storeRef = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, StoreName);
    [javac]                               ^
    [javac]   symbol:   class StoreRef
    [javac]   location: class MetricsScriptApi
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:125: error: cannot find symbol
    [javac]       StoreRef storeRef = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, StoreName);
    [javac]                                        ^
    [javac]   symbol:   variable StoreRef
    [javac]   location: class MetricsScriptApi
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:128: error: cannot find symbol
    [javac]          storeRef = nodeService.createStore(StoreRef.PROTOCOL_WORKSPACE, StoreName);
    [javac]                                             ^
    [javac]   symbol:   variable StoreRef
    [javac]   location: class MetricsScriptApi
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:130: error: cannot find symbol
    [javac]       NodeRef rootNodeRef = nodeService.getRootNode(storeRef);
    [javac]       ^
    [javac]   symbol:   class NodeRef
    [javac]   location: class MetricsScriptApi
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:131: error: cannot find symbol
    [javac]       NodeRef newChildFolder = nodeService.createNode(rootNodeRef, ContentModel.ASSOC_CHILDREN, QName.createQName(RootFolderName),ContentModel.TYPE_FOLDER).getChildRef();
    [javac]       ^
    [javac]   symbol:   class NodeRef
    [javac]   location: class MetricsScriptApi
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:131: error: cannot find symbol
    [javac]       NodeRef newChildFolder = nodeService.createNode(rootNodeRef, ContentModel.ASSOC_CHILDREN, QName.createQName(RootFolderName),ContentModel.TYPE_FOLDER).getChildRef();
    [javac]                                                                    ^
    [javac]   symbol:   variable ContentModel
    [javac]   location: class MetricsScriptApi
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:131: error: cannot find symbol
    [javac]       NodeRef newChildFolder = nodeService.createNode(rootNodeRef, ContentModel.ASSOC_CHILDREN, QName.createQName(RootFolderName),ContentModel.TYPE_FOLDER).getChildRef();
    [javac]                                                                                                 ^
    [javac]   symbol:   variable QName
    [javac]   location: class MetricsScriptApi
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:131: error: cannot find symbol
    [javac]       NodeRef newChildFolder = nodeService.createNode(rootNodeRef, ContentModel.ASSOC_CHILDREN, QName.createQName(RootFolderName),ContentModel.TYPE_FOLDER).getChildRef();
    [javac]                                                                                                                                   ^
    [javac]   symbol:   variable ContentModel
    [javac]   location: class MetricsScriptApi
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:141: error: cannot find symbol
    [javac]             throw new AccessDeniedException("Access Denied - Current User Must Be Admin");
    [javac]                       ^
    [javac]   symbol:   class AccessDeniedException
    [javac]   location: class MetricsScriptApi
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:144: error: package AuthenticationUtil does not exist
    [javac]          AuthenticationUtil.runAsSystem(new AuthenticationUtil.RunAsWork<Object>() {
    [javac]                                                               ^
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:144: error: cannot find symbol
    [javac]          AuthenticationUtil.runAsSystem(new AuthenticationUtil.RunAsWork<Object>() {
    [javac]          ^
    [javac]   symbol:   variable AuthenticationUtil
    [javac]   location: class MetricsScriptApi
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:161: error: cannot find symbol
    [javac]       RunAsWork<Object> doJob = new AuthenticationUtil.RunAsWork<Object>() {
    [javac]       ^
    [javac]   symbol:   class RunAsWork
    [javac]   location: class MetricsScriptApi
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:161: error: package AuthenticationUtil does not exist
    [javac]       RunAsWork<Object> doJob = new AuthenticationUtil.RunAsWork<Object>() {
    [javac]                                                       ^
    [javac] C:\local\alfresco-src\My Extensions\source\java\org\ext\metrics\jscript\MetricsScriptApi.java:230: error: cannot find symbol
    [javac]       return (Scriptable) AuthenticationUtil.runAs(doJob, "admin");
    [javac]                           ^
    [javac]   symbol:   variable AuthenticationUtil
    [javac]   location: class MetricsScriptApi
    [javac] 70 errors

BUILD FAILED
C:\local\alfresco-src\My Extensions\build.xml:35: Compile failed; see the compiler error output for details.

Total time: 8 seconds
<code>
3 REPLIES 3

sanket
Champ on-the-rise
Champ on-the-rise
I think you have not added the following in your  <path id="class.path"> attribute.


<fileset dir="${alfresco.work.home}/tomcat/webapps/alfresco/WEB-INF/lib" includes="*.jar" />


Can you add it and rebuild ?

patricblues
Champ in-the-making
Champ in-the-making

The "Cannot find symbol" errors generally occur when you try to reference an undeclared variable in your code. A "Cannot find symbol" error means that the compiler cannot do this. Your code appears to be referring to something that the compiler doesn't understand.

When your code is compiled, the compiler needs to work out what each and every identifier in your code means. As the compiler is going through the code it will find something and know what to do with it or not. Your Cannot find symbol error relates to the identifiers and means that Java cannot figure out what the "symbol" means.

The general causes for a Cannot find symbol error are things like:

  • Incorrect spelling.
  • Wrong case. Halo is different from halo.
  • Improper use of acceptable identifier values (letters, numbers, underscore, dollar sign), my-class is not the same as myclass.
  • No variable declaration or variable is outside of the scope you are referencing it in.

kaynezhang
World-Class Innovator
World-Class Innovator
It seems are referencing classes in repository ,but they are not there,please check to see if there are any classes below

/local/alfresco-src/4.2.1/alfresco/TAGS/ENTERPRISE/V4.2.1/root/projects/repository/build

And also make sure classes exists under

/local/alfresco-src/4.2.1/alfresco/TAGS/ENTERPRISE/V4.2.1/root/projects/core/build
/local/alfresco-src/4.2.1/alfresco/TAGS/ENTERPRISE/V4.2.1/root/projects/data-model/build

Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.