AnsweredAssumed Answered

Running Samples from a jar

Question asked by ryanbobko on Mar 8, 2011
Latest reply on Mar 10, 2011 by ryanbobko
Hey Folks,
I'm on a Ubuntu 10.04 system, running Alfresco 3.4.d. I'm trying to jar up the FirstFoundationClient sample into a jar to run outside of Eclipse. (It runs fine inside Eclipse.) It looks like I'm on the right track, but midway through initialization, I get an error message:

[alfresco.config.JndiPropertyPlaceholderConfigurer] Loading properties file from class path resource [alfresco/]
[alfresco.config.FixedPropertyPlaceholderConfigurer] Loading properties file from class path resource [alfresco/domain/]
Exception in thread "main" org.alfresco.error.AlfrescoRuntimeException: 02080001 File server configuration error, 02080000 Failed to initialize desktop action
Caused by: org.alfresco.error.AlfrescoRuntimeException: 02080000 Failed to initialize desktop action
Caused by: org.alfresco.filesys.alfresco.DesktopActionException: Unable to resolve drag and drop application as a file, class path resource [alfresco/desktop/Alfresco.exe]

I've verified that the alfresco/desktop/Alfresco.exe path is in the jar, though I doubt it does anything on my linux system. Has anyone successfully packaged the samples into a jar? Any ideas how to get this to work, or what part of the config to remove?

Thanks in advance for your help!

By the way, here's a snippet of the build file I'm using:

<path id="classpath">
  <fileset dir="../../lib/server">
    <include name="**/*.jar"/>

<pathconvert property="manifestpath" pathsep=" ">
  <path refid="classpath"/>
        <globmapper from="*.jar" to="lib/*.jar"/>
   <target name="dist" depends="compile">
     <mkdir dir="${dist.dir}"/>
     <mkdir dir="${dist.dir}/lib"/>
     <copy flatten="true" todir="${dist.dir}/lib">
       <fileset dir="../../lib/server" includes="**/*.jar"/>

     <jar destfile="${dist.dir}/sample.jar">
       <fileset  dir="${build.dir}"/>
       <fileset dir="../../lib/server/config" includes="alfresco/**"/>
         <attribute name="Main-Class" value="org.alfresco.sample.FirstFoundationClient"/>
         <attribute name="Class-Path" value="${manifestpath}"/>