Précédent   Forum du club des développeurs et IT Pro > Autres langages > Autres langages > CORBA
CORBA Forum d'entraide et de discussion sur le développement distribué avec CORBA & les ORB
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse
 
Outils de la discussion
Publicité
'
Vieux 18/12/2011, 13h21   #1
moustaf_26
Nouveau Membre du Club
 
Inscription : mars 2009
Messages : 161
Détails du profil
Informations personnelles :
Âge : 26

Informations forums :
Inscription : mars 2009
Messages : 161
Points : 32
Points : 32
Par défaut application serveur se bloque

salut, je reliase une application distribuée avec corba,
mon soucis est que si je lance l'application serveur elle se bloque.
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
private void butActionPerformed(java.awt.event.ActionEvent evt) {                                    
        // TODO add your handling code here:
        if (cpt % 2 == 0) 
        {
                 
               cpt++;
               but.setText("Arreter le serveur");
            
                try{
              // create and initialize the ORB
             // String[] ar = new String[] {"-ORBInitialPort ", " 1050 ", " -ORBinitialHost ", "localhost& "};
            
                String[] ar = new String[]{};
                Properties props = new Properties();
	        props.put("org.omg.CORBA.ORBInitialPort", "1050");
	        props.put("org.omg.CORBA.ORBInitialHost", "localhost");
                ORB orb = ORB.init(ar, props);


      // get reference to rootpoa & activate the POAManager
      POA rootpoa = POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
      rootpoa.the_POAManager().activate();

      // create servant and register it with the ORB
      BanqueImpl bqImpl = new BanqueImpl();
      bqImpl.setORB(orb);

      // get object reference from the servant
      org.omg.CORBA.Object ref = rootpoa.servant_to_reference(bqImpl);
      Banque href = BanqueHelper.narrow(ref);

      // get the root naming context
      // NameService invokes the name service
      org.omg.CORBA.Object  objRef = orb.resolve_initial_references("NameService");
      // Use NamingContextExt which is part of the Interoperable
      // Naming Service (INS) specification.
      NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef);

      // bind the Object Reference in Naming
      String name = "Banque";
      NameComponent path[] = ncRef.to_name( name );
      ncRef.rebind(path, href);

      System.out.println("HelloServer ready and waiting ...");



      // wait for invocations from clients
      
      orb.run();
    }

        catch (Exception e) {
        System.err.println("ERROR: " + e);
        e.printStackTrace(System.out);
      }
        }
        else
        {
            but.setText("Arreter le serveur");
            cpt++;
        }
        
    }
je ne sais pas quel peut etre le probleme
moustaf_26 est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse
Outils de la discussion

Navigation rapide


Fuseau horaire GMT +2. Il est actuellement 12h36.


 
 
 
 
Partenaires

Hébergement Web