Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8056313
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:39:58+00:00 2026-06-05T08:39:58+00:00

I have setup PHP/Java Bridge with working examples in netbeans tomcat directory. What doesnt

  • 0

I have setup PHP/Java Bridge with working examples in netbeans tomcat directory.
What doesnt work is using custom JAR
Here is my code:

package com.micha;

public class Hello1Bean {
    public Hello1Bean()
    {}
    String hi() {return "This is my hello message";}
    String hello(String name) {return "Hello" + name;}
}

And the php code

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
    </head>
    <body>
        <?php
        require_once ("java/Java.inc");
        $world = new Java("com.micha.Hello1Bean");
        echo java_values($world->hi());
        echo "Hello Working Thingy\n\n";

        ?>
    </body>
</html>

When I check http://localhost:8084/JavaBridge/mytest.php:

    javax.servlet.ServletException: java.lang.RuntimeException: PHP Fatal error:  Uncaught [[o:Exception]:"java.lang.Exception: Invoke failed: [[o:Hello1Bean]]->hi. Cause: java.lang.NoSuchMethodException: hi(). Candidates: [] VM: 1.6.0_25@http://java.sun.com/" at:
#-6 php.java.bridge.JavaBridge.checkM(JavaBridge.java:1085)
#-5 php.java.bridge.JavaBridge.Invoke(JavaBridge.java:1024)
#-4 php.java.bridge.Request.handleRequest(Request.java:417)
#-3 php.java.bridge.Request.handleRequests(Request.java:500)
#-2 php.java.bridge.http.ContextRunner.run(ContextRunner.java:145)
#-1 php.java.bridge.ThreadPool$Delegate.run(ThreadPool.java:60)
#0 C:\Users\Micha\.netbeans\7.1.2\apache-tomcat-7.0.22.0_base\webapps\JavaBridge\java\Java.inc(232): java_ThrowExceptionProxyFactory->getProxy(2, 'com.micha.Hello...', 'T', true)
#1 C:\Users\Micha\.netbeans\7.1.2\apache-tomcat-7.0.22.0_base\webapps\JavaBridge\java\Java.inc(360): java_Arg->getResult(true)
#2 C:\Users\Micha\.netbeans\7.1.2\apache-tomcat-7.0.22.0_base\webapps\JavaBridge\java\Java.inc(366): java_Client->getWrappedResult(true)
#3 C:\Users\Micha\.netbean in C:\Users\Micha\.netbeans\7.1.2\apache-tomcat-7.0.22.0_base\webapps\JavaBridge\java\Java.inc on line 195

    php.java.servlet.fastcgi.FastCGIServlet.handle(FastCGIServlet.java:499)
    php.java.servlet.fastcgi.FastCGIServlet.doGet(FastCGIServlet.java:521)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
    php.java.servlet.PhpCGIFilter.doFilter(PhpCGIFilter.java:126)

Before I had a ClassNotFoundException so it knows there is a a class but for some odd reason I cant call the function. ( if I replace “com.micha.Hello1Bean” with some class
that doesnt exist then I get that exception)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T08:39:59+00:00Added an answer on June 5, 2026 at 8:39 am

    Your method is not public, try:

    public String hi() {
           return "This is my hello message";
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a PHP project setup in Netbeans (v6.8) where all the PHP files
I have some setup code in my functions.php file that sets permalinks and adds
I currently have a news website setup in PHP/MYSQL that's a bit old and
I a xampp setup for php. I have created a new repository at D:/xampp/htdocs/cart
I have successfully setup a localhost (Individual Installs) with Apache 2.2, MySQL and PHP,
I have go TCPDF setup in my cake php install and am now trying
I have a login setup on a site that stores login information in PHP's
I have a bit of an outdated hosting company. I have a PHP/Apache setup.
I have a cron task setup to run the following: php /var/www/vhosts/examplesite.com/index.php cron processCategoryItemCount
I have experience programming dynamic websites using both php and perl driven CGI code,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.