Précédent   Forum du club des développeurs et IT Pro > Java > Serveurs, conteneurs, et Java EE > Java EE
Java EE Forum d'entraide sur la norme Java EE (EJB, JMS, etc.). Avant de poster -> FAQ Java EE
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse
 
Outils de la discussion
Publicité
'
Vieux 05/11/2012, 22h09   #1
sheridan08
Membre du Club
 
informatique
Inscription : novembre 2009
Messages : 114
Détails du profil
Informations personnelles :
Localisation : France

Informations professionnelles :
Activité : informatique

Informations forums :
Inscription : novembre 2009
Messages : 114
Points : 46
Points : 46
Par défaut Problème de compilation

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 :
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 :
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
sheridan08 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/11/2012, 22h16   #2
fxrobin
Membre Expert
 
Avatar de fxrobin
 
Homme
Formateur JAVA / XML
Inscription : novembre 2007
Messages : 849
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : France

Informations professionnelles :
Activité : Formateur JAVA / XML
Secteur : Service public

Informations forums :
Inscription : novembre 2007
Messages : 849
Points : 1 277
Points : 1 277
la stack trace c'est celle côté serveur ?

tu peux montrer ton EJB Entity "Produit" ?
fxrobin est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/11/2012, 22h42   #3
sheridan08
Membre du Club
 
informatique
Inscription : novembre 2009
Messages : 114
Détails du profil
Informations personnelles :
Localisation : France

Informations professionnelles :
Activité : informatique

Informations forums :
Inscription : novembre 2009
Messages : 114
Points : 46
Points : 46
Citation:
la stack trace c'est celle côté serveur ?
en fait c'est ce qui est affiché dans "console"
package com.et;

Code :
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
import java.io.Serializable;
import javax.persistence.Table;
import javax.persistence.Id;
import javax.persistence.Column;
 
import org.hibernate.annotations.Entity;
 
@Entity
@Table(name="table_Produit")
	public class Produit implements Serializable {
	   @Id
	   private String id;
	   @Column(name = "libelle_Column")
	   private String libelle;
	   private int quantiteEnStock;
	   public Produit() {
	      super();
	   }
	   public Produit(String id) {
	      this.id = id;
	   }
	   public Produit(String id, String libelle, int quantiteEnStock) {
	      this.id = id;
	      this.libelle = libelle;
	      this.quantiteEnStock = quantiteEnStock;
	   }
	   public String getLibelle() {
	      return libelle;
	   }
	   public void setLibelle(String libelle) {
	      this.libelle = libelle;
	   }
	   public int getQuantiteEnStock() {
	      return quantiteEnStock;
	   }
	   public void setQuantiteEnStock(int quantiteEnStock) {
	      this.quantiteEnStock = quantiteEnStock;
	   }
	   public String getId() {
	      return id;
	   }
	   public String toString() {
	      return "Produit n°" + id + " - " + libelle + " - quantité disponible : " +
	quantiteEnStock;
	   }
 
}
Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package com.et;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
@Stateless
public class GestionDeStockBean implements GestiondeStock {
   @PersistenceContext (unitName="testdb")
   EntityManager em;
   public void ajouter(Produit produit) {
      em.persist(produit);
   }
   public Produit rechercherProduit(String id) {
      return em.find(Produit.class, id);
   }
   public List<Produit> listerTousLesProduits() {
      return em.createQuery("SELECT p FROM Produit p ORDER BY p.quantiteEnStock").getResultList();
   }
}
sheridan08 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 06/11/2012, 08h22   #4
fxrobin
Membre Expert
 
Avatar de fxrobin
 
Homme
Formateur JAVA / XML
Inscription : novembre 2007
Messages : 849
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : France

Informations professionnelles :
Activité : Formateur JAVA / XML
Secteur : Service public

Informations forums :
Inscription : novembre 2007
Messages : 849
Points : 1 277
Points : 1 277
essaye en déclarant ta classe "Produit" dans le fichier "persistence.xml".

Tu peux montrer du fichier "persistence.xml".
fxrobin est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 06/11/2012, 17h11   #5
sheridan08
Membre du Club
 
informatique
Inscription : novembre 2009
Messages : 114
Détails du profil
Informations personnelles :
Localisation : France

Informations professionnelles :
Activité : informatique

Informations forums :
Inscription : novembre 2009
Messages : 114
Points : 46
Points : 46
fichier persistance.xml

