No, you need a SAR file.  Something like this in your
build.xml should do the trick:

  <target name="move-original-sar" depends="init">
    <move todir="${project.dir}">
      <fileset dir="${phoenix.dir}/apps">
        <include name="james.sar"/>
      </fileset>
    </move>
    <delete includeEmptyDirs="true"
failonerror="false">
      <fileset dir="${phoenix.dir}/apps/james"/>
    </delete>
  </target>

  <target name="unzip-sar"
depends="move-original-sar">
    <delete includeEmptyDirs="true"
failonerror="false">
      <fileset dir="${tmp.dir}"/>
    </delete>
    <unjar
      src="${project.dir}/james.sar"
      dest="${tmp.dir}"/>
  </target>

  <target name="compile" depends="unzip-sar">
    <echo>Compiling</echo>
    <javac debug="true" srcdir="src" destdir="build">
      <classpath>
        <pathelement path="${tmp.dir}/SAR-INF/lib"/>
      </classpath>
    </javac>
    <echo>Compiled</echo>
  </target>

  <target name="package-jar" depends="compile">
    <echo>Packaging</echo>
    <copy file="src/etc/server/config.xml"
todir="${tmp.dir}/SAR-INF"/>
    <copy file="src/etc/server/assembly.xml"
todir="${tmp.dir}/SAR-INF"/>
    <copy file="src/etc/server/environment.xml"
todir="${tmp.dir}/SAR-INF"/>
    <delete file="${tmp.dir}/SAR-INF/lib/fubar.jar"/>
    <jar jarfile="${tmp.dir}/SAR-INF/lib/fubar.jar"
      basedir="build"
includes="com/scb/octopus/**/*.class"/>
    <echo>Packaged</echo>
  </target>

  <target name="package-sar" depends="package-jar">
    <delete includeEmptyDirs="true"
failonerror="false">
      <fileset dir="${phoenix.dir}/apps/fubar"/>
    </delete>
    <jar jarfile="${phoenix.dir}/apps/fubar.sar"
      basedir="${tmp.dir}" includes="**/*"/>
  </target>

Gabor

--- radjesh <[EMAIL PROTECTED]> wrote:
> Hi,
>    yes i have used mailets in addition to java code.
> I  built my application and created a jar  file  and
> placed it in JAMES_HOME/apps/james/SAR-INF/lib
> directory.It did work fine, now i when i I  built my
> application and created a WAR  file  and placed it
> in JAMES_HOME/apps/james/SAR-INF/lib directory and
> if i start the James server, am getting the
> following error 
> "nested exception is:
> java.lang.ClassNotFoundException: Requested mailet
> not found: AckDelRejService. looked in [,
> com.scb.octopus.mailets.,
> org.apache.james.transport.mailets.]"
>  
> eventhough i specify the path clearly as 
>
<mailetpackage>com.scb.octopus.mailets</mailetpackage>
> 
>  
> , the mailets are located in
> WEB-INF/Classes/com/scb/octopus/mailets and it is
> not able to identify it. If i mention the path as 
>  
>
<mailetpackage>WEB-INF.Classes.com.scb.octopus.mailets</mailetpackage>
> that wuold mean am trying to chnage the package name
> . I teven tried it and now its saying it cannot find
> the mailet in 
> WEB-INF/Classes/com/scb/octopus/mailets. Its just
> that i need to deploy my applciation as WAR file in
> Apache James. Any help would be most appreciated.
>  
>  
>  Thanks in advance
>  Rajesh
> 
> 
> "Seib, Broc" <[EMAIL PROTECTED]> wrote:
> > Hi,
> > I built my application as a JAR file and placed it
> in 
> > James. When i start James server it is running
> fine, when i 
> > build my application as a WAR file and run James
> Server, it 
> > says it cannot load the mailets as it cannot
> identify the 
> > mailets location although i have specified it
> correctly in 
> > config.xml. Can WAR file be deployed in James. Can
> somebody 
> > please help?
> > 
> > Thanks in advance
> > Rajesh
> 
> I presume you are writing a mailet. You should be
> creating a simple jar
> file containing your classes. I've placed my mailet
> jar files in the
> JAMES_HOME/apps/james/SAR-INF/lib directory.
> 
> -broc
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 
> 
> 
> 
> ...life is what we make it, always has been, always
> will be. 
>    Good Day    
> 
>  
> 
> 
> 
> 
>               
> ---------------------------------
> Do you Yahoo!?
>  Yahoo! Small Business - Try our new resources site! 

Gabor Kincses
Running Mandrake Linux 10.0


                
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - Helps protect you from nasty viruses. 
http://promotions.yahoo.com/new_mail

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to