PDA

View Full Version : Quercus 4.0.1 is available for download


caucho
08-10-2009, 04:19 PM
You can either use Quercus Project Page or the old Quercus page for the download or directly download with quercus-4.0.1.war and quercus-pro-4.0.1.war.

The
Along with miscellaneous bug fixes, the Quercus 4.0.1 release lets Quercus Pro work with non-Resin application servers and improves compatibility with Google Application Engine.

yvesG
08-10-2009, 09:52 PM
Looking from the source package, there's a lot of classes missing in quercus-4.0.1.war (web.xml, QuercusServlet GoogleQuercusServlet etc).
Consequetly, testing with glassfish (with servlet configured to com.caucho.quercus.servlet.ResinQuercusServlet as foung in resin.jar) results in java.lang.NoClassDefFoundError: com/caucho/quercus/servlet/QuercusServletImpl.
I think the current quercus-4.0.1.war is not the good one
Regards
Yves

PeterJ
08-14-2009, 07:43 PM
Even the 4.0.1 WAR seems to be wrong. Here are its contents:

>jar -tf quercus-4.0.1.war
META-INF/
META-INF/MANIFEST.MF
WEB-INF/
WEB-INF/lib/
WEB-INF/lib/inject-16.jar
WEB-INF/lib/javamail-141.jar
WEB-INF/lib/resin.jar
LICENSE

Where is the quercus.jar file? And the web.xml? Both of those appeared in the 3.2.1 WAR. The resin.jar appears to contain all of Resin.

nam
08-17-2009, 06:43 PM
We fubar'ed the quercus war. We'll have a new one up shortly.

-- Nam

kenfoo
08-22-2009, 05:15 PM
Hi

I found a couple of bugs in the latest version of Quercus (4.0.1)

BUG 1: htmlentities seem to be mixing up multibyte strings. htmlspecialchars seem to be working ok.

BUG 2: file_get_contents fail if I mix up path names with '/' and '\' directory separator. (I'm running on Windows). This works on standard PHP.

kenfoo
08-22-2009, 05:18 PM
BUG 3:

StringBuilderValue.create() is not performing a "& 0xFF" on the character value before using it an an index.
This causes an ArrayIndexOutOfBoundsException.

I can't seem to paste the stacktrace here, as Caucho's vBulletin shows the following error if I did:

[show] java.lang.IllegalStateException: buffer length is not large enough to decode
UTF-8 data

Bozo
08-27-2009, 04:49 AM
nam,

WAR is still fubared 10 days after your reply that it'll be fixed. Can you please ask someone to do something about it?

Thanks,
Bozo

nam
08-27-2009, 08:15 PM
kenfoo


kenfoo, thank for the bug reports

by the way, we have a bugtracker at http://bugs.caucho.com, I think filing bugs there might be easier for the both of us :)

I've filed your bugs for you:

file_get_contents()
http://bugs.caucho.com/view.php?id=3652

htmlentities()
http://bugs.caucho.com/view.php?id=3653

StringBuilderValue
http://bugs.caucho.com/view.php?id=3654

pbelb
09-05-2009, 07:12 PM
any idea when the updated .WAR file will be available?

nam
09-10-2009, 01:29 AM
I've been nagging Scott, who's responsible for uploading the fixed WAR. I'm sure he'll get to it eventually. In the meantime, you can simply replace the bad resin.jar in Quercus-4.0.1.war with the one in Resin-4.0.1.zip.

nam
09-10-2009, 07:08 PM
kenfoo wrote:

BUG 2: file_get_contents fail if I mix up path names with '/' and '\' directory separator. (I'm running on Windows). This works on standard PHP.



Do you have a test case for this? I have been unable to reproduce it. The following works for me:

var_dump(file_get_contents('c:/caucho\test/a.txt'));
var_dump(file_get_contents('c:\caucho\test/a.txt'));

bago
09-11-2009, 07:28 AM
BUG5: "quote" in this forum does not work.


BTW I think I'm blocked by a bug with drupal:


