NoInitialContextException
Bonjour tout le monde,
Je suis entrain de faire mon premier exemple en EJB3.le déploiement a été fait avec succès, mais lors de l'exécution du client de test, j'ai obtenu l'exception suivante :
Code:
1 2 3 4 5 6
|
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.lookup(Unknown Source) |
voila le code de mon client :
Code:
1 2 3 4 5 6 7 8 9 10 11
|
Context context;
try {
context = new InitialContext();
BookSessionBeanRemote beanRemote = (BookSessionBeanRemote) context
.lookup(BookSessionBean.RemoteJNDIName);
beanRemote.test();
} catch (NamingException e) {
e.printStackTrace();
} |
je vous remercie d'avance.