Code :
1
2
3
4
5
6
7
8
9
<persistence>
   <persistence-unit name="testdb">
      <jta-data-source>java:/DefaultDS</jta-data-source>
      <properties>
         <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
         <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
      </properties>
   </persistence-unit>
</persistence>
comment déclaré ma classe produit dans un ce fichier ?
sheridan08 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 07/11/2012, 07h48   #6
fxrobin
Membre Expert
 
Avatar de fxrobin
 
Homme
Formateur JAVA / XML
Inscription : novembre 2007
Messages : 849
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : France

Informations professionnelles :
Activité : Formateur JAVA / XML
Secteur : Service public

Informations forums :
Inscription : novembre 2007
Messages : 849
Points : 1 277
Points : 1 277
Voici un exemple :

Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
 
<persistence>
   <persistence-unit name="manager1">
       <jta-data-source>java:/DefaultDS</jta-data-source>
       <class>org.acme.Employee</class>
       <class>org.acme.Person</class>
       <class>org.acme.Address</class>
       <properties>
            <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
            <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
       </properties>
   </persistence-unit>
</persistence>
tiré de cet exemple :
http://docs.jboss.org/ejb3/app-serve...ityconfig.html
fxrobin est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 07/11/2012, 21h08   #7
sheridan08
Membre du Club
 
informatique
Inscription : novembre 2009
Messages : 114
Détails du profil
Informations personnelles :
Localisation : France

Informations professionnelles :
Activité : informatique

Informations forums :
Inscription : novembre 2009
Messages : 114
Points : 46
Points : 46
toujours rien , je n'arrive pas a localiser l'erreur , a chaque modification j'ai d'autres erreur qui apparaissent.
j'ai envoyé comme fichier joint l'ensemble de mes classe
voici aussi le fichier persistance.xml



Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
 
<persistence>
   <persistence-unit name="testdb">
 
      <jta-data-source>java:/DefaultDS</jta-data-source>
       <class>org.acme.Produit</class>
        <class>org.acme.GestionDeStockBean</class>
       <properties>
         <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
         <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
      </properties>
   </persistence-unit>
</persistence>
voila ce que j'ai lors de l’exécution de l'application
Code :
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
 
javax.naming.NameNotFoundException: GestionDeStockBean not bound
	at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
	at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
	at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
	at org.jnp.server.NamingServer.lookup(NamingServer.java:267)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
	at sun.rmi.transport.Transport$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.Transport.serviceCall(Unknown Source)
	at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
	at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
	at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
	at sun.rmi.server.UnicastRef.invoke(Unknown Source)
	at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
	at javax.naming.InitialContext.lookup(Unknown Source)
	at com.et.GestionDeStockClient.main(GestionDeStockClient.java:22)
et voici ce que j'ai lors du lancement du serveur et le deployeme,t de l'EJB


