|
From: <php...@li...> - 2009-04-21 09:40:30
|
Hello Jost,
thank you very much for your advice.
I've tried to put my class (ExampleFO2PDF.class) to
/opt/coolstack/tomcat6/webapps/JavaBridge/WEB-INF/classes
(since I'm running Tomcat port 8080), but still without success.
I've still got error : java.lang.ClassNotFoundException:embedding.ExampleFO2PDF
It seems, I have problem with the Java classes, I'm not expert in Java,
hence I will learn, how to create/modify classes/classpath in Java, then I will try again
this example.
thank you for your help.
Al
--- On Mon, 4/20/09, php...@li... <php...@li...> wrote:
From: php...@li... <php...@li...>
Subject: Re: [Php-java-bridge-users] ExampleFO2PDF.java & PHP-Java-Bridge
To: php...@li...
Date: Monday, April 20, 2009, 3:16 AM
Hi,
If it is true that
java emb.FPDF
works, then it is also true that:
java -jar JavaBridge.jar SERVLET:8090 3 jb.log &
echo '<?php require("http://localhost:8090/JavaBridge/java/Java.inc");java("emb.FPDF")->main(array());?>'
| php -dallow_url_include=On
works.
Everything else is guesswork.
Please copy your classes to JavaBridge.war's WEB-INF/classes and your
libraries to its WEB-INF/lib and re-deploy the modified JavaBridge.war.
After that use the above PHP code to test (change the port nr to 8080 or
whichever port your j2ee server listens on).
There's a user-contributed video on our web site which shows how to work
with tomcat: http://php-java-bridge.sourceforge.net/pjb/installation.php
Regards,
Jost Boekemeier
Apr 20, 2009 11:17 vorm. schrieb am <
php...@li...>:
Hello,
Thank you for your advice with the class FopFactory (I will try this later).
What do you think about the following PHP script I've created ?
www:root>vi ExampleFO2PDF.php
------------
<?php
require_once('java/Java.inc');
$basedir = new Java("java.io.File", ".");
$outdir = new Java("java.io.File", "out");
$outdir->mkdirs();
$fofile = new Java("java.io.File", $basedir, "InputFO2PDF.fo");
$pdffile = new Java("java.io.File", $outdir, "ResultFO2PDF.pdf");
echo "Input: ".$fofile->toString()."\n";
echo "Output: ".$pdffile->toString()."\n";
$myObject = new Java("embedding.ExampleFO2PDF");
$myObject->convertFO2PDF($fofile, $pdffile);
?>
---------
When I run from command line: java embedding.ExampleFO2PDF
it's OK:
FOP
ExampleFO2PDF
Preparing...
Input: XSL-FO (./xml/fo/helloworld.fo)
Output: PDF (./out/ResultFO2PDF.pdf)
Transforming...
PageSequence <no id> generated 1 pages.
PageSequence <no id> generated 1 pages.
Generated 2 pages in total.
Success!
But when I send a request:
http://myhost.com/embedding/ExampleFO2PDF.php
I've got error in PHP error log: phperror.log
---------
[17-Apr-2009 10:10:11] PHP Fatal error: Uncaught
[[o:Exception]:"java.lang.Exception: CreateInstance failed: new
embedding.ExampleFO2PDF. Cause: java.lang.ClassNotFoundException:
embedding.ExampleFO2PDF VM: 1.6.0_10@http://java.sun.com/" at:
----------
The class embedding.ExampleFO2PDF does exist, and is in the right place (in
the directory
$CLASSPATH).
--- On Fri, 4/17/09, php...@li... <
php...@li...> wrote:
From: php...@li... <
php...@li...>
Subject: Re: [Php-java-bridge-users] ExampleFO2PDF.java & PHP-Java-Bridge
To: php...@li...
Date: Friday, April 17, 2009, 8:36 AM
I don't think that tools exist which can translate a java example to PHP
code. But since both langu...
------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today.
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
php-java-bridge-users mailing list
php...@li...
https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users
|