Deploying an application with existing library as jar file created with ANT

Discussion in 'Java' started by dev-jared@shaw.ca, Jul 13, 2005.

  1. Guest

    Hello All,

    I am having some trouble with a web application I am deploying to
    Tomcat. I have an custom library that works perfectly as a jar file
    included in the lib directory if I include all the jars that that
    library depends on into the lib directory also. What I would like to do
    is bundle the required jar files into my libraries jar file, but it
    failes to work when I do that.

    Any thoughts? Does Tomcat prevent this?

    I am using ANT to create my jar file, but when I look at the contents
    of my jar file it includes all the requested directories.

    My build.xml looks like this:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <project name="myapp" basedir="." default="jar">
    <property name="classes.dir" value="./classes"/>
    <property name="jar.dir" value="."/>
    <property name="java_lib.dir" value="../../../../../Program
    Files/Java/lib"/>

    <target name="jar">
    <jar destfile="${jar.dir}/${ant.project.name}.jar">
    <fileset dir="classes"/>
    <fileset dir="${java_lib.dir}"
    includes="jai_codec.jar.jar"/>
    <fileset dir="${java_lib.dir}" includes="xercesImpl.jar"/>
    <fileset dir="${java_lib.dir}"
    includes="mysql-connector-java-3.1.8-bin.jar"/>
    <fileset dir="${java_lib.dir}"
    includes="xmlParserAPIs.jar"/>
    <fileset dir="${java_lib.dir}"
    includes="mlibwrapper_jai.jar"/>
    <fileset dir="${java_lib.dir}" includes="xml-apis.jar"/>
    <fileset dir="${java_lib.dir}" includes="jai_core.jar"/>
    </jar>
    </target>
    <target name="run" depends="jar">
    <java jar="${jar.dir}/${ant.project.name}.jar" fork="true"/>
    </target>
    <target name="clean-build" depends="jar"/>
    <target name="main" depends="run"/>
    </project>

    Like I said...it includes these jar files in my jar file, but will not
    function properly with my tomcat app. If I exclude these jar files and
    include them seperately then everything works.

    NOTE: I do not access any of these libraries directly from any
    servlets, only from my classes.

    Thanks,
    J-Rod
    , Jul 13, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Arnold Peters
    Replies:
    0
    Views:
    554
    Arnold Peters
    Jan 5, 2005
  2. muttley
    Replies:
    0
    Views:
    2,689
    muttley
    Oct 20, 2005
  3. cyberco
    Replies:
    4
    Views:
    3,728
    Roedy Green
    Feb 14, 2006
  4. Arnold Peters
    Replies:
    0
    Views:
    639
    Arnold Peters
    Jan 5, 2005
  5. Luigi
    Replies:
    5
    Views:
    48,700
Loading...

Share This Page