NoClassDefFoundError when starting Apache w/ PHP-Java-Bridge

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pbmods
    Recognized Expert Expert
    • Apr 2007
    • 5821

    NoClassDefFoundError when starting Apache w/ PHP-Java-Bridge

    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:

    Originally posted by error_log
    Exception in thread "main" java.lang.NoCla ssDefFoundError : 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
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    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

    Comment

    • pbmods
      Recognized Expert Expert
      • Apr 2007
      • 5821

      #3
      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.bridg e.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.

      Comment

      • JosAH
        Recognized Expert MVP
        • Mar 2007
        • 11453

        #4
        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

        Comment

        • pbmods
          Recognized Expert Expert
          • Apr 2007
          • 5821

          #5
          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!

          Comment

          Working...