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

D

dev-jared

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top