Caused by: com.caucho.quercus.QuercusExecutionException: java.lang.IllegalStateException buffer length is not large enough to decode UTF-8 data
at com.caucho.vfs.StringStream.read(StringStream.java :80)
at com.caucho.vfs.ReadStream.readBuffer(ReadStream.ja va:1122)
at com.caucho.vfs.ReadStream.readChar(ReadStream.java :533)
at com.caucho.quercus.parser.QuercusParser.read(Querc usParser.java:5267)
at com.caucho.quercus.parser.QuercusParser.parsePhpTe xt(QuercusParser.java:4486)
at com.caucho.quercus.parser.QuercusParser.parseToken (QuercusParser.java:4303)
at com.caucho.quercus.parser.QuercusParser.parseState mentList(QuercusParser.java:564)
at com.caucho.quercus.parser.QuercusParser.parseCode( QuercusParser.java:466)
at com.caucho.quercus.parser.QuercusParser.parseEval( QuercusParser.java:349)
at com.caucho.quercus.Quercus.parseCode(Quercus.java: 1103)
at com.caucho.quercus.lib.MiscModule.eval(MiscModule. java:190)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.caucho.quercus.module.StaticFunction.invoke(St aticFunction.java:135)
at com.caucho.quercus.env.JavaInvoker.callMethod(Java Invoker.java:670)
at com.caucho.quercus.env.JavaInvoker.call(JavaInvoke r.java:605)
at com.caucho.quercus.expr.FunctionExpr.evalImpl(Func tionExpr.java:182)
at com.caucho.quercus.expr.FunctionExpr.eval(Function Expr.java:126)
at com.caucho.quercus.env.JavaInvoker.evalArguments(J avaInvoker.java:434)
at com.caucho.quercus.expr.FunctionExpr.evalImpl(Func tionExpr.java:170)
at com.caucho.quercus.expr.FunctionExpr.eval(Function Expr.java:126)
at com.caucho.quercus.statement.ExprStatement.execute (ExprStatement.java:64)
at com.caucho.quercus.statement.BlockStatement.execut e(BlockStatement.java:105)
at com.caucho.quercus.program.Function.callImpl(Funct ion.java:381)
at com.caucho.quercus.program.Function.call(Function. java:310)
at com.caucho.quercus.expr.FunctionExpr.evalImpl(Func tionExpr.java:182)
at com.caucho.quercus.expr.FunctionExpr.eval(Function Expr.java:126)
at com.caucho.quercus.statement.ReturnStatement.execu te(ReturnStatement.java:68)
at com.caucho.quercus.statement.BlockStatement.execut e(BlockStatement.java:105)
at com.caucho.quercus.statement.SwitchStatement.execu te(SwitchStatement.java:99)
at .filter_filter(C:\Lab\VOID\projects\elysium-drupal\modules\filter\filter.module:1018)

bago
09-11-2009, 09:03 AM
About the previous post, maybe the issue is in drupal trying to "eval"uing some text read from db and this text contains UTF-8, but for some reason quercus read it as iso-8859-1.

It's 2 years I'm testing quercus and still I'm having issues with mysql and encoding: I read around any guide about jdbc url parameters, queries to set names/charset, but I'm unable to make it work.

Reading around it seems a common issue.

bago
09-11-2009, 09:05 AM
If you want to reproduce, just try to write a comment here with a non ascii char (take some letter from european vovels) and you'll see the same exception I'm talking about.

nam
10-03-2009, 01:25 AM
The fixed download is up at:

http://caucho.com/download/quercus-4.0.1.war

bago
11-12-2009, 05:02 PM
Is the updated 4.0.1 supposed to fix also the "java.lang.IllegalStateException: buffer length is not large enough to decode UTF-8 data" issue?
I'm just trying my drupal app again and I see the same issue as with the original 4.0.1.

nam
11-19-2009, 02:16 AM
Hi bago,

I'ved submitted a bug report for the drupal utf-8 issue at:

http://bugs.caucho.com/view.php?id=3772

Regarding incorrect utf-8 decodings, we are aware of this issue. We use the jdbc driver and we are pretty much at the mercy of whatever encodings that the driver uses. To solve this problem, we are looking into forking the mysql jdbc driver, or even creating our very own mysql driver just for Quercus.

Takuma Takezawa
01-21-2010, 12:24 PM
This bug will be fixed by under patch. I have tested in japanese language.

