cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From (Leszek Gawron)
Subject PHPGenerator
Date Mon, 18 Nov 2002 13:37:41 GMT
I am not able to make PHPGenerator work but maybe you will see some mistake in
my actions:
1. I have downloaded PHP 4.2.3 Win32 binaries from PHP site 
2. I have enabled php_java extension and setup [Java] section like this:
java.class.path = c:\DevTools\php-4.2.3-Win32\extensions\php_java.jar
java.home = c:\DevTools\jdk1.3.1_06 
java.library = c:\DevTools\jdk1.3.1_06\jre\bin\hotspot\jvm.dll 
java.library.path = c:\DevTools\php-4.2.3-Win32\extensions\

3. I have downloaded phpsrvlt.jar from somewhere (the original from PHP
binaries did not contain net.php.servlet class and I was not able to compile
PHP by myself due to some compilation errors)

4. I have put phpsrvlt.jar int lib/optional dir of cocoon sources (today's
snapshot) and updated jars.xml

5. I have built cocoon (scratchpad war)

6. Set up some environment variables (do not even remember which ones)

7. started tomcat (4.1.12)

8. opened cocoon to see if it works

9. added the sitemap entry:
    <map:match pattern="test.php">
	       <map:generate type="php" src="documents/test.php"/>
	       <map:serialize type="xml"/>
10.  created a simple php file:

   print "<?xml version=\"1.0\"?>\n";

   print "<page>\n";
   print "<title>Hello world from PHP</title>\n";
   print "<content>\n";
   print "<para>This is my page being dynamically generated using a PhpGenerator</para>\n";
   print "</content>\n";
   print "</page>\n";

11. run http://localhost:8080/cocoon/test.php

And I get the following error: 
"Function registration failed - duplicate name - java_last_exception_get"
"Function registration failed - duplicate name - java_last_exception_clear"
"java: Unable to register functions, unable to load"

I have figured out that if I disable php_java.dll extension ( and [Java]
section) this error does not occur but still happens what follows:

org.apache.cocoon.ProcessingException: org.xml.sax.SAXParseException: Premature end of file.:
null:-1:-1:org.xml.sax.SAXParseException: Premature end of file.
	at org.apache.cocoon.generation.PhpGenerator.generate(
	at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.processXMLPipeline(
	at org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline.processXMLPipeline(
	at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process(
	at org.apache.cocoon.components.treeprocessor.sitemap.SerializeNode.invoke(
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(
	at org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(
	at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(
	at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(
	at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(
	at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(
	at org.apache.cocoon.Cocoon.process(

What is really funny, when i look into tomcat's console window I see:
<?xml version="1.0"?>
<title>Hello world from PHP</title>
<para>This is my page being dynamically generated using a PhpGenerator</para>

Configuration summary:
Windows 2000
JDK 1.3.1 06
php 4.2.3
phpsrvlt.jar from "somewhere" :) (got the link : )

Has anyone got this error before?

I thought that PHP Generator would be quite useful when dealing with databases
that do have ODBC and do not have JDBC (still I'm trying to figure out how to
access Pervasive 7 from cocoon)

but questions are coming:
1. What about request parameters? Will they be visible in php code?
2. How could I access user session data?
3. What to do if php code generates an error ? I'm almost sure that this would
lead to non well formed xml document
         | /  \ |        Leszek Gawron            //  \\
        \_\\  //_/          _\\()//_
         .'/()\'.     Phone: +48(600)341118     / //  \\ \
          \\  //  recursive: adj; see recursive  | \__/ |

Please check that your question  has not already been answered in the
FAQ before posting.     <>

To unsubscribe, e-mail:     <>
For additional commands, e-mail:   <>

View raw message