Remote not bound [Résolu]

Messages postés
75
Date d'inscription
mardi 11 novembre 2008
Statut
Membre
Dernière intervention
2 février 2012
- - Dernière réponse : cs_diabohit
Messages postés
75
Date d'inscription
mardi 11 novembre 2008
Statut
Membre
Dernière intervention
2 février 2012
- 14 nov. 2011 à 20:04
Bonsoir tt l monde

je suis débutant JEE et je suis entrain de construire une application client et un projet EJB(Persistence et dao)

quand j'execute le main de mon projet client, ca génère une erreur

voici mon code:

main:

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

import com.esprit.gestionContacts.dao.*;
import com.esprit.gestionContacts.persistance.Contact;


public class Main {
public static void main(String[] args) {

Contact c1 = new Contact();
c1.setFirstName("Foulen");
c1.setLastName("Ben Foulen");
c1.setPasseportNumber("p01234");

ContactDaoRemote contactDao = null;

try {
Context ctx = new InitialContext();
contactDao = (ContactDaoRemote) ctx.lookup("ContactDao/remote");
contactDao.add(c1);
}
                catch (NamingException e) {
e.printStackTrace();
}
}

public Main() {
super();
}

}


et voici l'erreur:

javax.naming.NameNotFoundException: remote not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
at org.jnp.server.NamingServer.lookup(NamingServer.java:270)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
at sun.rmi.transport.Transport$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:667)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
at javax.naming.InitialContext.lookup(Unknown Source)
at Main.main(Main.java:22)


merci de m'aider, j'ai deja perdu une semaine en cherchant sur le web de la resoudre, merci
Afficher la suite 

2 réponses

Meilleure réponse
Messages postés
75
Date d'inscription
mardi 11 novembre 2008
Statut
Membre
Dernière intervention
2 février 2012
3
Merci
c bon j'ai résolu le problème :)
pour les intéressés, c'est juste que j'ai plusieurs <jndi-name> dans mon serveur

il m'a suffit de telecharger un nouveau serveur JBOSS et ca marche à merveille
a+

Dire « Merci » 3

Quelques mots de remerciements seront grandement appréciés. Ajouter un commentaire

Codes Sources 193 internautes nous ont dit merci ce mois-ci

Commenter la réponse de cs_diabohit
Messages postés
75
Date d'inscription
mardi 11 novembre 2008
Statut
Membre
Dernière intervention
2 février 2012
0
Merci
voici la list jndi que j'ai pri de:
http://localhost:8080/jmx-console/ ==> service=JNDIView ==> java.lang.String list() ==> invoke

java:comp namespace of the jmx-console.war application:


  +- UserTransaction[link -> UserTransaction] (class: javax.naming.LinkRef)
  +- env (class: org.jnp.interfaces.NamingContext)
  |   +- security (class: org.jnp.interfaces.NamingContext)
  |   |   +- realmMapping[link -> java:/jaas/other] (class: javax.naming.LinkRef)
  |   |   +- subject[link -> java:/jaas/other/subject] (class: javax.naming.LinkRef)
  |   |   +- securityMgr[link -> java:/jaas/other] (class: javax.naming.LinkRef)
  |   |   +- security-domain[link -> java:/jaas/other] (class: javax.naming.LinkRef)

java:comp namespace of the http-invoker.sar/invoker.war application:


  +- UserTransaction[link -> UserTransaction] (class: javax.naming.LinkRef)
  +- env (class: org.jnp.interfaces.NamingContext)
  |   +- security (class: org.jnp.interfaces.NamingContext)
  |   |   +- realmMapping[link -> java:/jaas/jmx-console] (class: javax.naming.LinkRef)
  |   |   +- subject[link -> java:/jaas/jmx-console/subject] (class: javax.naming.LinkRef)
  |   |   +- securityMgr[link -> java:/jaas/jmx-console] (class: javax.naming.LinkRef)
  |   |   +- security-domain[link -> java:/jaas/jmx-console] (class: javax.naming.LinkRef)

java:comp namespace of the jbossmq-httpil.sar/jbossmq-httpil.war application:


  +- UserTransaction[link -> UserTransaction] (class: javax.naming.LinkRef)
  +- env (class: org.jnp.interfaces.NamingContext)
  |   +- security (class: org.jnp.interfaces.NamingContext)
  |   |   +- realmMapping[link -> java:/jaas/jbossmq] (class: javax.naming.LinkRef)
  |   |   +- subject[link -> java:/jaas/jbossmq/subject] (class: javax.naming.LinkRef)
  |   |   +- securityMgr[link -> java:/jaas/jbossmq] (class: javax.naming.LinkRef)
  |   |   +- security-domain[link -> java:/jaas/jbossmq] (class: javax.naming.LinkRef)

java:comp namespace of the console-mgr.sar/web-console.war application:


  +- UserTransaction[link -> UserTransaction] (class: javax.naming.LinkRef)
  +- env (class: org.jnp.interfaces.NamingContext)
  |   +- security (class: org.jnp.interfaces.NamingContext)
  |   |   +- realmMapping[link -> java:/jaas/other] (class: javax.naming.LinkRef)
  |   |   +- subject[link -> java:/jaas/other/subject] (class: javax.naming.LinkRef)
  |   |   +- securityMgr[link -> java:/jaas/other] (class: javax.naming.LinkRef)
  |   |   +- security-domain[link -> java:/jaas/other] (class: javax.naming.LinkRef)

