Bonjour,

J'ai un problème lors de l'exécution de mon programme. Je souhaite créer deux tables sur le serveur d'application JBoss mais j'ai des problème avec ce dernier qui empêche la création des mes tables.

Voici mon code :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
package CommProd;
 
import java.util.ArrayList;
 
import java.util.Date;
import javax.persistence.*;
import javax.persistence.Temporal;
 
/**
 * @author khadi
 */
@Entity
@Table(name="Commande") 
public class Commande  {
 
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "numéro", length=20) 
    private int num;
 
    @Column(name = "prix", length=20) 
    private float prix;
 
 
    @Temporal(javax.persistence.TemporalType.DATE)
    private  Date date;
 
    @Column(name = "client", length=20) 
    private String client;
    @OneToMany(mappedBy="commande")
    private ArrayList<Produit>p;
 
    public Commande() {
        num=0;
        prix=0;
        date=null;
        client="";
    }
 
    public Commande(int num, int prix, Date date, String client, ArrayList<Produit> p) {
        this.num = num;
        this.prix = prix;
        this.date = date;
        this.client = client;
        this.p = p;
    }
 
    public String getClient() {
        return client;
    }
 
    public void setClient(String client) {
        this.client = client;
    }
 
    public Date getDate() {
        return date;
    }
 
    public void setDate(Date date) {
        this.date = date;
    }
 
    public int getNum() {
        return num;
    }
 
    public void setNum(int num) {
        this.num = num;
    }
 
    public ArrayList<Produit> getP() {
        return p;
    }
 
    public void setP(ArrayList<Produit> p) {
        this.p = p;
    }
 
    public float getPrix() {
        return prix;
    }
 
    public void setPrix(int prix) {
        this.prix = prix;
    }
}
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
package CommProd;
 
import java.util.Date;
import javax.persistence.*;
import javax.persistence.Id;
import javax.persistence.Temporal;
 
/**
 * @author khadi
 */
@Entity
@Table(name="Produit") 
public class Produit {
    private static final long serialVersionUID = 1L;
    @Id
 
    @Column(name = "nomProduit", length=20) 
    private String nom;
 
    @Column(name = "quantitéProduit", length=20) 
   private  float quantite;
    @Temporal(javax.persistence.TemporalType.DATE)
 
   private  Date dexp;
 
  @Column(name = "typeTransport", length=20)   
   private  String transport;
    @ManyToOne
   private Commande commande;
 
    public Produit() {
        nom="";
        quantite=0;
        dexp=null;
        transport="";
        commande=null;
    }
 
    public Produit(String nom, float quantite, Date dexp, String transport,Commande commande) {
        this.nom = nom;
        this.quantite = quantite;
        this.dexp = dexp;
        this.transport = transport;
        this.commande= new Commande();
    }
 
    public Date getDexp() {
        return dexp;
    }
 
    public void setDexp(Date dexp) {
        this.dexp = dexp;
    }
 
    public String getNom() {
        return nom;
    }
 
    public void setNom(String nom) {
        this.nom = nom;
    }
 
    public float getQuantite() {
        return quantite;
    }
 
    public void setQuantite(float quantite) {
        this.quantite = quantite;
    }
 
    public String getTransport() {
        return transport;
    }
 
    public void setTransport(String transport) {
        this.transport = transport;
    }
 
      public Commande getCommande() {
        return commande;
    }
 
    public void setCommande(Commande commande) {
        this.commande = commande;
    }
}
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package CommProd;
 
import java.util.Date;
import javax.ejb.*;
 
/**
 * @author khadi
 */
@Remote
public interface Ioper {
 
    public void insertion(String nom, float quantite,Date d,String transp,Commande com);
    public void affichage(String client);
    public void recherche(int annee);
}
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package CommProd;
 
import java.util.ArrayList;
import java.util.Date;
import javax.ejb.Stateless;
import javax.persistence.*;
 
/**
 * @author khadi
 */
@Stateless
 
public class Operation implements Ioper {
 
   @PersistenceContext(unitName="IntroEJB3")
    EntityManager em;
 
    public Operation() {
        // TODO Auto-generated constructor stub
    }
 
    /**
     * @see IComProd#affichage(String)
     */
    public void affichage(String client) {
        // TODO Auto-generated method stub
      Commande c = em.find(Commande.class, client);
 
        ArrayList<Produit> p = c.getP();
for (Produit pro : p)
{
    System.out.println(" Produit : "+pro+" Quantité : "+pro.getQuantite());
 
}
 
    }
 
    /**
     * @see IComProd#recherche(int)
     */
    public void recherche(int dexp) {
        dexp=2013;
         Produit p = em.find(Produit.class, dexp);
      System.out.println(p.getNom());
    }
 
    @Override
    public void insertion(String nom, float quantite, Date d, String transp,Commande com) {
        Produit produit=new Produit(nom,quantite,d,transp,com);
        em.persist(produit);
 
    }
 
    // Add business logic below. (Right-click in editor and choose
    // "Insert Code > Add Business Method")
}
voici l'erreur que j'ai
java.lang.RuntimeException: java.lang.NoClassDefFoundError: javax/persistence/spi/ProviderUtil
at org.jboss.ejb3.ServiceDelegateWrapper.startService(ServiceDelegateWrapper.java:109)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:417)
at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy60.start(Unknown Source)
at org.jboss.ejb3.JmxKernelAbstraction.install(JmxKernelAbstraction.java:120)
at org.jboss.ejb3.Ejb3Deployment.startPersistenceUnits(Ejb3Deployment.java:551)
at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:333)
at org.jboss.ejb3.Ejb3Module.startService(Ejb3Module.java:91)
at
......
Quelqu'un saurait-il m'indiquer comment résoudre cette erreur ?

Merci d'avance pour votre aide.