0

I am trying to generate war file od spring mvc project using apache ant in jenkins. Jenkins is generating war file and also auto deploying but problem is that this war file is not properly building. Here is my build.xml:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>


<project name="myproject" default="war">

    <path id="compile.classpath">
        <fileset dir="WebContent/WEB-INF/lib">
            <include name="*.jar"/>
        </fileset>
    </path>

    <target name="init">
        <mkdir dir="build/classes"/>
        <mkdir dir="dist" />
    </target>

    <target name="compile" depends="init" >
        <javac destdir="build/classes" debug="true" srcdir="src">
            <classpath refid="compile.classpath"/>
        </javac>
    </target>

    <target name="war" depends="compile">
        <war destfile="dist/myproject.war" webxml="WebContent/WEB-INF/web.xml">
            <fileset dir="WebContent"/>
            <lib dir="WebContent/WEB-INF/lib"/>
            <classes dir="build/classes"/>
        </war>
    </target>

    <target name="clean">
        <delete dir="dist" />
        <delete dir="build" />
    </target>

</project>

and here I am getting after deploying on tomcat Kindly look at stack trace. :( here is my stack trace

Cœur
  • 37,241
  • 25
  • 195
  • 267
Irfan Khan
  • 21
  • 5
  • 1
    Post the *complete* stack trace, in a code block. – JB Nizet Aug 13 '15 at 06:04
  • @JBNizet sir complete stack trace is now attached. – Irfan Khan Aug 13 '15 at 07:31
  • What you linked to is not a stack trace. It's a complete log file. It doesn't have any exception related to a webapp not deploying. To the contrary: the last line shows that the war file has been deployed. The file starts with an exception that has nothing to do with your war file, but with the tomcat user database xml file being incorrect. – JB Nizet Aug 13 '15 at 09:53
  • @JBNizet by same steps i successfully deployed other java web application through jenkins ant .but this application is deploying successfully but on start up it gives me this exception. on other hand app is running successfully through eclipse. I am thinking may be ant cannot preperly building my war file. – Irfan Khan Aug 13 '15 at 10:02
  • @JBNizet is this build.xml file builds war file for both spring mvc or simple java projects? – Irfan Khan Aug 13 '15 at 10:07
  • Read the error message: it says: "Unsupported major.minor version 52.0". If you google that message, you'll find **lots** of answers explaining that this means that you're compiling with Java 8, but try running with Java 7. Make sure Jenkins use Java 7. – JB Nizet Aug 13 '15 at 10:33

0 Answers0