Code :
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
21:01:08,531 INFO  [Server] Starting JBoss (MX MicroKernel)...
21:01:08,533 INFO  [Server] Release ID: JBoss [Trinity] 4.2.0.GA (build: SVNTag=JBoss_4_2_0_GA date=200705111440)
21:01:08,534 INFO  [Server] Home Dir: C:\jboss-4.2.0.GA
21:01:08,534 INFO  [Server] Home URL: file:/C:/jboss-4.2.0.GA/
21:01:08,540 INFO  [Server] Patch URL: null
21:01:08,540 INFO  [Server] Server Name: default
21:01:08,541 INFO  [Server] Server Home Dir: C:\jboss-4.2.0.GA\server\default
21:01:08,541 INFO  [Server] Server Home URL: file:/C:/jboss-4.2.0.GA/server/default/
21:01:08,541 INFO  [Server] Server Log Dir: C:\jboss-4.2.0.GA\server\default\log
21:01:08,548 INFO  [Server] Server Temp Dir: C:\jboss-4.2.0.GA\server\default\tmp
21:01:08,548 INFO  [Server] Root Deployment Filename: jboss-service.xml
21:01:08,852 INFO  [ServerInfo] Java version: 1.6.0_37,Sun Microsystems Inc.
21:01:08,852 INFO  [ServerInfo] Java VM: Java HotSpot(TM) Client VM 20.12-b01,Sun Microsystems Inc.
21:01:08,852 INFO  [ServerInfo] OS-System: Windows 7 6.1,x86
21:01:09,204 INFO  [Server] Core system initialized
21:01:10,781 INFO  [WebService] Using RMI server codebase: http://127.0.0.1:8083/
21:01:10,784 INFO  [Log4jService$URLWatchTimerTask] Configuring from URL: resource:jboss-log4j.xml
21:01:11,169 INFO  [TransactionManagerService] JBossTS Transaction Service (JTA version) - JBoss Inc.
21:01:11,169 INFO  [TransactionManagerService] Setting up property manager MBean and JMX layer
21:01:11,346 INFO  [TransactionManagerService] Starting recovery manager
21:01:11,422 INFO  [TransactionManagerService] Recovery manager started
21:01:11,422 INFO  [TransactionManagerService] Binding TransactionManager JNDI Reference
21:01:13,441 INFO  [EJB3Deployer] Starting java:comp multiplexer
21:01:14,694 INFO  [ServiceEndpointManager] jbossws-1.2.1.GA (build=200704151756)
21:01:15,741 INFO  [AprLifecycleListener] The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre6\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre6/bin/client;C:/Program Files/Java/jre6/bin;C:/Program Files/Java/jre6/lib/i386;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Windows Live\Shared;C:\Program Files\Common Files\Roxio Shared\DLLShared\;C:\Program Files\Common Files\Roxio Shared\10.0\DLLShared\;C:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\Microsoft Visual Studio\Common\Tools\WinNT;C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin;C:\Program Files\Microsoft Visual Studio\Common\Tools;C:\Program Files\Microsoft Visual Studio\VC98\bin;C:\javaEE\eclipse;;.
21:01:15,802 INFO  [Http11Protocol] Initialisation de Coyote HTTP/1.1 sur http-127.0.0.1-8080
21:01:15,806 INFO  [AjpProtocol] Initializing Coyote AJP/1.3 on ajp-127.0.0.1-8009
21:01:15,806 INFO  [Catalina] Initialization processed in 216 ms
21:01:15,806 INFO  [StandardService] Démarrage du service jboss.web
21:01:15,808 INFO  [StandardEngine] Starting Servlet Engine: JBossWeb/2.0.0.GA
21:01:15,850 INFO  [Catalina] Server startup in 43 ms
21:01:15,934 INFO  [TomcatDeployer] deploy, ctxPath=/, warUrl=.../deploy/jboss-web.deployer/ROOT.war/
21:01:16,552 INFO  [TomcatDeployer] deploy, ctxPath=/invoker, warUrl=.../deploy/http-invoker.sar/invoker.war/
21:01:16,724 INFO  [TomcatDeployer] deploy, ctxPath=/jbossws, warUrl=.../tmp/deploy/tmp2030068414489725228jbossws-context-exp.war/
21:01:16,819 INFO  [TomcatDeployer] deploy, ctxPath=/jbossmq-httpil, warUrl=.../deploy/jms/jbossmq-httpil.sar/jbossmq-httpil.war/
21:01:17,357 INFO  [TomcatDeployer] deploy, ctxPath=/web-console, warUrl=.../deploy/management/console-mgr.sar/web-console.war/
21:01:17,748 INFO  [MailService] Mail Service bound to java:/Mail
21:01:17,880 INFO  [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jboss-ha-local-jdbc.rar
21:01:17,950 INFO  [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jboss-ha-xa-jdbc.rar
21:01:17,980 INFO  [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jboss-local-jdbc.rar
21:01:18,013 INFO  [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jboss-xa-jdbc.rar
21:01:18,069 INFO  [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jms/jms-ra.rar
21:01:18,098 INFO  [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/quartz-ra.rar
21:01:18,107 INFO  [QuartzResourceAdapter] start quartz!!!
21:01:18,156 INFO  [SimpleThreadPool] Job execution threads will use class loader of thread: main
21:01:18,182 INFO  [QuartzScheduler] Quartz Scheduler v.1.5.2 created.
21:01:18,184 INFO  [RAMJobStore] RAMJobStore initialized.
21:01:18,184 INFO  [StdSchedulerFactory] Quartz scheduler 'DefaultQuartzScheduler' initialized from default resource file in Quartz package: 'quartz.properties'
21:01:18,184 INFO  [StdSchedulerFactory] Quartz scheduler version: 1.5.2
21:01:18,184 INFO  [QuartzScheduler] Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED started.
21:01:19,024 INFO  [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=DefaultDS' to JNDI name 'java:DefaultDS'
21:01:19,230 INFO  [A] Bound to JNDI name: queue/A
21:01:19,231 INFO  [B] Bound to JNDI name: queue/B
21:01:19,232 INFO  [C] Bound to JNDI name: queue/C
21:01:19,233 INFO  [D] Bound to JNDI name: queue/D
21:01:19,237 INFO  [ex] Bound to JNDI name: queue/ex
21:01:19,253 INFO  [testTopic] Bound to JNDI name: topic/testTopic
21:01:19,254 INFO  [securedTopic] Bound to JNDI name: topic/securedTopic
21:01:19,255 INFO  [testDurableTopic] Bound to JNDI name: topic/testDurableTopic
21:01:19,258 INFO  [testQueue] Bound to JNDI name: queue/testQueue
21:01:19,294 INFO  [UILServerILService] JBossMQ UIL service available at : /127.0.0.1:8093
21:01:19,318 INFO  [DLQ] Bound to JNDI name: queue/DLQ
21:01:19,412 INFO  [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA' to JNDI name 'java:JmsXA'
21:01:19,630 INFO  [JmxKernelAbstraction] creating wrapper delegate for: org.jboss.ejb3.entity.PersistenceUnitDeployment
21:01:19,633 INFO  [JmxKernelAbstraction] installing MBean: persistence.units:jar=EJB3entité.jar,unitName=testdb with dependencies:
21:01:19,633 INFO  [JmxKernelAbstraction] 	jboss.jca:name=DefaultDS,service=DataSourceBinding
21:01:19,635 INFO  [PersistenceUnitDeployment] Starting persistence unit persistence.units:jar=EJB3entité.jar,unitName=testdb
21:01:19,662 INFO  [Version] Hibernate EntityManager 3.2.1.GA
21:01:19,680 INFO  [Version] Hibernate Annotations 3.2.1.GA
21:01:19,686 INFO  [Environment] Hibernate 3.2.3
21:01:19,692 INFO  [Environment] hibernate.properties not found
21:01:19,694 INFO  [Environment] Bytecode provider name : javassist
21:01:19,698 INFO  [Environment] using JDK 1.4 java.sql.Timestamp handling
21:01:19,839 WARN  [Ejb3Configuration] Persistence provider caller does not implements the EJB3 spec correctly. PersistenceUnitInfo.getNewTempClassLoader() is null.
21:01:19,846 WARN  [ServiceController] Problem starting service persistence.units:jar=EJB3entité.jar,unitName=testdb
javax.persistence.PersistenceException: [PersistenceUnit: testdb] class or package not found
	at org.hibernate.ejb.Ejb3Configuration.addNamedAnnotatedClasses(Ejb3Configuration.java:1089)
	at org.hibernate.ejb.Ejb3Configuration.addClassesToSessionFactory(Ejb3Configuration.java:886)
	at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:772)
	at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:407)
	at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:126)
	at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:246)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.jboss.ejb3.ServiceDelegateWrapper.startService(ServiceDelegateWrapper.java:103)
	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(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	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(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	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 $Proxy57.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 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(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	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(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	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 $Proxy33.start(Unknown Source)
	at org.jboss.ejb3.EJB3Deployer.start(EJB3Deployer.java:512)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
	at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
	at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
	at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
	at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
	at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
	at org.jboss.ws.integration.jboss42.DeployerInterceptor.start(DeployerInterceptor.java:93)
	at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
	at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
	at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
	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 $Proxy34.start(Unknown Source)
	at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
	at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
	at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
	at sun.reflect.GeneratedMethodAccessor19.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
	at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
	at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
	at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
	at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
	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 $Proxy9.deploy(Unknown Source)
	at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
	at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
	at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
	at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
	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(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	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(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	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 $Proxy4.start(Unknown Source)
	at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
	at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
	at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
	at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
	at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
	at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
	at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
	at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
	at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
	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 $Proxy5.deploy(Unknown Source)
	at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
	at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
	at org.jboss.Main.boot(Main.java:200)
	at org.jboss.Main$1.run(Main.java:508)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: No ClassLoaders found for: org.acme.Produit
	at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:212)
	at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:514)
	at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:408)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Unknown Source)
	at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:112)
	at org.hibernate.ejb.Ejb3Configuration.classForName(Ejb3Configuration.java:1005)
	at org.hibernate.ejb.Ejb3Configuration.addNamedAnnotatedClasses(Ejb3Configuration.java:1077)
	... 147 more
21:01:19,881 INFO  [JmxKernelAbstraction] creating wrapper delegate for: org.jboss.ejb3.stateless.StatelessContainer
21:01:19,886 INFO  [JmxKernelAbstraction] installing MBean: jboss.j2ee:jar=EJB3entité.jar,name=GestionDeStockBean,service=EJB3 with dependencies:
21:01:19,886 INFO  [JmxKernelAbstraction] 	persistence.units:jar=EJB3entité.jar,unitName=testdb
21:01:19,887 INFO  [EJB3Deployer] Deployed: file:/C:/jboss-4.2.0.GA/server/default/deploy/EJB3entité.jar
21:01:19,919 INFO  [JmxKernelAbstraction] creating wrapper delegate for: org.jboss.ejb3.stateful.StatefulContainer
21:01:19,921 INFO  [JmxKernelAbstraction] installing MBean: jboss.j2ee:jar=panier.jar,name=PanierBean,service=EJB3 with dependencies:
21:01:20,107 INFO  [EJBContainer] STARTED EJB: Panier.PanierBean ejbName: PanierBean
21:01:20,146 INFO  [EJB3Deployer] Deployed: file:/C:/jboss-4.2.0.GA/server/default/deploy/panier.jar
21:01:20,165 INFO  [TomcatDeployer] deploy, ctxPath=/jmx-console, warUrl=.../deploy/jmx-console.war/
21:01:20,351 ERROR [URLDeploymentScanner] Incomplete Deployment listing:
 
--- MBeans waiting for other MBeans ---
ObjectName: persistence.units:jar=EJB3entité.jar,unitName=testdb
  State: FAILED
  Reason: javax.persistence.PersistenceException: [PersistenceUnit: testdb] class or package not found
  I Depend On:
    jboss.jca:service=DataSourceBinding,name=DefaultDS
  Depends On Me:
    jboss.j2ee:jar=EJB3entité.jar,name=GestionDeStockBean,service=EJB3
 
ObjectName: jboss.j2ee:jar=EJB3entité.jar,name=GestionDeStockBean,service=EJB3
  State: NOTYETINSTALLED
  I Depend On:
    persistence.units:jar=EJB3entité.jar,unitName=testdb
 
--- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
ObjectName: persistence.units:jar=EJB3entité.jar,unitName=testdb
  State: FAILED
  Reason: javax.persistence.PersistenceException: [PersistenceUnit: testdb] class or package not found
  I Depend On:
    jboss.jca:service=DataSourceBinding,name=DefaultDS
  Depends On Me:
    jboss.j2ee:jar=EJB3entité.jar,name=GestionDeStockBean,service=EJB3
 
 
21:01:20,426 INFO  [Http11Protocol] Démarrage de Coyote HTTP/1.1 sur http-127.0.0.1-8080
21:01:20,445 INFO  [AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
21:01:20,461 INFO  [Server] JBoss (MX MicroKernel) [4.2.0.GA (build: SVNTag=JBoss_4_2_0_GA date=200705111440)] Started in 11s:910ms
Fichiers attachés
Type de fichier : rar et.rar (1,8 Ko, 1 affichages)
sheridan08 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 07/11/2012, 21h31   #8
fxrobin
Membre Expert
 
Avatar de fxrobin
 
Homme
Formateur JAVA / XML
Inscription : novembre 2007
Messages : 849
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : France

Informations professionnelles :
Activité : Formateur JAVA / XML
Secteur : Service public

Informations forums :
Inscription : novembre 2007
Messages : 849
Points : 1 277
Points : 1 277
donc déjà ta première exception indique soit que ton EJB Session s'est mal déployé, soit que le nom JNDI que tu donnes n'est pas correct.
fxrobin est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 07/11/2012, 22h07   #9
sheridan08
Membre du Club
 
informatique
Inscription : novembre 2009
Messages : 114
Détails du profil
Informations personnelles :
Localisation : France

Informations professionnelles :
Activité : informatique

Informations forums :
Inscription : novembre 2009
Messages : 114
Points : 46
Points : 46
Code :
1
2
3
4
5
6
Buildfile: C:\javaEE\eclipse\plugins\org.eclipse.jst.server.generic.jboss_1.6.1.v200904151730\buildfiles\jboss323.xml
deploy.j2ee.ejb:
      [jar] Building jar: C:\Users\feriel\workspace\javaEE-essai\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\EJB3entité.jar
     [move] Moving 1 file to C:\jboss-4.2.0.GA\server\default\deploy
BUILD SUCCESSFUL
Total time: 10 seconds
voila ce que j'ai lorsque je garde le même fichier persistance , d’après ce que je vois mon EJB c'est bien déploie , mais apres exécution toujours rien , et puis quand j'essai de redéploié , mon EJB ne se déploie plus ,
j'ai toujours l'exeption . j'ai bien declaré ma classe dans mon fichier persistance.

Code :
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
javax.naming.NameNotFoundException: GestionDeStockBean not bound
	at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
	at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
	at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
	at org.jnp.server.NamingServer.lookup(NamingServer.java:267)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
	at sun.rmi.transport.Transport$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.Transport.serviceCall(Unknown Source)
	at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
	at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
	at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
	at sun.rmi.server.UnicastRef.invoke(Unknown Source)
	at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
	at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
	at javax.naming.InitialContext.lookup(Unknown Source)
	at com.et.GestionDeStockClient.main(GestionDeStockClient.java:22)
sheridan08 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 08/11/2012, 08h01   #10
fxrobin
Membre Expert
 
Avatar de fxrobin
 
Homme
Formateur JAVA / XML
Inscription : novembre 2007
Messages : 849
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : France

Informations professionnelles :
Activité : Formateur JAVA / XML
Secteur : Service public

Informations forums :
Inscription : novembre 2007
Messages : 849
Points : 1 277
Points : 1 277
Malheureusement tu es sous JBoss avec "client réseau" et ça dépasse le cadre de mes compétences.

Il faut que tu soies sûr de ta chaine JNDI ... ce qui est sûrement le problème.

Pour le coup du redéploiement, il faut que le log du déploiement de ton JAR soit "propre". Qu'il n'y ait aucune erreur. Normalement JBOSS devrait te donner le nom JNDI de ton EJB Session déployé ainsi que le log de création de tes tables en base de données.

En tout cas c'est ce que GlassFish fait.


C'est ce tuto que tu as fait ?
http://www.eclipsetotale.com/article...lipse.html#A25
fxrobin est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 09/11/2012, 09h48   #11
sheridan08
Membre du Club
 
informatique
Inscription : novembre 2009
Messages : 114
Détails du profil
Informations personnelles :
Localisation : France

Informations professionnelles :
Activité : informatique

Informations forums :
Inscription : novembre 2009
Messages : 114
Points : 46
Points : 46
Citation:
Malheureusement tu es sous JBoss avec "client réseau" et ça dépasse le cadre de mes compétences.
comment a tu su que je travaille avec "client reseau", ?

Citation:
Il faut que tu soies sûr de ta chaine JNDI ... ce qui est sûrement le problème.
je me suis documenté sur ce qu'etait JNDI, et normalement c'est ce bout de code qui pose problème
Code :
1
2
3
4
5
6
7
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");
l'exception que j'ai est :
Code :
javax.naming.NameNotFoundException: GestionDeStockBean not bound
cela signifie que l'association d'un objet a un nom n'a pas etait faite
Citation:
Pour le coup du redéploiement, il faut que le log du déploiement de ton JAR soit "propre". Qu'il n'y ait aucune erreur
comment vérifier cela , ou se trouve le log du déploiement du JAR?

Citation:
Normalement JBOSS devrait te donner le nom JNDI de ton EJB Session déployé ainsi que le log de création de tes tables en base de données.
ou devrais je le trouver ,dans la console(après compilation)? ou bien lorsque je me connecte a la page de JBoss


oui c'est bien le TP que j'essai de faire

désolé pour mes questions ,je suis très novice dans ce domaine
sheridan08 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 09/11/2012, 19h01   #12
fxrobin
Membre Expert
 
Avatar de fxrobin
 
Homme
Formateur JAVA / XML
Inscription : novembre 2007
Messages : 849
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : France

Informations professionnelles :
Activité : Formateur JAVA / XML
Secteur : Service public

Informations forums :
Inscription : novembre 2007
Messages : 849
Points : 1 277
Points : 1 277
Je sais que tu fais un client réseau car tu travailles en Remote sur le port 1099 de JBOSS.

Le log que tu montrais au début (celui de la console) est bien celui de JBOSS, et j'y ai vu qqs warning / erreurs.


Tiens regarde la doc officielle de JBOSS AS 7 :
https://docs.jboss.org/author/displa...g+JNDI?_sscc=t

tu y voies que la chaine JNDI est bien plus compliquée que la tienne.
Elle commence par "ejb:" ... et prend le nom de l'application, etc ...
Tu dois l'adapter.

Son format est le suivant :
Code :
ejb:<app-name>/<module-name>/<distinct-name>/<bean-name>!<fully-qualified-classname-of-the-remote-interface>
Et tu utilises JBOSS 4 ?
Utilise plutôt une dernière version ... car JBOSS 4 n'est pas JEE5, donc tu ne pourras pas faire d'EJB 3 ... voilà pourquoi, sûrement.
__________________
Moins on code, moins il y a de bug ... et vice-versa ainsi qu'inversement ...
fxrobin est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 09/11/2012, 19h53   #13
sheridan08
Membre du Club
 
informatique
Inscription : novembre 2009
Messages : 114
Détails du profil
Informations personnelles :
Localisation : France

Informations professionnelles :
Activité : informatique

Informations forums :
Inscription : novembre 2009
Messages : 114
Points : 46
Points : 46
j'utilise la version jboss-4.2.0.GA , d'apres ce que j'ai trouvé sur le net elle support les EJB3

http://jl2tho.blogspot.com/2007/05/t...vec-jboss.html
j'ai déjà utilisé les EJB3 pour un exemple de de EJB session et ça a marché , je vais essayé de modifier ma chaîne JNDI...
sheridan08 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 09/11/2012, 21h13   #14
fxrobin
Membre Expert
 
Avatar de fxrobin
 
Homme
Formateur JAVA / XML
Inscription : novembre 2007
Messages : 849
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : France

Informations professionnelles :
Activité : Formateur JAVA / XML
Secteur : Service public

Informations forums :
Inscription : novembre 2007
Messages : 849
Points : 1 277
Points : 1 277
JBOSS 4 permettait peut-être déjà de faire des EJB3 en "preview" ... mais la version certifiée (et complète) commence à JBOSS 5..

Aujourd'hui on en est à la JBOSS 7.
Il se peut (je ne connais pas assez JBOSS) que les chaines JNDI aient changé entre ces versions et voilà pourquoi tu n'y arrives pas.

Sinon, sur le tutorial que tu essayes de suivre as-tu déjà réussi à faire la première partie, sans l'EJB Entity "Produit" ?
__________________
Moins on code, moins il y a de bug ... et vice-versa ainsi qu'inversement ...
fxrobin est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 09/11/2012, 22h17   #15
NoClassDefFound
Membre confirmé
 
Homme
Inscription : octobre 2011
Messages : 156
Détails du profil
Informations personnelles :
Sexe : Homme

Informations forums :
Inscription : octobre 2011
Messages : 156
Points : 207
Points : 207
Je confirme que les chaines JNDI ont changé entre les version de JBoss.

Autrement, c'est moi où il y à une coquille entre ce que tu déclares dans ton persistence.xml

Code :
1
2
<class>org.acme.Produit</class>
et ta classe "réelle" com.et.Produit ?

Si le persistence.xml est correct, tu ne devrais pas avoir d'erreurs au déploiement.
Pour retrouver la bonne chaine de connexion JNDI pour le lookup, connecte toi à la console d'administration (http://localhost:8080). Dans la console JMX, cherche JNDIView et demande le contenu du JNDI, tu devrais y retrouver ton EJB Session et donc en déduire la bonne chaine de connexion.
NoClassDefFound est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 12/11/2012, 19h27   #16
sheridan08
Membre du Club
 
informatique
Inscription : novembre 2009
Messages : 114
Détails du profil
Informations personnelles :
Localisation : France

Informations professionnelles :
Activité : informatique

Informations forums :
Inscription : novembre 2009
Messages : 114
Points : 46
Points : 46
Bonsoir a tous , desolé d'avoir tardé , donc j'ai resolue mon probleme mais je ne sais pas comment en fait je ne sais pas pourquoi ça a marché
voici la serie de modification que j'ai fait
tout d'abors le fichier persistance.xml:
Code :
1
2
3
4
5
6
7
8
<persistence>
   <persistence-unit name="IntroEJB3">
      <jta-data-source>java:/DefaultDS</jta-data-source>
      <properties>
         <property name="hibernate.hbm2ddl.auto" value="update"/>
      </properties>
   </persistence-unit>
</persistence>
j'ai enlevé le unitname au niveau de persistancecontext:
Code :
  @PersistenceContext (unitName="testdb")
et l'import au niveau de la classe Produit
Code :
import org.hibernate.annotations.Entity;
remplacé par :
Code :
import javax.persistence.Entity;
l'import y est pour beaucoup , mon programme ne compile pas, voila ce que j'ai au niveau de la console
Code :
Exception in thread "main" javax.ejb.EJBException: java.lang.IllegalArgumentException: Unknown entity: com.et.Produit
et la fameuse erreur :
Code :
javax.naming.NameNotFoundException: GestionDeStockBean not bound
vient du fait que j'ai gardé mon fichier persistance.xml( que j'ai donné dans un post ulterieur) et de l'ajout du UnitName:
Code :
  @PersistenceContext (unitName="testdb")
si quelqu'un peut me dire pourquoi ça marche ,parceque là c'est vraiment flou
surtout au niveau du fichier persistance , je ne sais quoi ajouter ou bien enlever
et le Unitname faut-il le mettre a chaque fois?
sheridan08 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 12/11/2012, 20h47   #17
fxrobin
Membre Expert
 
Avatar de fxrobin
 
Homme
Formateur JAVA / XML
Inscription : novembre 2007
Messages : 849
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : France

Informations professionnelles :
Activité : Formateur JAVA / XML
Secteur : Service public

Informations forums :
Inscription : novembre 2007
Messages : 849
Points : 1 277
Points : 1 277
alors, dans l'ordre :

1 - le unitName dans l'annotation doit être équivalent au nom que tu lui donnes dans le fichier de persistence. MAIS quand il n'y a qu'une seule unité de persistence de déclarée dans le fichier, il n'est pas obligatoire de le spécifier dans l'annotation.

2 - @Entity de Hibernate, venait en conflit avec le @Entity de JPA, voilà pourquoi ça ne marchait. Il faut toujours faire très attention à ses imports surtout en JEE.

En tout cas, c'est que tu aies trouvé ton erreur toute seule.
__________________
Moins on code, moins il y a de bug ... et vice-versa ainsi qu'inversement ...
fxrobin est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 12/11/2012, 20h59   #18
sheridan08
Membre du Club
 
informatique
Inscription : novembre 2009
Messages : 114
Détails du profil
Informations personnelles :
Localisation : France

Informations professionnelles :
Activité : informatique

Informations forums :
Inscription : novembre 2009
Messages : 114
Points : 46
Points : 46
Citation:
le unitName dans l'annotation doit être équivalent au nom que tu lui donnes dans le fichier de persistence. MAIS quand il n'y a qu'une seule unité de persistence de déclarée dans le fichier, il n'est pas obligatoire de le spécifier dans l'annotation.
est ce que je peux utiliser plus d'un entity bean dans mon projet ? si c'est le cas , chaque entity bean aura son fichier persistance a lui?
sheridan08 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 12/11/2012, 21h01   #19
fxrobin
Membre Expert
 
Avatar de fxrobin
 
Homme
Formateur JAVA / XML
Inscription : novembre 2007
Messages : 849
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : France

Informations professionnelles :
Activité : Formateur JAVA / XML
Secteur : Service public

Informations forums :
Inscription : novembre 2007
Messages : 849
Points : 1 277
Points : 1 277
Oui et heureusement que tu pourras mettre plusieurs @Entity
Non, tu n'auras qu'un seul fichier de persistence, pas plusieurs.

Regarde les tutos sur JPA à ce sujet.
http://tahe.developpez.com/java/jpa/

Etudie bien JPA avant de te lancer !

A+
__________________
Moins on code, moins il y a de bug ... et vice-versa ainsi qu'inversement ...
fxrobin est déconnecté   Envoyer un message privé Réponse avec citation 10
Vieux 12/11/2012, 21h16   #20
sheridan08
Membre du Club
 
informatique
Inscription : novembre 2009
Messages : 114
Détails du profil
Informations personnelles :
Localisation : France

Informations professionnelles :
Activité : informatique

Informations forums :
Inscription : novembre 2009
Messages : 114
Points : 46
Points : 46
merci infiniment fxrobin
sheridan08 est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Cette discussion est résolue.
Outils de la discussion

Navigation rapide


Fuseau horaire GMT +2. Il est actuellement 04h42.


 
 
 
 
Partenaires

Hébergement Web