|
From: <php...@li...> - 2009-04-30 13:14:50
|
Hi, the class"SommerHaus" contains many methods, I would like to call getNewNumber: java.lang.RuntimeException: PHP Fatal error: Uncaught [[o:Exception]:"java.lang.Exception: Invoke failed: [[o:SommerHaus]]->getNewNumber. Cause: java.lang.NoSuchMethodException:getNewNumber (). Candidates: [] VM: 1.6.0_10@http://java.sun.com/" at: What can be done to find a solution for this problem? |
|
From: <php...@li...> - 2009-04-30 14:14:13
|
Well,
...............................................(code)
.................................................
public Collection<String> getDocuments(){ // one part of the code
return documents;
}
/**
* Returns the categories if builded.
* @return
*/
public ArrayList<ArrayList<String>> getKategorien(){
return categories;
}
public String getNewNumber(){
return "drei";
}
}
2. php:
<?php
require_once("http://localhost:8080/Bridge/java/Java.inc");
$System = java("java.lang.System");
$Ob = new java("com.SommerHaus");
echo $Ob->getNewNumber();
?>
|
|
From: <php...@li...> - 2009-05-01 07:35:35
|
Well, your code will work, provided that this is really the code that your
computer sees, and not some old version of it.
Apr 30, 2009 4:15 nachm. schrieb am <
php...@li...>:
Well,
...............................................(code)
.................................................
public Collection<String> getDocuments(){ // one part of the code
return documents;
}
/**
* Returns the categories if builded.
* @return
*/
public ArrayList<ArrayList<String>> getKategorien(){
return categories;
}
public String getNewNumber(){
return "drei";
}
}
2. php:
<?php
require_once("http://localhost:8080/Bridge/java/Java.inc");
$System = java("java.lang.System");
$Ob = new java("com.SommerHaus");
echo $Ob->getNewNumber();
?>
------------------------------------------------------------------------------
Register N...
|
|
From: <php...@li...> - 2009-05-01 11:58:01
|
just guessing... have you initialized documents first?
so that getDocuments doesn't return null?
2009/4/30 <php...@li...>
> Well,
> ...............................................(code)
> .................................................
> public Collection<String> getDocuments(){ // one part of the code
> return documents;
> }
> /**
> * Returns the categories if builded.
> * @return
> */
> public ArrayList<ArrayList<String>> getKategorien(){
> return categories;
>
> }
> public String getNewNumber(){
> return "drei";
> }
> }
>
> 2. php:
> <?php
>
> require_once("http://localhost:8080/Bridge/java/Java.inc");
>
> $System = java("java.lang.System");
>
> $Ob = new java("com.SommerHaus");
>
> echo $Ob->getNewNumber();
>
> ?>
>
>
>
>
>
>
> ------------------------------------------------------------------------------
> Register Now & Save for Velocity, the Web Performance & Operations
> Conference from O'Reilly Media. Velocity features a full day of
> expert-led, hands-on workshops and two days of sessions from industry
> leaders in dedicated Performance & Operations tracks. Use code vel09scf
> and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
> _______________________________________________
> php-java-bridge-users mailing list
> php...@li...
> https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users
>
|
|
From: <php...@li...> - 2009-05-04 07:00:21
|
Hello,
I get the whole time "NoSuchMethodException", but if I add "java_require(".....")" to the php code I get another message:
javax.servlet.ServletException: java.lang.RuntimeException:
PHP Fatal error: Uncaught [[o:Exception]:"java.lang.Exception:
Invoke failed: [[o:JavaBridge]]->updateJarLibraryPath((o:String)
[o:String], (o:String)[o:String], (o:String)[o:String], (o:String)
[o:String]). Cause: java.io.IOException: Could not open jar file
WebProjekt, reason: WebProjekt (Das System kann die angegebene Datei nicht finden) VM: 1.6.0_10@http://java.sun.com/"Why is the jar(file) not found?
Many thanks in Advance!
|
|
From: <php...@li...> - 2009-05-04 07:18:25
|
1. You can query the available methods using echo java_inspect($objOrClass)
2. The java_require() creates a new url class loader which can load any .jar
file or directory containing jar files, provided they are accessible and
valid.
3. Classes must be loaded by one and only one class loader. Adding the same
location or copying classes to another location (moving them is okay) will
lead to a disaster. Blame sun for this.
Regards,
Jost Boekemeier
Mai 4, 2009 9:00 vorm. schrieb am <
php...@li...>:
Hello,
I get the whole time "NoSuchMethodException", but if I add
"java_require(".....")" to the php code I get another message:
javax.servlet.ServletException: java.lang.RuntimeException:
PHP Fatal error: Uncaught [[o:Exception]:"java.lang.Exception:
Invoke failed: [[o:JavaBridge]]->updateJarLibraryPath((o:String)
[o:String], (o:String)[o:String], (o:String)[o:String], (o:String)
[o:String]). Cause: java.io.IOException: Could not open jar file
WebProjekt, reason: WebProjekt (Das System kann die angegebene Datei nicht
finden) VM: 1.6.0_10@http://java.sun.com/"Why is the jar(file) not found?
Many thanks in Advance!
------------------------------------------------------------------------------
Register No...
|
|
From: <php...@li...> - 2009-05-04 07:42:49
|
Using " java_inspect" I get: root cause java.lang.RuntimeException: PHP Fatal error: Uncaught [[o:Exception]:"java.lang.Exception: CreateInstance failed: new WebProjekt. Cause: java.lang.ClassNotFoundException: WebProjekt VM: 1.6.0_10@http://java.sun.com/" at: |
|
From: <php...@li...> - 2009-05-04 08:14:02
|
have you put the required jar file into the /WEB-INF/lib folder of your web-project ? so it looks like web-project.jar + | someJSP.jsp |- /WEB-INF/web.xml |- /WEB-INF/lib/someOtherJar.jar |- /WEB-INF/classes/org/somedomain/somepackage/SomeClass.class or how does your project look like? and what code do you use that throws the exception. please always provide this information... your exception is specific to your project and if we do not know how your project looks like and which code creates the problem, we cannot help you. 2009/5/4 <php...@li...> > > > Using " java_inspect" I get: > root cause java.lang.RuntimeException: PHP Fatal error: > Uncaught [[o:Exception]:"java.lang.Exception: > CreateInstance failed: new WebProjekt. > Cause: java.lang.ClassNotFoundException: WebProjekt VM: 1.6.0_10@ > http://java.sun.com/" at: > > > > > > > ------------------------------------------------------------------------------ > Register Now & Save for Velocity, the Web Performance & Operations > Conference from O'Reilly Media. Velocity features a full day of > expert-led, hands-on workshops and two days of sessions from industry > leaders in dedicated Performance & Operations tracks. Use code vel09scf > and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > |
|
From: <php...@li...> - 2009-05-04 09:44:10
|
In the folder Ordner I have the php-file, in META-INF/lib I have the jar"WebProjekt".
<?php
require_once("http://localhost:8081/Ordner/java/Java.inc");
$System = java("java.lang.System");
$myObj = new java('WebProjekt');
echo java_inspect('web.FacettenBrowser');
echo $myObj->getHalloWelt();
?>
|
|
From: <php...@li...> - 2009-05-04 09:55:28
|
try to put it in /WEB-INF/lib
in META-INF only meta-information is stored...
On Mon, May 4, 2009 at 11:44 AM, <
php...@li...> wrote:
>
>
> In the folder Ordner I have the php-file, in META-INF/lib I have the
> jar"WebProjekt".
> <?php
> require_once("http://localhost:8081/Ordner/java/Java.inc");
>
> $System = java("java.lang.System");
>
> $myObj = new java('WebProjekt');
> echo java_inspect('web.FacettenBrowser');
> echo $myObj->getHalloWelt();
>
>
> ?>
>
>
>
>
>
> ------------------------------------------------------------------------------
> Register Now & Save for Velocity, the Web Performance & Operations
> Conference from O'Reilly Media. Velocity features a full day of
> expert-led, hands-on workshops and two days of sessions from industry
> leaders in dedicated Performance & Operations tracks. Use code vel09scf
> and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
> _______________________________________________
> php-java-bridge-users mailing list
> php...@li...
> https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users
>
|
|
From: <php...@li...> - 2009-05-04 11:32:03
|
Only to be sure, is it ok that I try to invoke the only one method (there are other in the java code)? Because I can't find any mistakes, but I get "SuchMethodNotFoundException"?
|
|
From: <php...@li...> - 2009-04-30 13:54:33
|
you could start by showing os the php code you used and the method signature of the method you would like to invoke. ( e.g. public Integer getNewNumber() or maybe public int getNewNumber(String something), etc. ) 2009/4/30 <php...@li...> > > > > Hi, > the class"SommerHaus" contains many methods, I would like to call > getNewNumber: > java.lang.RuntimeException: PHP Fatal error: > Uncaught [[o:Exception]:"java.lang.Exception: > Invoke failed: [[o:SommerHaus]]->getNewNumber. > Cause: java.lang.NoSuchMethodException:getNewNumber > (). > Candidates: [] VM: 1.6.0_10@http://java.sun.com/" at: > > What can be done to find a solution for this problem? > > > > > > > > > ------------------------------------------------------------------------------ > Register Now & Save for Velocity, the Web Performance & Operations > Conference from O'Reilly Media. Velocity features a full day of > expert-led, hands-on workshops and two days of sessions from industry > leaders in dedicated Performance & Operations tracks. Use code vel09scf > and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > |