Bonjour,
j'ai un EJB qui est déployé sur glassfish. cet ejb est utilisé dans une application d'entreprise.
Je voudrais maintenant développé un client lourd (application swing) qui utilise ce même ejb.
pour cela, j'effectue les opérations suivante:
1- je crée un projet java swing
2-je crée une inteface Remote (RemoteInterface)de même nom que l'interface remote du projet ejb
3-ensuite j'essai d'acceder à mon ejb à travers le code suivant:
mais je reçois toujours l'erreur suivante:Code:
1
2
3
4
5
6
7
8
9
10
11
12 Properties p = new Properties(); p.put("java.naming.factory.initial", "com.sun.enterprise.naming.impl.SerialInitContextFactory"); p.put("java.naming.factory.url.pkgs", "com.sun.enterprise.naming"); p.put("java.naming.factory.state", "com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl"); p.setProperty("org.omg.CORBA.ORBInitialHost", "127.0.0.1"); p.setProperty("org.omg.CORBA.ORBInitialPort", "3700"); Context ctx = new InitialContext(p); dao = (RemoteInterface) ctx.lookup("RemoteInterface"); } catch (NamingException ex) { System.err.println(ex.fillInStackTrace()); }
je voudrais savoir s'il vous plait si déjà le schéma de mon projet est correct, quelle pourrait être la cause de cette erreur. Merci d'avanceCode:javax.naming.NamingException: Lookup failed for 'RemoteInterface' in SerialContext[myEnv={org.omg.CORBA.ORBInitialPort=3700, java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, org.omg.CORBA.ORBInitialHost=127.0.0.1, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming} [Root exception is javax.naming.NameNotFoundException: RemoteInterface not found]