Bonjour,
Je débute dans le monde des ejb et j'ai un problème au tout début, j'ai suivit ce tutoriel:
http://www.eclipsetotale.com/article...c_Eclipse.html
Cependant j'ai la traditionnel erreur:
javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory]
Pourtant j'ai mon fichier jndi.properties à la racine, j'ai même importé dans le projet java les librairies ejb3 ext, ejb client, jboss-as ejb3, jboss ejb api spec.
J'ai ensuite utiliséPour instancier créer mes propriétés en pensant qu'il ne trouvait tout simplement pas le fichier jndi.properties (j'ai aussi créé le fichier jboss-ejb-client.properties à la racine au cas ou).
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5 Properties properties = new Properties(); properties.put("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory"); properties.put("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces"); properties.put("java.naming.provider.url","localhost:1099"); context = new InitialContext(properties);
Je ne vois pas d'où vient le problème, pouvez-vous m'éclairer s'il vous plaît?
Partager