View Full Version : Quercus 3.2.1, 4.0, 4.0.1 problems with Jetty

10-29-2009, 09:41 PM
Hi all,

New to the forum. I am trying to get quercus to run in jetty 7. The only examples I find show one of two ways to do this. Either I drop the quercus war file into webapps, and then I am to add php files to the expanded quercus web app... or I copy the contents of the quercos.war/WEB-INF/lib into the jetty/lib location. Either way, trying to access the localhost:8080/quercos throws a nice exception in the server console, or when I try to access a php page in my own web app that I deploy and use the approach of putting the quercos lib files into the jetty/lib location, I get exception saying the QuercosServlet can't be found. I also tried putting the quercos/WEB-INF/lib files into my own WAR/WEB-INF/lib files, and when I start jetty, it gives the same exception. Without displaying the full exception stack trace its:

com.caucho.quercus.QuercusRuntimeException: java.lang.ClassNotFoundException: 'org.eclipse.jetty.server.AsyncContext' is not a known Java class: java.lang.ClassNotFoundException: org.eclipse.jetty.server.AsyncContext

I am lost as to how to make use of PHP pages in my own web app while using quercos. I originally thought I could put the quercos.war file into the jetty/webapps folder, deploy my own app and somehow it would magically work.. of course knowing that webapps are separate contexts, I was unclear what magic was done to make my app see the quercos app and work. lol.

I also want to get this working in glassfish v3 and tomcat 5 and/or 6. Is there a "general" way regardless of app server to deploy quercos, be it as part of my own web app in the web-inf/lib location, OR by putting the necessary files in the tomcat/jetty/glassfish global lib path so it can find quercos? Do I need to configure a file other than the web.xml for my web-app to make it work?

Thank you.

10-30-2009, 12:51 AM
It should work either way, by dropping in the war or adding the jars. We have tested Quercus on Tomcat and it works, but we haven't tested it on Jetty. Can you post the full exception stack trace? That'll help me to track down the issue.

10-30-2009, 02:13 AM
Nevermind, got it. I've filed a bug report at:


10-30-2009, 06:58 AM
Yup..that's the one.

I also noticed something else strange. If I hit refresh a couple times, usually the 3rd time I was suddenly seeing the page show up. Even when I put just quercus.war and tried the localhost:8080/quercus, I'd see the stack trace show up in the web page, hit refresh, same thing, hit it again, and then it would be the php page that said something like "Your PHP is working". I don't know why it would do this. Not sure you tried that out, but thought I'd let you know that this happened. Hope this helps in some way.

10-30-2009, 07:01 AM
Incidentally, are you saying that if I drop the quercus.war, which deploys as a separate app, and then drop my own .war in, I don't need to do any other setup to have php pages in my war work? If so, in this particular case, how does the quercus servlet in the quercus.war get set up to process php pages from other .war files? I thought each .war was it's own secure web application. Even if the web.xml in quercus.war indicates *.php to go to the quercus servlet, I thought that rule would apply only to anything within the context path of quercus?

10-30-2009, 06:46 PM
wars are indeed independent. To use Quercus in your war, you will need to either package its jars into your war or place them in your jetty/lib folder. And you will need to add the Quercus servlet to your WEB-INF/web.xml:

<servlet-name>Quercus Servlet</servlet-name>

<servlet-name>Quercus Servlet</servlet-name>

10-30-2009, 07:39 PM
We've fixed this for 4.0.2. The problem was that Jetty hides server classes from the webapp and Quercus couldn't introspect the HttpServletRequest object.

11-02-2009, 09:08 AM
Hi, currently I have a app running on Quercus libs that never gave this problems before. I use both Jetty and Tomcat and I used all those versions (except 4.0.2 - when is release?).

We are running drupal 6.13 + 6.14 with all kinds of modules successfully and at full speed,.. question me when you have any problems. We also run the drupal script from within a java application to do login, get data, loadNodes etc.

I use the maven repo to build my projects.

Best regards,

11-03-2009, 04:49 PM
I think the problem only occurs with Jetty version 7.

11-04-2009, 03:13 PM
I can confirm that, .. jetty6 runs perfectly (apart from the classloader leak, permgen space error when using redeploy) .. see http://blogs.sun.com/fkieviet/entry/classloader_leaks_the_dreaded_java


11-04-2009, 06:19 PM
Interesting link for the redeploy problem. I think we only need to add a ServletContextListener that responds accordingly to a redeploy/shutdown.

I've filed a bug report for this at: