|
From: <php...@li...> - 2008-08-22 17:25:54
|
Thank you.
I was able to sort of get it going, but the work-around was lame. What I
found was that if I included every jar file accessed in every object
called in the PHP code, that it could resolve the references. I'll start
using the /usr/lib/jvm/java-6-sun-1.6.0.03/jre/lib/ext directory to hold
my jars in the future. This is what I was looking for.
Charles Shaffer
Senior Analyst
NTN-Bower Corporation
php...@li...
Sent by: php...@li...
08/22/2008 05:43 AM
Please respond to php-java-bridge-users
To: php...@li...
cc:
Subject: Re: [Php-java-bridge-users] (no subject)
Hi,
a *global* CLASSPATH variable (i.e. which is set directly by the kernel or
the init process) doesn't exist. So you can't use it. (the whole classpath
concept is insane anyway).
Please store your libraries in the jre/lib/ext repository instead.
Depending on your version this is /usr/lib/jvm/java-6-sun/jre/lib/ext or
java-6-sun-1.6.0.03/jre/lib/ext or wherever.
Regards,
Jost Boekemeier
__________________________________________________
Do You Yahoo!?
Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz
gegen Massenmails.
http://mail.yahoo.com
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's
challenge
Build the coolest Linux based applications with Moblin SDK & win great
prizes
Grand prize is a trip for two to an Open Source event anywhere in the
world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
php-java-bridge-users mailing list
php...@li...
https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users
|
|
From: <php...@li...> - 2008-08-25 19:24:24
|
Hello,
I have moved all required jar and zip files to:
/usr/lib/jvm/java-6-sun-1.6.0.03/jre/lib/ext
In the php code I add:
java_require("asjava.zip;msbase.jar;msutil.jar;bowerweb.jar;");
But I still get:
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 asjava.zip, reason:
error in opening zip file
Responsible VM: 1.6.0_03@http://java.sun.com/" at:
#-17
php.java.bridge.DynamicJavaBridgeClassLoader.checkJarFile(DynamicJavaBridgeClassLoader.java:108)
#-16 php.java.bridge.JarLibraryPath.createUrls(JarLibraryPath.java:193)
#-15 php.java.bridge.JarLibraryPath.checkURLs(JarLibraryPath.java:118)
#0 java.inc(257): java_ThrowExceptionProxyFactory->getProxy(1, NULL, true)
#1 java.inc(473): java_Arg->getResult(true)
#2 java.inc(479): java_Client->getWrappedResult(true)
#3 java.inc(672): java_Client->getResult()
#4 java.inc(1664): java_Client->invokeMethod(0, 'updateJarLibrar...',
Array)
#5 /var/www/pbr/pbr_acct_summary.php(6):
java_require('asjava.zip;msba...')
#6 {main}] thrown in java.inc on line 220
Do I need to give a fully qualified path in the java_require statement?
There is also a /usr/lib/jvm/java-6-sun-1.6.0.03/ext
directory. Is that the repository I am looking for?
Charles Shaffer
Senior Analyst
NTN-Bower Corporation
php...@li...
Sent by: php...@li...
08/22/2008 05:43 AM
Please respond to php-java-bridge-users
To: php...@li...
cc:
Subject: Re: [Php-java-bridge-users] (no subject)
Hi,
a *global* CLASSPATH variable (i.e. which is set directly by the kernel or
the init process) doesn't exist. So you can't use it. (the whole classpath
concept is insane anyway).
Please store your libraries in the jre/lib/ext repository instead.
Depending on your version this is /usr/lib/jvm/java-6-sun/jre/lib/ext or
java-6-sun-1.6.0.03/jre/lib/ext or wherever.
Regards,
Jost Boekemeier
__________________________________________________
Do You Yahoo!?
Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz
gegen Massenmails.
http://mail.yahoo.com
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's
challenge
Build the coolest Linux based applications with Moblin SDK & win great
prizes
Grand prize is a trip for two to an Open Source event anywhere in the
world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
php-java-bridge-users mailing list
php...@li...
https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users
|
|
From: <php...@li...> - 2008-08-26 09:59:46
|
Hi,
[using the static loader and the dynamic loader]
> I have moved all required jar and zip files to: [...]
> java_require("asjava.zip;msbase.jar;msutil.jar;bowerweb.jar;");
Why do you want to load your java libraries from both loaders?
> Fatal error: Uncaught
> Cause: java.io.IOException: Could not open jar file
> asjava.zip, reason:
> error in opening zip file
> Responsible VM: 1.6.0_03@http://java.sun.com/" at:
Please see the "loading libraries" section fom the README for details.
Regards,
Jost Boekemeier
__________________________________________________
Do You Yahoo!?
Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails.
http://mail.yahoo.com
|
|
From: <php...@li...> - 2008-08-26 13:33:45
|
>> Why do you want to load your java libraries from both loaders?
Just guessing.
>> Please see the "loading libraries" section fom the README for details.
I found the section and have read it. I am using an Ubuntu (Debian)
install and the readme is discussing a redhat install, but from what I
gather I believe my problem is related to
Note that classes loaded from two different class loader instances
cannot access each other.
I am finding that when I load a custom object that has an import in it,
that I have to add a reference in the php code to the imported library in
the custom object. I have to admit that I am thoroughly confused at this
point. I am not sure why the PHP needs to be aware of the library that is
used in the custom object. Clearly I need to do some more reading about
class loading.
Charles Shaffer
Senior Analyst
NTN-Bower Corporation
php...@li...
Sent by: php...@li...
08/26/2008 04:59 AM
Please respond to php-java-bridge-users
To: php...@li...
cc:
Subject: Re: [Php-java-bridge-users] (no subject)
Hi,
[using the static loader and the dynamic loader]
> I have moved all required jar and zip files to: [...]
> java_require("asjava.zip;msbase.jar;msutil.jar;bowerweb.jar;");
Why do you want to load your java libraries from both loaders?
> Fatal error: Uncaught
> Cause: java.io.IOException: Could not open jar file
> asjava.zip, reason:
> error in opening zip file
> Responsible VM: 1.6.0_03@http://java.sun.com/" at:
Please see the "loading libraries" section fom the README for details.
Regards,
Jost Boekemeier
__________________________________________________
Do You Yahoo!?
Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz
gegen Massenmails.
http://mail.yahoo.com
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's
challenge
Build the coolest Linux based applications with Moblin SDK & win great
prizes
Grand prize is a trip for two to an Open Source event anywhere in the
world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
php-java-bridge-users mailing list
php...@li...
https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users
|
|
From: <php...@li...> - 2008-08-26 17:06:07
|
Hi, well, the NoClassDefFound error means that an external reference is missing (an entity which has been available during the compilation of the class). The bridge has two different class loading mechanisms, one is the static loader, the other one is the dynamic loader which can load *some* java archives at run-time (via java_require(...) or java_autoload(...)). I said "some" because dynamic class loading doesn't really work in Java, neither in Tomcat nor in J2EE; once the dynamically loaded classes are referenced by system libraries, you can't unload them anymore. Regards, Jost Boekemeier __________________________________________________ Do You Yahoo!? Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails. http://mail.yahoo.com |
|
From: <php...@li...> - 2008-08-26 18:21:41
|
Hello Jost,
I believe I am loading the custom libraries statically now. I don't use a
java_require or reload statement in my PHP code. From the sounds of the
email below, that is probably the best approach. However, I think I just
discovered an implication of doing that.
I made a minor change to one method in the U2 class. Before the change it
had 4 input parameters. After the change it had 3 input parameters. I
moved it to the ext directory, but no matter what I tried I kept getting a
method not found error. I assumed it was because I was sending it 3
parameters, but it still "thought" it had 4. Finally I rebooted the web
server and it worked fine.
This makes me suspect that static libraries load once on startup, and that
simply moving the jar to the ext directory does not reload them. So here
is my question. If that is the case, is there anyway short of a reboot to
force the static libraries to reload?
Thanks.
Charles Shaffer
Senior Analyst
NTN-Bower Corporation
php...@li...
Sent by: php...@li...
08/26/2008 12:06 PM
Please respond to php-java-bridge-users
To: php...@li...
cc:
Subject: Re: [Php-java-bridge-users] (no subject)
Hi,
well, the NoClassDefFound error means that an external reference is
missing (an entity which has been available during the compilation of the
class).
The bridge has two different class loading mechanisms, one is the static
loader, the other one is the dynamic loader which can load *some* java
archives at run-time (via java_require(...) or java_autoload(...)).
I said "some" because dynamic class loading doesn't really work in Java,
neither in Tomcat nor in J2EE; once the dynamically loaded classes are
referenced by system libraries, you can't unload them anymore.
Regards,
Jost Boekemeier
__________________________________________________
Do You Yahoo!?
Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz
gegen Massenmails.
http://mail.yahoo.com
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's
challenge
Build the coolest Linux based applications with Moblin SDK & win great
prizes
Grand prize is a trip for two to an Open Source event anywhere in the
world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
php-java-bridge-users mailing list
php...@li...
https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users
|