Click to See Complete Forum and Search --> : Java object as a Session variable in PHP


Anon
07-31-2002, 10:57 AM
Hai all,

In PHP i am trying to keep a java object in a session. But it is not
working

Test1.php

<?
if ( !session_is_registered( "objSystem" ) )
{
$ objSystem = new Java( " java.lang.System " );
session_register( " objSystem " );
}
?>

Test2.php

<?
session_register( " objSystem " );
echo “Version:” . $objSystem.getProperty(“java.version”);
?>


In Test1.php objSystem is a java object stored in the session variable.

In Test2.php I am trying to access that session variable and i got the error “null pointer exception”. I don”t know what is problem in my code. If you have any solution please let me know.

Thanks in advance.

Regards,
Gandhi.