Erreur "javax.naming.NameNotFoundException: PremierEJB3Bean not bound"
Bonjour tout le monde
J'ai essayé de suivre toutes les étapes d'un tuto qui met en oeuvre les ejb:
J'ai crée un nouveau projet IntroEJB2:
dedans il y a :
Code:
1 2 3 4 5 6 7
| package emsi.formation.ejb3;
import javax.ejb.Remote;
@Remote
public interface PremierEJB3 {
public String ditBonjour(String aQui);
} |
Code:
1 2 3 4 5 6 7 8
| package emsi.formation.ejb3;
import javax.ejb.Stateless;
@Stateless
public class PremierEJB3Bean implements PremierEJB3 {
public String ditBonjour(String aQui) {
return "Bonjour " + aQui + " !!!";
}
} |
J'ai créé un projet Java:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| package emsi.formation.ejb3;
import java.rmi.RMISecurityManager;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
public class ClientPremierEJB3 {
public static void main(String[] args) {
try {
Context context = new InitialContext();
PremierEJB3 beanRemote = (PremierEJB3) context.lookup("PremierEJB3Bean/remote");
System.out.println(beanRemote.ditBonjour("ClientPremierEJB3"));
} catch (NamingException e) {
e.printStackTrace();
}
}
} |
le jndi.properties:
Code:
1 2 3
| java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
java.naming.provider.url=localhost:1099 |
L'erreur:
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: PremierEJB3Bean not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
at org.jnp.server.NamingServer.lookup(NamingServer.java:396)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
at sun.rmi.transport.Transport$1.run(Transport.java:159)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)
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(InitialContext.java:392)
at emsi.formation.ejb3.ClientPremierEJB3.main(ClientPremierEJB3.java:14) |
Les jar ajoutés:
dans le projet java:
Code:
1 2 3 4
|
jboss-aop-jdk50-client.jar
jboss-aspect-jdk50-client.jar
jbossall-client.jar |
dans le rojet ejb:
Code:
1 2 3 4
|
ejb3-persistence.jar
jboss-ejb3.jar
jboss-ejb3x.jar |
PS:
J'ai essayé de déployer l'application avec:
Code:
1 2 3
|
jboss-4.0.5.GA
jboss-5.1.0.GA |
Quelqu'un peut m'aider?
Je peux vous assurer que j'ai parcouru tous les forums mais sans trouver une réponse à ce problème ......
ça fait 4 jours que je suis bloqué la dessus :calim2: :calim2:
Je vous remercie d'avance