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