Home Help Center

Error: unknown operation ice_router

phil86phil86 Member Philipp SchelkleOrganization: FilooProject: Mumble Webinterface
Hello,

i want to use the Galcier2 Proxy with Ice to develop a Mumble-Webinterface.
Without the Glacier2 everything works perfect. After enable it, i got the error:

Fatal error: main() [<a href='function.main'>function.main</a>]: unknown operation ice_router invoked on proxy of type ::Glacier2::Router in /path/to/mumble.class.php on line 13

Here are the lines of the PHP-File:
[PHP]
$router = $ICE->stringToProxy("Glacier2/router:tcp -p 4063 -h ".$ip);
$router = $router->ice_uncheckedCast("::Glacier2::Router")->ice_router(null);
$session = $router->createSession("mumble", "password");
$base = $ICE->stringToProxy("Meta:tcp -h 127.0.0.1 -p 6502")->ice_router($router);
$meta = $base->ice_checkedCast("::Murmur::Meta")->ice_router($router);[/PHP]

The Server is a Debian Linux 5.0 with php5 and the ICE-Packeges out the apt-repository.

Googling around and searching the forum did not found something that helped me.

Best Regrats, Phil

Comments

  • matthewmatthew NL, CanadaMember Matthew NewhookOrganization: ZeroC, Inc.Project: Internet Communications Engine ✭✭✭
    Why do you want to use Glacier2 in this case? Using Glacier2 in a PHP application generally isn't that useful because the web server runs behind the firewall. It also doesn't work very well as the Glacier2 session is torn down immediately after the PHP script stops executing.

    With respect to this specific issue, I'm not really sure why calling ice_router results in that exception, however, in most deployments you would not need to call ice_router on any proxy. You set the default router using. Ice.Default.Router property in your application configuration file.
  • phil86phil86 Member Philipp SchelkleOrganization: FilooProject: Mumble Webinterface
    Thanks for yout Answer.
    I want to use the Galcier2 cause the Webinterface runs on a Differnt Machine than the Mumble-Server. To open the ICE-Interface in the Mumble for the external IP of the Machine is no good idea.
    Galcier2 supports a basic authorisation, so nobody external can control the Server.
    That the connection is closed evey end of the execution of the script i read about, but there will only single commands in ohne hour.

    Any idea what i can do?

    Greetings, Phil
  • matthewmatthew NL, CanadaMember Matthew NewhookOrganization: ZeroC, Inc.Project: Internet Communications Engine ✭✭✭
    I want to use the Galcier2 cause the Webinterface runs on a Differnt Machine than the Mumble-Server. To open the ICE-Interface in the Mumble for the external IP of the Machine is no good idea.

    There is no firewall controlling access to the backend servers? If not, you might consider doing that as this is the simplest and safest solution.

    At any rate, if you really want to use Glacier2, then you should do as I said, and define Ice.Default.Router in the Ice properties file. You specify the location of the Ice configuration file in the your PHP ini file with ice.config. See the Ice manual for more information.

    The configuration file will be something like:
    Ice.Default.Router=Glacier2/router:tcp -p 4063 -h <ip>
    

    Where <ip> is the address where the Glacier2 router is running. The code will then be something like:
    $router = $ICE->stringToProxy($ICE->propertyToProxy("Ice.Default.Proxy"));
    $router = $router->ice_uncheckedCast("::Glacier2::Router");
    $session = $router->createSession("mumble", "password"); 
    $base = $ICE->stringToProxy("Meta:tcp -h 127.0.0.1 -p 6502");
    $meta = $base->ice_checkedCast("::Murmur::Meta");
    

    You should also be sure to destroy the glacier2 session once the script completes.
Sign In or Register to comment.