Connecting Tech Pros Worldwide Help | Site Map

NoClassDefFoundError when starting Apache w/ PHP-Java-Bridge

pbmods's Avatar
Site Moderator
 
Join Date: Apr 2007
Location: Texas
Posts: 5,435
#1: Jul 19 '07
Heya.

I just installed PHP-Java-Bridge on my system, but I'm having a hard time getting it to stop crashing Apache.

When I activate the 'Java.so' module in php.ini, I get the following error in my Apache logfile:

Quote:

Originally Posted by error_log

Exception in thread "main" java.lang.NoClassDefFoundError: php/java/bridge/Standalone

Attempting to load any page on my webserver results in a segfault. Whee.

As I understand it, this error means that there are no '.class' files in that path. Is this correct? What's with that weird path, 'php/java/bridge/Standalone'? Is this possibly getting mangled somewhere?

I'm posting this both in the Java and PHP forum because I'd like to get input on both sides of the issue. I suspect that it's a configuration issue with PHP-Java Bridge, but I can't be sure because the documentation for it is horribly confusing.

Thanks for your time.
JosAH's Avatar
Expert
 
Join Date: Mar 2007
Posts: 10,611
#2: Jul 19 '07

re: NoClassDefFoundError when starting Apache w/ PHP-Java-Bridge


Quote:

Originally Posted by pbmods

Heya.

I just installed PHP-Java-Bridge on my system, but I'm having a hard time getting it to stop crashing Apache.

When I activate the 'Java.so' module in php.ini, I get the following error in my Apache logfile:



Attempting to load any page on my webserver results in a segfault. Whee.

As I understand it, this error means that there are no '.class' files in that path. Is this correct? What's with that weird path, 'php/java/bridge/Standalone'? Is this possibly getting mangled somewhere?

I'm posting this both in the Java and PHP forum because I'd like to get input on both sides of the issue. I suspect that it's a configuration issue with PHP-Java Bridge, but I can't be sure because the documentation for it is horribly confusing.

Thanks for your time.

I suspect a classpath issue somewhere; what does the php documentation say?
Does that php java.so want to start the entire jvm? Is there a .jar file that contains
the Standalone class? Is that .jar part of the classpath? Questions. questions ...

kind regards,

Jos
pbmods's Avatar
Site Moderator
 
Join Date: Apr 2007
Location: Texas
Posts: 5,435
#3: Jul 19 '07

re: NoClassDefFoundError when starting Apache w/ PHP-Java-Bridge


Heya, Jos.

Thanks for your response.

I ran the issue by a couple of people, and we collectively remembered that Java class packages are stored in a hierarchal format on the filesystem (i.e., Java was trying to require 'php.java.bridge.Standalone'.

After copying the relevant classes from the php-java-bridge source directory and modifying php.ini, I have made the error go away.

Now, Apache crashes without giving any kind of error message.

But now I'm pretty sure this is not a Java-related issue.
JosAH's Avatar
Expert
 
Join Date: Mar 2007
Posts: 10,611
#4: Jul 19 '07

re: NoClassDefFoundError when starting Apache w/ PHP-Java-Bridge


Quote:

Originally Posted by pbmods

Now, Apache crashes without giving any kind of error message.

Apache likes doing that if you can't recite that sloppy documentation from cover
to cover (preferably in Greek, all backwards while doing the secret Apache dance):
it silently crashes right in front of your own eyes before you'll know it.
It's a feature ;-)

kind regards,

Jos
pbmods's Avatar
Site Moderator
 
Join Date: Apr 2007
Location: Texas
Posts: 5,435
#5: Jul 19 '07

re: NoClassDefFoundError when starting Apache w/ PHP-Java-Bridge


Haha yes. Though this time, it is definitely not Apache's fault.

I know, I know; it's up there with 'safe User input', but really!
Reply