Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
rmi verso localhost
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian)
View previous topic :: View next topic  
Author Message
lopio
Veteran
Veteran


Joined: 22 Dec 2003
Posts: 1161
Location: savona, Italy

PostPosted: Wed May 05, 2004 11:33 am    Post subject: rmi verso localhost Reply with quote

ciao,
ho server java che ora gira su linux. La connessione rmi dall'esterno funziona (quindi oggetti corretamente registrati a rmi registry) ma connessione da locale (verso 127.0.0.1 o ip address) non funziona e mi da' eccezione Unknown Host Exception ipaddress.
qualche idea?Sembra problema di indirizzamento............
grazie
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 31447
Location: here

PostPosted: Wed May 05, 2004 11:34 am    Post subject: Reply with quote

Posta il pezzo di codice.
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
lopio
Veteran
Veteran


Joined: 22 Dec 2003
Posts: 1161
Location: savona, Italy

PostPosted: Wed May 05, 2004 12:10 pm    Post subject: Reply with quote

fedeliallalinea wrote:
Posta il pezzo di codice.



ciao eccezione viene generata non quando il client tenta la connessione con lookup (sia con agentIp=127.0.0.1 che ipAddress=172.16.241.97) ma quando chiama il metodo che realizza il servizio.
Lo stesso codice da remoto funziona


Code:

     url = "//" +  agentIp  + ":1101/SocketAlarmSS";
      if (alarmManager==null)
       {

         try {
                 alarmManager = (AlarmManager) Naming.lookup(url);

              }

         catch (Exception e) {
                                System.out.println("connectToAgentAndCall:: CANNOT CONNECT TO AGENT  " + url+" "+e.getMessage());
                                System.exit(1);
                               }

       }


try {
      retCode=alarmManager.genericService(serviceName,cmdAction,params);
       }
         catch (Exception e) {
                                System.out.println("connectToAgentAndCall::service call remote  exception " + url+" " +e.getMessage());
                                System.exit(1);
                               }
   



Eccezione riportata' e':
Code:


service call remote  exception //127.0.0.1:1101/SocketAlarmSS Unknown host: 172.16.241.97 ; nested exception is:
        java.net.UnknownHostException: 172.16.241.97



Se uso ip address ottengo la stessa cosa
Code:


service call remote  exception //172.16.241.97:1101/SocketAlarmSS Unknown host: 172.16.241.97 ; nested exception is:
        java.net.UnknownHostException: 172.16.241.97



grazie
Back to top
View user's profile Send private message
Sparker
l33t
l33t


Joined: 28 Aug 2003
Posts: 992

PostPosted: Wed May 05, 2004 1:00 pm    Post subject: Reply with quote

Hai impostato correttamente il file di policy?
Back to top
View user's profile Send private message
lopio
Veteran
Veteran


Joined: 22 Dec 2003
Posts: 1161
Location: savona, Italy

PostPosted: Wed May 05, 2004 1:56 pm    Post subject: Reply with quote

Sparker wrote:
Hai impostato correttamente il file di policy?


Il file di policy passato al server e' questo

Code:


grant {
  permission java.security.AllPermission;
};


/*
grant codeBase "file:${java.home}/lib/ext/*" {
  permission java.security.AllPermission;
};

grant {
  permission java.lang.RuntimePermission "stopThread";
  permission java.net.SocketPermission "*:1-", "listen, accept, connect, listen, resolve";
  permission java.util.PropertyPermission "java.version", "read";
  permission java.util.PropertyPermission "java.vendor", "read";
  permission java.util.PropertyPermission "java.vendor.url", "read";
  permission java.util.PropertyPermission "java.class.version", "read";
  permission java.util.PropertyPermission "os.name", "read";
  permission java.util.PropertyPermission "os.version", "read";
  permission java.util.PropertyPermission "os.arch", "read";
  permission java.util.PropertyPermission "file.separator", "read";
  permission java.util.PropertyPermission "path.separator", "read";
  permission java.util.PropertyPermission "line.separator", "read";
  permission java.util.PropertyPermission "java.specification.version", "read";
  permission java.util.PropertyPermission "java.specification.vendor", "read";
  permission java.util.PropertyPermission "java.specification.name", "read";
  permission java.util.PropertyPermission "java.vm.specification.version", "read";
  permission java.util.PropertyPermission "java.vm.specification.vendor", "read";
  permission java.util.PropertyPermission "java.vm.specification.name", "read";
  permission java.util.PropertyPermission "java.vm.version", "read";
  permission java.util.PropertyPermission "java.vm.vendor", "read";
  permission java.util.PropertyPermission "java.vm.name", "read";
  permission java.util.PropertyPermission "user.dir", "read";
  permission java.util.PropertyPermission "JAVLIN_HOME", "read";
  permission java.io.FilePermission "<<ALL FILES>>", "read, write, delete";
  permission java.util.PropertyPermission "*", "read, write";
};
*/


Sembra sia tutto commentato tranne la prima grant. Se a tale
grant aggiungo anche permission java.net.SocketPermission.AllPermission le cose non migliorano
grazie ciao
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum