Bonjour
j'ai des problèmes d'accès à une ejb session que j'ai créer. Elle se deploye apparement coorectement sur le serveur jboss:
Par impossible d'y acceder avec mon client j'obtient toujours l'erreur suivante :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4 10:50:21,957 INFO [Ejb3Deployment] EJB3 deployment time took: 46 10:50:21,961 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:jar=hello.jar,name=HelloBean,service=EJB3 with dependencies: 10:50:22,124 INFO [EJBContainer] STARTED EJB: helloworld.HelloBean ejbName: HelloBean 10:50:22,233 INFO [EJB3Deployer] Deployed: file:/usr/share/jboss-4/server/default/deploy/hello.jar
Voici le code de mes differentes class
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 Exception in thread "main" java.lang.NoClassDefFoundError: org/jboss/util/platform/PID at org.jboss.util.id.VMID.create(VMID.java:259) at org.jboss.util.id.VMID.getInstance(VMID.java:223) at org.jboss.util.id.GUID.<init>(GUID.java:65) at org.jboss.remoting.Client.<init>(Client.java:92) at org.jboss.remoting.Client.<init>(Client.java:178) at org.jboss.remoting.Client.<init>(Client.java:157) at org.jboss.remoting.Client.<init>(Client.java:139) at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:54) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:55) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:77) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:102) at $Proxy0.sayHello(Unknown Source) at helloclient.HelloClientConsole.main(HelloClientConsole.java:22)
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12 package helloworld; import javax.ejb.Stateless; import helloworld.HelloRemote; @Stateless public class HelloBean implements HelloRemote{ public String sayHello(){ return "Hello World!"; } }et le client
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8 package helloworld; import javax.ejb.Remote; @Remote public interface HelloRemote { public String sayHello(); }
le fichier jar de mon ejb ne contient que les classes de celle-ci.
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 package helloclient; import helloworld.HelloRemote; import javax.naming.InitialContext; import javax.naming.Context; import javax.naming.NamingException; import java.util.Properties; import javax.rmi.PortableRemoteObject; public class HelloClientConsole { public static void main ( String [] args) { try { Context jndiContext = getInitialContext( ); Object ref = jndiContext.lookup("HelloBean"); HelloRemote dao = (HelloRemote) PortableRemoteObject.narrow(ref,HelloRemote.class); System.out.println(dao.sayHello()); } catch (Exception e) { System.out.println(e); e.printStackTrace(); } } public static Context getInitialContext( ) throws javax.naming.NamingException { Properties p = new Properties( ); // ... Specify the JNDI properties specific to the vendor. return new javax.naming.InitialContext(p); } }
Si vous avez des pistes ou chercher
Partager