diff -cr src.org\com\caucho\vfs\StringStream.java src\com\caucho\vfs\StringStream.java
*** src.org\com\caucho\vfs\StringStream.java Fri Aug 01 09:26:18 2008
--- src\com\caucho\vfs\StringStream.java Thu Jan 21 21:32:28 2010
***************
*** 71,80 ****
buf[offset++] = (byte) (0xc0 | (ch >> 6));
buf[offset++] = (byte) (0x80 | (ch & 0x3f));
}
! else if (ch < 0x8000 && offset + 2 < end) {
buf[offset++] = (byte) (0xe0 | (ch >> 12));
buf[offset++] = (byte) (0x80 | ((ch >> 6) & 0x3f));
! buf[offset++] = (byte) (0x80 | ((ch >> 6) & 0x3f));
}
else if (offset == start) {
throw new IllegalStateException("buffer length is not large enough to decode UTF-8 data");
--- 71,86 ----
buf[offset++] = (byte) (0xc0 | (ch >> 6));
buf[offset++] = (byte) (0x80 | (ch & 0x3f));
}
! else if (ch < 0x10000 && offset + 2 < end) {
buf[offset++] = (byte) (0xe0 | (ch >> 12));
buf[offset++] = (byte) (0x80 | ((ch >> 6) & 0x3f));
! buf[offset++] = (byte) (0x80 | (ch & 0x3f));
! }
! else if (ch < 0x200000 && offset + 3 < end) { // 4bytes
! buf[offset++] = (byte) (0xf0 | (ch >> 18));
! buf[offset++] = (byte) (0x80 | ((ch >> 12) & 0x3f));
! buf[offset++] = (byte) (0x80 | ((ch >> 6) & 0x3f));
! buf[offset++] = (byte) (0x80 | (ch & 0x3f));
}
else if (offset == start) {
throw new IllegalStateException("buffer length is not large enough to decode UTF-8 data");


The StringStream.java of resin4 is in resin-4.0.3\modules\kernel\src\com\caucho\vfs.

dicr
05-11-2011, 10:16 PM
What is the reason for use non-standard mysql driver for Quercus ? Why the mysql connector/J not so good ? Using it in Servlets not showing any problems with encoding. Also, JSP and PHP is the same servlets, but why only servlets, translated by Quercus, can't use standard mysql jdbc driver ???

gillianreynolds
05-19-2011, 11:15 AM
The Quercus WAR is ready to run on Tomcat by placing it inside Tomcat's webapps directory.

The Quercus servlet is just a plain servlet and it is configured in the web.xml.
[edit] web.xml

<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">

<display-name>Quercus on Tomcat</display-name>

<servlet>
<servlet-name>Quercus Servlet</servlet-name>
<servlet-class>com.caucho.quercus.servlet.QuercusServlet</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>Quercus Servlet</servlet-name>
<url-pattern>*.php</url-pattern>
</servlet-mapping>

<welcome-file-list>
<welcome-file>index.php</welcome-file>
</welcome-file-list>

</web-app>

[edit] Compilation

Quercus can compile PHP files down to Java bytecodes for faster performance. However, this feature was only available when Quercus was running inside Resin. Since 4.0.1, this constraint no longer exists and Quercus compilation is now available to all application servers including Tomcat. A valid license is required.
[edit] Configuration

Quercus compilation requires a license. In the web.xml, you will need to specify the directory where the license is located:

<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">

<display-name>Quercus on Tomcat</display-name>

<servlet>
<servlet-name>Quercus Servlet</servlet-name>
<servlet-class>com.caucho.quercus.servlet.QuercusServlet</servlet-class>
<init-param>
<param-name>license-directory</param-name>
<param-value>WEB-INF/licenses</param-value>
</init-param>
</servlet>

<servlet-mapping>
<servlet-name>Quercus Servlet</servlet-name>
<url-pattern>*.php</url-pattern>
</servlet-mapping>

<welcome-file-list>
<welcome-file>index.php</welcome-file>
</welcome-file-list>

</web-app>

nam
03-12-2013, 12:47 AM
The MySQL encoding problem is fixed:

http://forum.caucho.com/showthread.php?p=36255#post36255