I just installed the current Tomcat version on my mac because I wanted to try the PHP Java bridge.
I followed the guide here http://php-java-bridge.sourceforge.net/pjb/tomcat6.php but when I paste the xml config to the tomcat configuration file
<listener><listener-class>php.java.servlet.ContextLoaderListener</listener-class></listener>
<servlet><servlet-name>PhpJavaServlet</servlet-name><servlet-class>php.java.servlet.PhpJavaServlet</servlet-class></servlet>
<servlet><servlet-name>PhpCGIServlet</servlet-name><servlet-class>php.java.servlet.PhpCGIServlet</servlet-class>
<init-param><param-name>prefer_system_php_exec</param-name><param-value>On</param-value></init-param>
<init-param><param-name>php_include_java</param-name><param-value>On</param-value></init-param>
</servlet>
<servlet-mapping><servlet-name>PhpJavaServlet</servlet-name><url-pattern>*.phpjavabridge</url-pattern> </servlet-mapping>
<servlet-mapping><servlet-name>PhpCGIServlet</servlet-name><url-pattern>*.php</url-pattern></servlet-mapping>
nothing works anymore - all I get when I open localhost:8080 is "error 404 - resource() not found". If I leave out the above lines, at least I get the welcome page, but then the directory where I put the phpJavaBridge application only shows the resource() not found error.
I am pretty new to development with Tomcat, so I really have no idea how to fix that problem. Any help would be greatly appreciated!
Your Java Version is out of date. Use Sun Java 6 or above instead.
The 'NoClassDefFoundError' means that Sun's script api is missing. Search for script-api.jar and install that to get rid of this error.
deploy JavaBridge.war is easy
https://sourceforge.net/projects/php-java-bridge/files/Binary%20package/php-java-bridge_6.2.1/php-java-bridge_6.2.1_documentation.zip
unzip php-java-bridge_6.2.1_documentation.zip,you wil find JavaBridge.war in the folder.
Related
Even after searching too much i couldn't find any suitable answer for my problem.
I am using Spring Tool Suite and trying to create a new server but getting error as The specified server is not valid. The .tc-runtime-instance file is missing.
So, I tried updating pivotal using Windows> Preferences and tried editing pivotal with new release but got the error as attached:
I tried changing tomcat version from 9 to 7 too but still no success. Please help.
It looks like you are trying to use the server adapter for the "Pivotal tc Server" to configure your server in the IDE. This server adapter is for the Pivotal tc Server only and doesn't work with a plain Tomcat installation on your disc. For that, you should select the "Apache Tomcat" server adapter when creating a server instance in your IDE.
Hi i am trying to install jautodoc in my mars version but i got following error please help me
HTTP Server 'Service Unavailable': http://jautodoc.sourceforge.net/update/content.xml
HttpComponents connection error response code 503.
In your eclipse you can get it from help -->Eclipse MarketPlace --> search for jAutodoc this is one way.. If it is not supporting in your eclipse
2nd way is copy from your old eclipse pluggins
go to your eclipse pluggins location ........
C:\Program Files\eclipse\plugins and copy the net.sf.jautodoc.velocity_1.12 jar
net.sf.jautodoc_1.12.jar (if u have in your previous eclipse)
HTTP Error 503 - Service unavailable
The Web server (running the Web site) is currently unable to handle
the HTTP request due to a temporary overloading or maintenance of the
server
Please check attached screen shot SourceForge is under maintenance mode
I'm using Tomcat and PHP5 with JavaBridge. I have bridged PHP and Java so I can screencap web pages within PHP. This was working on another server but after moving to a new server I can not get it working, so I'm reaching for straws here.
require_once("http://localhost:8080/JavaBridge/java/Java.inc");
java_autoload("/web/sites/madfrog/domain.com/cron/bin/html2image.jar");
$JavaHTML2Image = new Java("com.elance.proposal.html2image.client.MainBridge");
It should have loaded all of the project html2image.jar when the script _autoloaded it, however when you create the new Java object I get the error
Class Not Found: Fatal error: Uncaught [[o:Exception]:"java.lang.Exception: CreateInstance failed: new com.elance.proposal.html2image.client.MainBridge. Cause: java.lang.ClassNotFoundException: com.elance.proposal.html2image.client.MainBridge
I asked the guys over in Java and they said I needed to put the jar file in the lib so Java could find it, so I dumped it into Tomcat's webapps folder an into /usr/share/java. But that did nothing. With that said the PHP has a direct reference to it, so it should be loaded.
I'm at a lost after two days. any help is appreciated!
Which version of Tomcat do you use?
For Tomcat 6 or Tomcat 7 put the jar either in ${tomcat.home}/lib or in ${tomcat.home}/webapps/${your.war}/lib
While tomcat.home is your tomcat installation directory. And your.war is the name of your war file.
I am having trouble setting up the Php-Java Bridge setup properly.
I will explain what I have done.
My site is in pure php
For our payment transaction process we need to set up a php-java bridge
I followed this link to setup the bridge PHP-JAVA BRIDGE INSTALATION.
Here I learned that I need to have a private jvm to install the bridge.
So 1st i installed apache-tomcat-6.0.14 in Private JVM using my c-panel. After instalation it asked me to Map a domain to private JVM. So I mapped my domain example.com (which is the only option available) to it.
Then it asked to enable a traffic redirection from Apache web server to my Java application server (there was a check box and i clicked it)
Finally it asked me to deploy the WAR File (JavaBridge.WAR was my file) and everthing seems fine
Now when i go to http://example.com/JavaBridge/ I could see the javabridge examples and it works fine.
SO FAR SO GOOD
Now my problem starts here when I try to access a java class file from php. A sample test.php is what I create and put the following code into it.
<?php
require_once("http://example.com:portnumber/JavaBridge/java/Java.inc");
$System = java("java.lang.System");
echo $System->getProperties(); //This Part echo's correctly and shows the data so it means i can access Java.inc Correctly
$path_e24class = getcwd(). '/e24PaymentPipe.class'; //This part fails both test.php and java class file e24PaymentPipe.class are in the same directory in publich_html folder
java_require($path_e24class);
$pipe = new Java("e24PaymentPipe");
$pipe->setAction("1");
?>
My site contents reside in the public_html folder and the WAR file are deployed in private jvm.
These are the error message am getting.
1) Warning: java_require() not supported anymore. Please use tomcat or jee hot deployment instead
Fatal error: Uncaught [[o:Exception]:"java.lang.Exception: CreateInstance failed: new e24PaymentPipe. Cause: java.lang.ClassNotFoundException: e24PaymentPipe VM: 1.6.0_22#http://java.sun.com/" at: #-10
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358) #-9
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204) #-8
java.lang.Class.forName0(Native Method) #-7
java.lang.Class.forName(Class.java:247) #-6
php.java.bridge.Util.classForName(Util.java:1518) #-5
php.java.bridge.JavaBridge.CreateObject(JavaBridge.java:445) #-4
php.java.bridge.Request.handleRequest(Request.java:458) #-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
http://example.com:portnumber/JavaBridge/java/Java.inc(232): java_ThrowExceptionProxyFactory->getProxy(3, 'java.util.Prope...', 'T', false) #1
Finally I don't know much about the java. So am stuck here not knowing what to do.
Here is a great step by step tutorial you can follow, which shows everything required! It is a little old (2007) but helped me a while ago.
There is also another option. You can install Apache Tomcat and deploy your war there. You can have even multiple tomcat instances simultaneously with your httpd running at the same time on the same machine, as long as you respect the port settings. You can even front them with Apache httpd.
you can try this:
package your code to jar, and copy it to java.ext.dirs which you can found in JavaBridge.log
copy the related class libraries to java.ext.dirs
restart the service of JavaBridge
good luck!
<?php require_once("JavaBridge/java/Java.inc");
try {
$hd = new java("hdfs.HDFS");
$hd->get("hdfs://master:9000/user/hadoop/test-in/logo_cn.png", "/home/hadoop/1.png");
} catch (JavaException $ex) { echo "An exception occured: "; echo $ex; echo "<br>\n";}
?>
You can use this php implementation on github that works with php 5.3.
See credits on the git readme for more information.
You can try this; put the JavaBridge.jar in tomcat's lib folder e.g. apache-tomcat-7.0.12/lib.
Restart tomcat server and then,
$pipe = new java("com.aciworldwide.commerce.gateway.plugins.e24PaymentPipe");
$pipe->setAction("1");
This way I created the php version of the object.
Why don't you put the e24PaymentPipe class in your Java application's classpath and skip the two lines below:
// $path_e24class = getcwd(). '/e24PaymentPipe.class';
// java_require($path_e24class);
$pipe = new java("fully.qualified.classpath.e24PaymentPipe");
You are mixing PHP side and Java side operations. in theory the java_require (which is deprecated) was designed to work on the Java side. You are specifying a PHP side path.
You can save yourself a lot of grief by using a pure PHP implementation of the e24PaymentPipe library.
Disclaimer
The link is to my github repo of the library, but I did not write it. See the readme in for original credits.
Hi I'm trying to install this tool 'Sean Corfield's scripting for ColdFusion project.' on my server - problem is I am getting "Class not found: com.caucho.quercus.script.QuercusScriptEngineFactory " errors, I have java 1.6 installed.... I'm not sure how where to get these extra classes ... any help?
[opensuse 11 system, CF8 java 1.6]
-thanks
-sean
Did you follow the installation instructions for the cfphp, as per the "example.cfm" page:
Installation:
1. Copy lib/quercus.jar and lib/resin-util.jar to WEB-INF/cfusion/lib/
(multiserver) or coldfusion8/lib (standalone)
2. Restart ColdFusion 8.
3. Optionally copy customtags/php.cfm into your custom tags path.
The important thing is that the quercus.jar is accessible to the JVM. Your error message indicates that the JVM can't find the jar.