|
From: <php...@li...> - 2009-04-17 11:34:09
|
Hello,
does anyone have an idea how to access this class from php?
public class Arrayausgabe{
public int[] meinArray(int wert){
int a=wert;
int Array[]=new int[5];
Array[0]=a;
Array[1]=a+1;
Array[2]=a+2;
Array[3]=a+5;
Array[4]=a+9;
return Array;
}
}
Well,
<?php
require_once("http://localhost:8081/Ordner/java/Java.inc");
$System = java("java.lang.System");
$object = new java("Arrayausgabe");
????????????????????????????????
?>
Thanks in advance!!!!!!!!!!!!!
|
|
From: <php...@li...> - 2009-04-17 12:22:15
|
Hello,
thank you very much. But I have gotten such a strange result:
java_InternalJava Object
( [__client] => java_Client Object ( [RUNTIME] => Array (
[NOTICE] => ***USE echo java_inspect(jVal) OR
print_r(java_values(jVal)) TO SEE THE CONTENTS OF THIS JAVA OBJECT!***
[PIPE_DIR] => [PARSER] => NATIVE ) [result] => [exception]
=> [parser] => java_Parser Object ( [ENABLE_NATIVE] => 1
[DISABLE_SIMPLE] => [parser] => java_NativeParser Object (
[parser] => Resource id #2 [handler] => java_Client Object
*RECURSION* [level] => 0 [event] => 1 [buf] =>
)
)
[simpleArg] => java_Arg Object
(
[client] => java_Client Object
*RECURSION*
[exception] =>
[factory] => java_SimpleFactory Object
(
[client] => java_Client Object
*RECURSION*
)
[val] => 3
[signature] => [I
)
[compositeArg] =>
[simpleFactory] => java_SimpleFactory Object
(
[client] => java_Client Object
*RECURSION*
)
[proxyFactory] => java_ProxyFactory Object
(
[client] => java_Client Object
*RECURSION*
)
[iteratorProxyFacroty] =>
[arrayProxyFactory] => java_ArrayProxyFactory Object
(
[client] => java_Client Object
*RECURSION*
)
[exceptionProxyFactory] => java_ExceptionProxyFactory Object
(
[client] => java_Client Object
*RECURSION*
)
[throwExceptionProxyFactory] => java_ThrowExceptionProxyFactory Object
(
[client] => java_Client Object
*RECURSION*
)
[arg] => java_Arg Object
(
[client] => java_Client Object
*RECURSION*
[exception] =>
[factory] => java_SimpleFactory Object
(
[client] => java_Client Object
*RECURSION*
)
[val] => 3
[signature] => [I
)
[asyncCtx] => 3
[cancelProxyCreationCounter] => 0
[globalRef] => java_GlobalRef Object
(
[map] => Array
(
)
)
[stack] =>
[defaultCache] => Array
(
)
[asyncCache] => Array
(
)
[methodCache] => Array
(
[&@Arrayausgabe] => java_CacheEntry Object
(
[fmt] =>
[signature] => Arrayausgabe
[factory] => java_ProxyFactory Object
(
[client] => java_Client Object
*RECURSION*
)
[java] =>
[resultVoid] =>
)
[@Arrayausgabe@meinArray@i] => java_CacheEntry Object
(
[fmt] =>
[signature] => [I
[factory] => java_ArrayProxyFactory Object
(
[client] => java_Client Object
*RECURSION*
)
[java] =>
[resultVoid] =>
)
)
[isAsync] => 0
[currentCacheKey] =>
[currentArgumentsFormat] =>
[cachedJavaPrototype] => java_JavaProxyProxy Object ( [__client]
=> java_Client Object *RECURSION* [__delegate] => [__serialID]
=> [__factory] => [__java] => [__signature] =>
[__cancelProxyCreationTag] => ) [sendBuffer] =>
[preparedToSendBuffer] => [protocol] => java_Protocol Object (
[client] => java_Client Object *RECURSION* [webContext] =>
/Ordner/arrayausgabe.php.phpjavabridge [serverName] =>
127.0.0.1:8081 [socketHandler] => java_SocketHandler Object (
[protocol] => java_Protocol Object *RECURSION* [channel] =>
java_SocketChannel Object ( [peer] => Resource id #3 [protocol]
=> java_Protocol Object *RECURSION* [channelName:private] => 9267
[host:private] => 127.0.0.1 ) ) [handler] =>
java_SimpleHttpHandler Object ( [headers] => [redirect] =>
[context] => X_JAVABRIDGE_CONTEXT:
1@C%3A%5CDevelopment%5Capache-tomcat-6.0.18%5Cwebapps%5COrdner [ssl]
=> [port] => 8081 [host] => 127.0.0.1 [protocol] =>
java_Protocol Object *RECURSION* [channel] => java_SocketChannel
Object ( [peer] => Resource id #3 [protocol] => java_Protocol
Object *RECURSION* [channelName:private] => 9267 [host:private]
=> 127.0.0.1 ) ) ) [iteratorProxyFactory] =>
java_IteratorProxyFactory Object ( [client] => java_Client Object
*RECURSION* ) [idx] => 0 ) [__delegate] => java_ArrayProxy Object
( [__serialID] => [__java] => 3 [__signature] => [I [__client]
=> java_Client Object ( [RUNTIME] => Array ( [NOTICE] =>
***USE echo java_inspect(jVal) OR print_r(java_values(jVal)) TO SEE THE
CONTENTS OF THIS JAVA OBJECT!*** [PIPE_DIR] => [PARSER] => NATIVE
) [result] => [exception] => [parser] => java_Parser Object (
[ENABLE_NATIVE] => 1 [DISABLE_SIMPLE] => [parser] =>
java_NativeParser Object ( [parser] => Resource id #2 [handler]
=> java_Client Object *RECURSION* [level] => 0 [event] => 1
[buf] =>
)
)
[simpleArg] => java_Arg Object
(
[client] => java_Client Object
*RECURSION*
[exception] =>
[factory] => java_SimpleFactory Object
(
[client] => java_Client Object
*RECURSION*
)
[val] => 3
[signature] => [I
)
[compositeArg] =>
[simpleFactory] => java_SimpleFactory Object
(
[client] => java_Client Object
*RECURSION*
)
[proxyFactory] => java_ProxyFactory Object
(
[client] => java_Client Object
*RECURSION*
)
[iteratorProxyFacroty] =>
[arrayProxyFactory] => java_ArrayProxyFactory Object
(
[client] => java_Client Object
*RECURSION*
)
[exceptionProxyFactory] => java_ExceptionProxyFactory Object
(
[client] => java_Client Object
*RECURSION*
)
[throwExceptionProxyFactory] => java_ThrowExceptionProxyFactory Object
(
[client] => java_Client Object
*RECURSION*
)
[arg] => java_Arg Object
(
[client] => java_Client Object
*RECURSION*
[exception] =>
[factory] => java_SimpleFactory Object
(
[client] => java_Client Object
*RECURSION*
)
[val] => 3
[signature] => [I
)
[asyncCtx] => 3
[cancelProxyCreationCounter] => 0
[globalRef] => java_GlobalRef Object
(
[map] => Array
(
)
)
[stack] =>
[defaultCache] => Array
(
)
[asyncCache] => Array
(
)
[methodCache] => Array
(
[&@Arrayausgabe] => java_CacheEntry Object
(
[fmt] =>
[signature] => Arrayausgabe
[factory] => java_ProxyFactory Object
(
[client] => java_Client Object
*RECURSION*
)
[java] =>
[resultVoid] =>
)
[@Arrayausgabe@meinArray@i] => java_CacheEntry Object
(
[fmt] =>
[signature] => [I
[factory] => java_ArrayProxyFactory Object
(
[client] => java_Client Object
*RECURSION*
)
[java] =>
[resultVoid] =>
)
)
[isAsync] => 0
[currentCacheKey] =>
[currentArgumentsFormat] =>
[cachedJavaPrototype] => java_JavaProxyProxy Object ( [__client]
=> java_Client Object *RECURSION* [__delegate] => [__serialID]
=> [__factory] => [__java] => [__signature] =>
[__cancelProxyCreationTag] => ) [sendBuffer] =>
[preparedToSendBuffer] => [protocol] => java_Protocol Object (
[client] => java_Client Object *RECURSION* [webContext] =>
/Ordner/arrayausgabe.php.phpjavabridge [serverName] =>
127.0.0.1:8081 [socketHandler] => java_SocketHandler Object (
[protocol] => java_Protocol Object *RECURSION* [channel] =>
java_SocketChannel Object ( [peer] => Resource id #3 [protocol]
=> java_Protocol Object *RECURSION* [channelName:private] => 9267
[host:private] => 127.0.0.1 ) ) [handler] =>
java_SimpleHttpHandler Object ( [headers] => [redirect] =>
[context] => X_JAVABRIDGE_CONTEXT:
1@C%3A%5CDevelopment%5Capache-tomcat-6.0.18%5Cwebapps%5COrdner [ssl]
=> [port] => 8081 [host] => 127.0.0.1 [protocol] =>
java_Protocol Object *RECURSION* [channel] => java_SocketChannel
Object ( [peer] => Resource id #3 [protocol] => java_Protocol
Object *RECURSION* [channelName:private] => 9267 [host:private]
=> 127.0.0.1 ) ) ) [iteratorProxyFactory] =>
java_IteratorProxyFactory Object ( [client] => java_Client Object
*RECURSION* ) [idx] => 0 ) [__tempGlobalRef] => ) [__serialID]
=> [__factory] => [__java] => 3 [__signature] => [I
[__cancelProxyCreationTag] => )
|
|
From: <php...@li...> - 2009-04-17 13:05:03
|
have you read the tutorials? try it with the java_values() command. like $result = java_values($object->someMethod( 5 ) ); 2009/4/17 <php...@li...> > Hello, > thank you very much. But I have gotten such a strange result: > java_InternalJava Object > ( [__client] => java_Client Object ( [RUNTIME] => Array ( > [NOTICE] => ***USE echo java_inspect(jVal) OR > print_r(java_values(jVal)) TO SEE THE CONTENTS OF THIS JAVA OBJECT!*** > [PIPE_DIR] => [PARSER] => NATIVE ) [result] => [exception] > => [parser] => java_Parser Object ( [ENABLE_NATIVE] => 1 > [DISABLE_SIMPLE] => [parser] => java_NativeParser Object ( > [parser] => Resource id #2 [handler] => java_Client Object > *RECURSION* [level] => 0 [event] => 1 [buf] => > ) > > ) > > [simpleArg] => java_Arg Object > ( > [client] => java_Client Object > *RECURSION* > [exception] => > [factory] => java_SimpleFactory Object > ( > [client] => java_Client Object > *RECURSION* > ) > > [val] => 3 > [signature] => [I > ) > > [compositeArg] => > [simpleFactory] => java_SimpleFactory Object > ( > [client] => java_Client Object > *RECURSION* > ) > > [proxyFactory] => java_ProxyFactory Object > ( > [client] => java_Client Object > *RECURSION* > ) > > [iteratorProxyFacroty] => > [arrayProxyFactory] => java_ArrayProxyFactory Object > ( > [client] => java_Client Object > *RECURSION* > ) > > [exceptionProxyFactory] => java_ExceptionProxyFactory Object > ( > [client] => java_Client Object > *RECURSION* > ) > > [throwExceptionProxyFactory] => java_ThrowExceptionProxyFactory > Object > ( > [client] => java_Client Object > *RECURSION* > ) > > [arg] => java_Arg Object > ( > [client] => java_Client Object > *RECURSION* > [exception] => > [factory] => java_SimpleFactory Object > ( > [client] => java_Client Object > *RECURSION* > ) > > [val] => 3 > [signature] => [I > ) > > [asyncCtx] => 3 > [cancelProxyCreationCounter] => 0 > [globalRef] => java_GlobalRef Object > ( > [map] => Array > ( > ) > > ) > > [stack] => > [defaultCache] => Array > ( > ) > > [asyncCache] => Array > ( > ) > > [methodCache] => Array > ( > [&@Arrayausgabe] => java_CacheEntry Object > ( > [fmt] => > [signature] => Arrayausgabe > [factory] => java_ProxyFactory Object > ( > [client] => java_Client Object > *RECURSION* > ) > > [java] => > [resultVoid] => > ) > > [@Arrayausgabe@meinArray@i] => java_CacheEntry Object > ( > [fmt] => > [signature] => [I > [factory] => java_ArrayProxyFactory Object > ( > [client] => java_Client Object > *RECURSION* > ) > > [java] => > [resultVoid] => > ) > > ) > > [isAsync] => 0 > [currentCacheKey] => > [currentArgumentsFormat] => > [cachedJavaPrototype] => java_JavaProxyProxy Object ( [__client] > => java_Client Object *RECURSION* [__delegate] => [__serialID] > => [__factory] => [__java] => [__signature] => > [__cancelProxyCreationTag] => ) [sendBuffer] => > [preparedToSendBuffer] => [protocol] => java_Protocol Object ( > [client] => java_Client Object *RECURSION* [webContext] => > /Ordner/arrayausgabe.php.phpjavabridge [serverName] => > 127.0.0.1:8081 [socketHandler] => java_SocketHandler Object ( > [protocol] => java_Protocol Object *RECURSION* [channel] => > java_SocketChannel Object ( [peer] => Resource id #3 [protocol] > => java_Protocol Object *RECURSION* [channelName:private] => 9267 > [host:private] => 127.0.0.1 ) ) [handler] => > java_SimpleHttpHandler Object ( [headers] => [redirect] => > [context] => X_JAVABRIDGE_CONTEXT: > 1@C%3A%5CDevelopment%5Capache-tomcat-6.0.18%5Cwebapps%5COrdner [ssl] > => [port] => 8081 [host] => 127.0.0.1 [protocol] => > java_Protocol Object *RECURSION* [channel] => java_SocketChannel > Object ( [peer] => Resource id #3 [protocol] => java_Protocol > Object *RECURSION* [channelName:private] => 9267 [host:private] > => 127.0.0.1 ) ) ) [iteratorProxyFactory] => > java_IteratorProxyFactory Object ( [client] => java_Client Object > *RECURSION* ) [idx] => 0 ) [__delegate] => java_ArrayProxy Object > ( [__serialID] => [__java] => 3 [__signature] => [I [__client] > => java_Client Object ( [RUNTIME] => Array ( [NOTICE] => > ***USE echo java_inspect(jVal) OR print_r(java_values(jVal)) TO SEE THE > CONTENTS OF THIS JAVA OBJECT!*** [PIPE_DIR] => [PARSER] => NATIVE > ) [result] => [exception] => [parser] => java_Parser Object ( > [ENABLE_NATIVE] => 1 [DISABLE_SIMPLE] => [parser] => > java_NativeParser Object ( [parser] => Resource id #2 [handler] > => java_Client Object *RECURSION* [level] => 0 [event] => 1 > [buf] => > ) > > ) > > [simpleArg] => java_Arg Object > ( > [client] => java_Client Object > *RECURSION* > [exception] => > [factory] => java_SimpleFactory Object > ( > [client] => java_Client Object > *RECURSION* > ) > > [val] => 3 > [signature] => [I > ) > > [compositeArg] => > [simpleFactory] => java_SimpleFactory Object > ( > [client] => java_Client Object > *RECURSION* > ) > > [proxyFactory] => java_ProxyFactory Object > ( > [client] => java_Client Object > *RECURSION* > ) > > [iteratorProxyFacroty] => > [arrayProxyFactory] => java_ArrayProxyFactory Object > ( > [client] => java_Client Object > *RECURSION* > ) > > [exceptionProxyFactory] => java_ExceptionProxyFactory > Object > ( > [client] => java_Client Object > *RECURSION* > ) > > [throwExceptionProxyFactory] => > java_ThrowExceptionProxyFactory Object > ( > [client] => java_Client Object > *RECURSION* > ) > > [arg] => java_Arg Object > ( > [client] => java_Client Object > *RECURSION* > [exception] => > [factory] => java_SimpleFactory Object > ( > [client] => java_Client Object > *RECURSION* > ) > > [val] => 3 > [signature] => [I > ) > > [asyncCtx] => 3 > [cancelProxyCreationCounter] => 0 > [globalRef] => java_GlobalRef Object > ( > [map] => Array > ( > ) > > ) > > [stack] => > [defaultCache] => Array > ( > ) > > [asyncCache] => Array > ( > ) > > [methodCache] => Array > ( > [&@Arrayausgabe] => java_CacheEntry Object > ( > [fmt] => > [signature] => Arrayausgabe > [factory] => java_ProxyFactory Object > ( > [client] => java_Client Object > *RECURSION* > ) > > [java] => > [resultVoid] => > ) > > [@Arrayausgabe@meinArray@i] => java_CacheEntry > Object > ( > [fmt] => > [signature] => [I > [factory] => java_ArrayProxyFactory > Object > ( > [client] => java_Client Object > *RECURSION* > ) > > [java] => > [resultVoid] => > ) > > ) > > [isAsync] => 0 > [currentCacheKey] => > [currentArgumentsFormat] => > [cachedJavaPrototype] => java_JavaProxyProxy Object ( [__client] > => java_Client Object *RECURSION* [__delegate] => [__serialID] > => [__factory] => [__java] => [__signature] => > [__cancelProxyCreationTag] => ) [sendBuffer] => > [preparedToSendBuffer] => [protocol] => java_Protocol Object ( > [client] => java_Client Object *RECURSION* [webContext] => > /Ordner/arrayausgabe.php.phpjavabridge [serverName] => > 127.0.0.1:8081 [socketHandler] => java_SocketHandler Object ( > [protocol] => java_Protocol Object *RECURSION* [channel] => > java_SocketChannel Object ( [peer] => Resource id #3 [protocol] > => java_Protocol Object *RECURSION* [channelName:private] => 9267 > [host:private] => 127.0.0.1 ) ) [handler] => > java_SimpleHttpHandler Object ( [headers] => [redirect] => > [context] => X_JAVABRIDGE_CONTEXT: > 1@C%3A%5CDevelopment%5Capache-tomcat-6.0.18%5Cwebapps%5COrdner [ssl] > => [port] => 8081 [host] => 127.0.0.1 [protocol] => > java_Protocol Object *RECURSION* [channel] => java_SocketChannel > Object ( [peer] => Resource id #3 [protocol] => java_Protocol > Object *RECURSION* [channelName:private] => 9267 [host:private] > => 127.0.0.1 ) ) ) [iteratorProxyFactory] => > java_IteratorProxyFactory Object ( [client] => java_Client Object > *RECURSION* ) [idx] => 0 ) [__tempGlobalRef] => ) [__serialID] > => [__factory] => [__java] => 3 [__signature] => [I > [__cancelProxyCreationTag] => ) > > > > > > > > ------------------------------------------------------------------------------ > Stay on top of everything new and different, both inside and > around Java (TM) technology - register by April 22, and save > $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco. > 300 plus technical and hands-on sessions. Register today. > Use priority code J9JMT32. http://p.sf.net/sfu/p > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > |
|
From: <php...@li...> - 2009-04-17 11:51:16
|
just guessing, but have you tried
$object = new java("Arrayausgabe");
$result = $object->meinArray(5);
print_r($result);
?
2009/4/17 <php...@li...>
> Hello,
> does anyone have an idea how to access this class from php?
>
> public class Arrayausgabe{
>
> public int[] meinArray(int wert){
> int a=wert;
> int Array[]=new int[5];
> Array[0]=a;
> Array[1]=a+1;
> Array[2]=a+2;
> Array[3]=a+5;
> Array[4]=a+9;
> return Array;
> }
> }
>
>
>
> Well,
> <?php
> require_once("http://localhost:8081/Ordner/java/Java.inc");
> $System = java("java.lang.System");
> $object = new java("Arrayausgabe");
> ????????????????????????????????
> ?>
>
> Thanks in advance!!!!!!!!!!!!!
>
>
>
>
>
>
> ------------------------------------------------------------------------------
> Stay on top of everything new and different, both inside and
> around Java (TM) technology - register by April 22, and save
> $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
> 300 plus technical and hands-on sessions. Register today.
> Use priority code J9JMT32. http://p.sf.net/sfu/p
> _______________________________________________
> php-java-bridge-users mailing list
> php...@li...
> https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users
>
|