java:comp namespace of the jbossws.sar/jbossws-context.war application:


  +- UserTransaction[link -> UserTransaction] (class: javax.naming.LinkRef)
  +- env (class: org.jnp.interfaces.NamingContext)
  |   +- security (class: org.jnp.interfaces.NamingContext)
  |   |   +- realmMapping[link -> java:/jaas/other] (class: javax.naming.LinkRef)
  |   |   +- subject[link -> java:/jaas/other/subject] (class: javax.naming.LinkRef)
  |   |   +- securityMgr[link -> java:/jaas/other] (class: javax.naming.LinkRef)
  |   |   +- security-domain[link -> java:/jaas/other] (class: javax.naming.LinkRef)

java:comp namespace of the jboss-web.deployer/ROOT.war application:


  +- UserTransaction[link -> UserTransaction] (class: javax.naming.LinkRef)
  +- env (class: org.jnp.interfaces.NamingContext)
  |   +- security (class: org.jnp.interfaces.NamingContext)
  |   |   +- realmMapping[link -> java:/jaas/other] (class: javax.naming.LinkRef)
  |   |   +- subject[link -> java:/jaas/other/subject] (class: javax.naming.LinkRef)
  |   |   +- securityMgr[link -> java:/jaas/other] (class: javax.naming.LinkRef)
  |   |   +- security-domain[link -> java:/jaas/other] (class: javax.naming.LinkRef)

java: Namespace


  +- SecurityProxyFactory (class: org.jboss.security.SubjectSecurityProxyFactory)
  +- DefaultJMSProvider (class: org.jboss.jms.jndi.JNDIProviderAdapter)
  +- comp (class: javax.naming.Context)
  +- JmsXA (class: org.jboss.resource.adapter.jms.JmsConnectionFactoryImpl)
  +- jaas (class: javax.naming.Context)
  |   +- JmsXARealm (class: org.jboss.security.plugins.SecurityDomainContext)
  +- comp.original (class: javax.namingMain.Context)
  +- timedCacheFactory (class: javax.naming.Context)
Failed to lookup: timedCacheFactory, errmsg=org.jboss.util.TimedCachePolicy cannot be cast to javax.naming.NamingEnumeration
  +- TransactionPropagationContextExporter (class: com.arjuna.ats.internal.jbossatx.jta.PropagationContextManager)
  +- StdJMSPool (class: org.jboss.jms.asf.StdServerSessionPoolFactory)
  +- Mail (class: javax.mail.Session)
  +- contactEjbDs (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)
  +- comp.ejb3 (class: javax.naming.Context)
  |   NonContext: null
  +- TransactionPropagationContextImporter (class: com.arjuna.ats.internal.jbossatx.jta.PropagationContextManager)
  +- TransactionManager (class: com.arjuna.ats.jbossatx.jta.TransactionManagerDelegate)

Global JNDI Namespace


  +- TransactionSynchronizationRegistry (class: com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionSynchronizationRegistryImple)
  +- TopicConnectionFactory (class: org.jboss.naming.LinkRefPair)
  +- UIL2ConnectionFactory[link -> ConnectionFactory] (class: javax.naming.LinkRef)
  +- UserTransactionSessionFactory (proxy: $Proxy14 implements interface org.jboss.tm.usertx.interfaces.UserTransactionSessionFactory)
  +- console (class: org.jnp.interfaces.NamingContext)
  |   +- PluginManager (proxy: $Proxy48 implements interface org.jboss.console.manager.PluginManagerMBean)
  +- UIL2XAConnectionFactory[link -> XAConnectionFactory] (class: javax.naming.LinkRef)
  +- UUIDKeyGeneratorFactory (class: org.jboss.ejb.plugins.keygenerator.uuid.UUIDKeyGeneratorFactory)
  +- QueueConnectionFactory (class: org.jboss.naming.LinkRefPair)
  +- persistence.units:jar=GestionDeContacts.jar,unitName=PU (class: org.hibernate.impl.SessionFactoryImpl)
  +- ContactDao (class: org.jnp.interfaces.NamingContext)
  +- UserTransaction (class: org.jboss.tm.usertx.client.ClientUserTransaction)
  +- jmx (class: org.jnp.interfaces.NamingContext)
  |   +- invoker (class: org.jnp.interfaces.NamingContext)
  |   |   +- RMIAdaptor (proxy: $Proxy47 implements interface org.jboss.jmx.adaptor.rmi.RMIAdaptor,interface org.jboss.jmx.adaptor.rmi.RMIAdaptorExt)
  |   +- rmi (class: org.jnp.interfaces.NamingContext)
  |   |   +- RMIAdaptor[link -> jmx/invoker/RMIAdaptor] (class: javax.naming.LinkRef)
  +- UILXAConnectionFactory[link -> XAConnectionFactory] (class: javax.naming.LinkRef)
  +- UILConnectionFactory[link -> ConnectionFactory] (class: javax.naming.LinkRef)



SVP aidez moi je me plante :'(
Commenter la réponse de cs_diabohit