I'm trying to deploy my application through the generation of a War file using an Ant File, in which I've wrote this code:
<project name="HelloWorldWS" default="dist" basedir=".">
<description>
Web Services build file
</description>
<!-- set global properties for this build -->
<property name="src" location="src"/>
<property name="build" location="build"/>
<property name="dist" location="dist"/>
<property name="webcontent" location="WebContent"/>
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}"/>
</target>
<target name="compile" depends="init"
description="compile the source " >
<!-- Compile the java code from ${src} into ${build} -->
<javac srcdir="${src}" destdir="${build}"/>
</target>
<target name="dist" depends="compile"
description="generate the distribution" >
<!-- Create the distribution directory -->
<mkdir dir="${dist}/lib"/>
<!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file -->
<jar jarfile="${dist}/lib/MyProject-${DSTAMP}.jar" basedir="${build}"/>
</target>
<target name="war" depends="compile"
description="generate the distribution war" >
<!-- Create the war distribution directory -->
<mkdir dir="${dist}/war"/>
<!-- Follow standard WAR structure -->
<copydir dest="${dist}/war/build/WEB-INF/" src="${webcontent}/WEB-INF/" />
<copydir dest="${dist}/war/build/WEB-INF/classes/" src="${build}" />
<jar jarfile="${dist}/war/HelloWorld-${DSTAMP}.war" basedir="${dist}/war/build/"/>
</target>
<target name="clean"
description="clean up" >
<!-- Delete the ${build} and ${dist} directory trees -->
<delete dir="${build}"/>
<delete dir="${dist}"/>
</target>
</project>
IDE: Eclipse. Local server: Tomcat 7. And i'm using Hibernate
When I run that nt File, I got thsi error:
Buildfile: E:\Bibliothèque logicielle\workspace\projetServices\build.xml init: compile: [javac] E:\Bibliothèque logicielle\workspace\projetServices\build.xml:21: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds [javac] Compiling 45 source files to E:\Bibliothèque logicielle\workspace\projetServices\build [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\dao\CompteDAO.java:5: error: package org.hibernate does not exist [javac] import org.hibernate.Query; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\dao\CompteDAO.java:6: error: package org.hibernate does not exist [javac] import org.hibernate.Session; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\dao\CompteDAO.java:7: error: package org.hibernate does not exist [javac] import org.hibernate.Transaction; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Compte.java:4: error: package javax.persistence does not exist [javac] import javax.persistence.CascadeType; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Compte.java:5: error: package javax.persistence does not exist [javac] import javax.persistence.Column; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Compte.java:6: error: package javax.persistence does not exist [javac] import javax.persistence.Entity; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Compte.java:7: error: package javax.persistence does not exist [javac] import javax.persistence.FetchType; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Compte.java:8: error: package javax.persistence does not exist [javac] import javax.persistence.Id; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Compte.java:9: error: package javax.persistence does not exist [javac] import javax.persistence.JoinColumn; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Compte.java:10: error: package javax.persistence does not exist [javac] import javax.persistence.ManyToMany; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Compte.java:11: error: package javax.persistence does not exist [javac] import javax.persistence.ManyToOne; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Compte.java:12: error: package javax.persistence does not exist [javac] import javax.persistence.OneToMany; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Compte.java:13: error: package javax.persistence does not exist [javac] import javax.persistence.Table; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Compte.java:16: error: package org.hibernate.annotations does not exist [javac] import org.hibernate.annotations.LazyCollection; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Compte.java:17: error: package org.hibernate.annotations does not exist [javac] import org.hibernate.annotations.LazyCollectionOption; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Compte.java:19: error: cannot find symbol [javac] @Entity [javac] ^ [javac] symbol: class Entity [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Compte.java:20: error: cannot find symbol [javac] @Table(name="compte") [javac] ^ [javac] symbol: class Table [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\User.java:4: error: package javax.persistence does not exist [javac] import javax.persistence.Column; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\User.java:5: error: package javax.persistence does not exist [javac] import javax.persistence.Entity; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\User.java:6: error: package javax.persistence does not exist [javac] import javax.persistence.Id; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\User.java:7: error: package javax.persistence does not exist [javac] import javax.persistence.OneToMany; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\User.java:8: error: package javax.persistence does not exist [javac] import javax.persistence.Table; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\User.java:11: error: cannot find symbol [javac] @Entity [javac] ^ [javac] symbol: class Entity [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\User.java:12: error: cannot find symbol [javac] @Table(name="utilisateur") [javac] ^ [javac] symbol: class Table [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Solde.java:2: error: package javax.persistence does not exist [javac] import javax.persistence.CascadeType; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Solde.java:3: error: package javax.persistence does not exist [javac] import javax.persistence.Column; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Solde.java:4: error: package javax.persistence does not exist [javac] import javax.persistence.Entity; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Solde.java:5: error: package javax.persistence does not exist [javac] import javax.persistence.GeneratedValue; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Solde.java:6: error: package javax.persistence does not exist [javac] import javax.persistence.GenerationType; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Solde.java:7: error: package javax.persistence does not exist [javac] import javax.persistence.Id; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Solde.java:8: error: package javax.persistence does not exist [javac] import javax.persistence.JoinColumn; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Solde.java:9: error: package javax.persistence does not exist [javac] import javax.persistence.ManyToOne; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Solde.java:10: error: package javax.persistence does not exist [javac] import javax.persistence.Table; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Solde.java:13: error: cannot find symbol [javac] @Entity [javac] ^ [javac] symbol: class Entity [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Solde.java:14: error: cannot find symbol [javac] @Table(name="solde") [javac] ^ [javac] symbol: class Table [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Mouvement_Compte.java:3: error: package javax.persistence does not exist [javac] import javax.persistence.CascadeType; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Mouvement_Compte.java:4: error: package javax.persistence does not exist [javac] import javax.persistence.Column; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Mouvement_Compte.java:5: error: package javax.persistence does not exist [javac] import javax.persistence.Entity; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Mouvement_Compte.java:6: error: package javax.persistence does not exist [javac] import javax.persistence.GeneratedValue; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Mouvement_Compte.java:7: error: package javax.persistence does not exist [javac] import javax.persistence.GenerationType; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Mouvement_Compte.java:8: error: package javax.persistence does not exist [javac] import javax.persistence.Id; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Mouvement_Compte.java:9: error: package javax.persistence does not exist [javac] import javax.persistence.JoinColumn; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Mouvement_Compte.java:10: error: package javax.persistence does not exist [javac] import javax.persistence.ManyToOne; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Mouvement_Compte.java:11: error: package javax.persistence does not exist [javac] import javax.persistence.Table; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Mouvement_Compte.java:14: error: cannot find symbol [javac] @Entity [javac] ^ [javac] symbol: class Entity [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Mouvement_Compte.java:15: error: cannot find symbol [javac] @Table(name="mouvement_compte") [javac] ^ [javac] symbol: class Table [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Virement.java:7: error: package javax.persistence does not exist [javac] import javax.persistence.CascadeType; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Virement.java:8: error: package javax.persistence does not exist [javac] import javax.persistence.Column; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Virement.java:9: error: package javax.persistence does not exist [javac] import javax.persistence.Entity; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Virement.java:10: error: package javax.persistence does not exist [javac] import javax.persistence.GeneratedValue; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Virement.java:11: error: package javax.persistence does not exist [javac] import javax.persistence.GenerationType; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Virement.java:12: error: package javax.persistence does not exist [javac] import javax.persistence.Id; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Virement.java:13: error: package javax.persistence does not exist [javac] import javax.persistence.JoinColumn; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Virement.java:14: error: package javax.persistence does not exist [javac] import javax.persistence.JoinTable; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Virement.java:15: error: package javax.persistence does not exist [javac] import javax.persistence.ManyToMany; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Virement.java:16: error: package javax.persistence does not exist [javac] import javax.persistence.Table; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Virement.java:19: error: cannot find symbol [javac] @Entity [javac] ^ [javac] symbol: class Entity [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Virement.java:20: error: cannot find symbol [javac] @Table(name="virement") [javac] ^ [javac] symbol: class Table [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\dao\Mouvement_CompteDAO.java:5: error: package org.hibernate does not exist [javac] import org.hibernate.Query; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\dao\Mouvement_CompteDAO.java:6: error: package org.hibernate does not exist [javac] import org.hibernate.Session; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\dao\Mouvement_CompteDAO.java:7: error: package org.hibernate does not exist [javac] import org.hibernate.Transaction; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\dao\SoldeDAO.java:5: error: package org.hibernate does not exist [javac] import org.hibernate.Query; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\dao\SoldeDAO.java:6: error: package org.hibernate does not exist [javac] import org.hibernate.Session; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\dao\SoldeDAO.java:7: error: package org.hibernate does not exist [javac] import org.hibernate.Transaction; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\dao\UserDAO.java:5: error: package org.hibernate does not exist [javac] import org.hibernate.Query; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\dao\UserDAO.java:6: error: package org.hibernate does not exist [javac] import org.hibernate.Session; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\dao\UserDAO.java:7: error: package org.hibernate does not exist [javac] import org.hibernate.Transaction; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\dao\VirementDAO.java:5: error: package org.hibernate does not exist [javac] import org.hibernate.Query; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\dao\VirementDAO.java:6: error: package org.hibernate does not exist [javac] import org.hibernate.Session; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\dao\VirementDAO.java:7: error: package org.hibernate does not exist [javac] import org.hibernate.Transaction; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\services\HibernateUtils.java:3: error: package org.hibernate does not exist [javac] import org.hibernate.HibernateException; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\services\HibernateUtils.java:4: error: package org.hibernate does not exist [javac] import org.hibernate.Session; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\services\HibernateUtils.java:5: error: package org.hibernate does not exist [javac] import org.hibernate.SessionFactory; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\services\HibernateUtils.java:6: error: package org.hibernate.cfg does not exist [javac] import org.hibernate.cfg.AnnotationConfiguration; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\services\HibernateUtils.java:9: error: cannot find symbol [javac] private static final SessionFactory sessionFactory; [javac] ^ [javac] symbol: class SessionFactory [javac] location: class HibernateUtils [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\services\HibernateUtils.java:23: error: cannot find symbol [javac] public static Session getSession() throws HibernateException {
[javac] ^ [javac] symbol: class Session [javac] location: class HibernateUtils [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\services\HibernateUtils.java:23: error: cannot find symbol [javac] public static Session getSession() throws HibernateException {
[javac] ^ [javac] symbol: class HibernateException [javac] location: class HibernateUtils [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\services\Service.java:17: error: package org.hibernate does not exist [javac] import org.hibernate.HibernateException; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\services\Service.java:18: error: package org.hibernate does not exist [javac] import org.hibernate.Query; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\services\Service.java:19: error: package org.hibernate does not exist [javac] import org.hibernate.Session; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\services\Service.java:20: error: package org.hibernate does not exist [javac] import org.hibernate.Transaction; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\services\Service.java:33: error: cannot find symbol [javac] private static Session s = null; [javac] ^ [javac] symbol: class Session [javac] location: class Service [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\tests\test.java:6: error: package org.hibernate does not exist [javac] import org.hibernate.Query; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\tests\test.java:7: error: package org.hibernate does not exist [javac] import org.hibernate.Session; [javac] ^ [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\tests\test.java:12: error: cannot find symbol [javac] private static Session s = null; [javac] ^ [javac] symbol: class Session [javac] location: class test [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Compte.java:23: error: cannot find symbol [javac] @Id [javac] ^ [javac] symbol: class Id [javac] location: class Compte [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Compte.java:24: error: cannot find symbol [javac] @Column(name="compte_rib") [javac] ^ [javac] symbol: class Column [javac] location: class Compte [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Compte.java:27: error: cannot find symbol [javac] @ManyToOne(cascade={CascadeType.PERSIST, CascadeType.MERGE}) [javac] ^ [javac] symbol: class ManyToOne [javac] location: class Compte [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Compte.java:28: error: cannot find symbol [javac] @LazyCollection(LazyCollectionOption.FALSE) [javac] ^ [javac] symbol: class LazyCollection [javac] location: class Compte [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Compte.java:29: error: cannot find symbol [javac] @JoinColumn(name="compte_utilisateurIdentifiant") [javac] ^ [javac] symbol: class JoinColumn [javac] location: class Compte [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Compte.java:32: error: cannot find symbol [javac] @Column(name="compte_libelle") [javac] ^ [javac] symbol: class Column [javac] location: class Compte [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Compte.java:35: error: cannot find symbol [javac] @OneToMany(fetch = FetchType.EAGER, mappedBy="compte") [javac] ^ [javac] symbol: class OneToMany [javac] location: class Compte [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Compte.java:36: error: cannot find symbol [javac] @LazyCollection(LazyCollectionOption.FALSE) [javac] ^ [javac] symbol: class LazyCollection [javac] location: class Compte [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Compte.java:39: error: cannot find symbol [javac] @Column(name="compte_dateCreation", nullable=false) [javac] ^ [javac] symbol: class Column [javac] location: class Compte [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Compte.java:41: error: cannot find symbol [javac] @Column(name="compte_dateMaj", nullable=false) [javac] ^ [javac] symbol: class Column [javac] location: class Compte [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Compte.java:43: error: cannot find symbol [javac] @Column(name="compte_typeDevise", nullable=false) [javac] ^ [javac] symbol: class Column [javac] location: class Compte [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Compte.java:45: error: cannot find symbol [javac] @Column(name="compte_situationCompte", nullable=false) [javac] ^ [javac] symbol: class Column [javac] location: class Compte [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Compte.java:48: error: cannot find symbol [javac] @OneToMany(mappedBy="compte2") [javac] ^ [javac] symbol: class OneToMany [javac] location: class Compte [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Compte.java:49: error: cannot find symbol [javac] @LazyCollection(LazyCollectionOption.FALSE) [javac] ^ [javac] symbol: class LazyCollection [javac] location: class Compte [javac] E:\Bibliothèque logicielle\workspace\projetServices\src\com\bh\jpa\Compte.java:53: error: cannot find symbol [javac] @ManyToMany(cascade = {CascadeType.ALL}, [javac] ^ [javac] symbol: class ManyToMany [javac] location: class Compte [javac] 100 errorsBUILD FAILED E:\Bibliothèque logicielle\workspace\projetServices\build.xml:21: Compile failed; see the compiler error output for details.
Total time: 2 seconds
Any help please?