Bonsoir a tous ,
j'ai un souci avec la compilation de mon EJB entity , mon EJB se déploie bien mais lors de l’exécution de l'application j'ai le message d'erreur suivant:
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
 
Exception in thread "main" javax.ejb.EJBException: java.lang.IllegalArgumentException: Unknown entity: com.et.Produit
	at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:63)
	at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
	at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
	at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
	at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
	at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
	at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:106)
	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
	at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
	at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
	at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:278)
	at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)
	at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)

voici le main:
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
package com.et;
import java.util.Iterator;
import java.util.List;
import java.util.Properties;
 
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
public class GestionDeStockClient {
   public static void main(String[] args) {
      try {
 
          Properties props = System.getProperties();     
          props.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
          props.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
          props.put("java.naming.provider.url", "localhost:1099");
 
         Context context = new InitialContext(props);
         GestiondeStock stock = (GestiondeStock)
 
 
         context.lookup("GestionDeStockBean/remote");
         // Ne pas faire l'ajout plusieurs fois, commenter ces lignes après la première exécution.
         stock.ajouter(new Produit("1401", "Tomate", 100));
         stock.ajouter(new Produit("1402", "Pomme de terre", 5680));
         stock.ajouter(new Produit("1403", "Orange", 23));
         stock.ajouter(new Produit("1404", "Carotte", 115));
         stock.ajouter(new Produit("1405", "Pomme", 48));
         List<Produit> produits = stock.listerTousLesProduits();
         for (Iterator iter = produits.iterator(); iter.hasNext();) {
            Produit eachProduit = (Produit) iter.next();
            System.out.println(eachProduit);
         }
      } catch (NamingException e) {
         e.printStackTrace();
      }
   }
}
si quelqu'un a une idée elle est la bienvenue