Note that there are some explanatory texts on larger screens.

plurals
  1. POQuercus Not Running in Embedded Jetty 6
    primarykey
    data
    text
    <p>I've been attempting to embed Jetty and Quercus in my application for the past few months, but I haven't been successful yet. I'm using Jetty version 6.1.26 and Quercus 4.0.25.</p> <p>I've packaged the following jars with my application's: jetty-6.1.26.jar, jetty-util-6.1.26.jar, and servlet-api-2.5-20081211.jar which I copied from the jetty/lib directory.</p> <p>Here's my code that runs on its own thread:</p> <pre><code>public void run(){ try{ server = new Server(Plugin.port); WebAppContext wac = new WebAppContext(); wac.setWar(Plugin.resourceBase); wac.setDescriptor(Plugin.resourceBase + "WEB-INF/web.xml"); wac.setContextPath("/"); wac.setParentLoaderPriority(true); server.setHandler(wac); server.setStopAtShutdown(true); server.start(); Plugin.instance.getLogger().log(Level.INFO, "Started web server at port " + Plugin.port); }catch(Exception e){ Plugin.instance.getLogger().log(Level.SEVERE, "Cannot start web server at port " + Plugin.port + "!"); Plugin.instance.getLogger().log(Level.SEVERE, e.getMessage()); } } </code></pre> <p>In the resource base directory, I have a WEB-INF folder that contains a web.xml file as well as Quercus' WEB-INF/lib and /licenses. The jars that are in the lib folder are cdi-16.jar, javaee-16.jar, javamail-141.jar, and resin.jar.</p> <p>The web.xml has the following under its web app tags:</p> <pre><code>&lt;servlet&gt; &lt;servlet-name&gt;Quercus Servlet&lt;/servlet-name&gt; &lt;servlet-class&gt;com.caucho.quercus.servlet.QuercusServlet&lt;/servlet-class&gt; &lt;init-param&gt; &lt;param-name&gt;license-directory&lt;/param-name&gt; &lt;param-value&gt;WEB-INF/licenses&lt;/param-value&gt; &lt;/init-param&gt; &lt;/servlet&gt; &lt;servlet-mapping&gt; &lt;servlet-name&gt;Quercus Servlet&lt;/servlet-name&gt; &lt;url-pattern&gt;*.php&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; &lt;welcome-file-list&gt; &lt;welcome-file&gt;index.php&lt;/welcome-file&gt; &lt;/welcome-file-list&gt; </code></pre> <p>When I start the program, I get this message in the console:</p> <p>10:31:46 [SEVERE] 2013-03-03 10:31:46.570:INFO:/:Unavailable javax.servlet.UnavailableException: Servlet class com.caucho.quercus.servlet.QuercusServlet is not a javax.servlet.Servlet</p> <p>I can then access HTML files on the Jetty server, but when I try to access PHP ones, I get a message saying</p> <pre><code>javax.servlet.UnavailableException: Servlet class com.caucho.quercus.servlet.QuercusServlet is not a javax.servlet.Servlet at org.mortbay.jetty.servlet.ServletHolder.checkServletType(ServletHolder.java:362) at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:243) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:736) at org.mortbay.jetty.servlet.Context.startContext(Context.java:140) at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1282) at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:518) at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:499) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130) at org.mortbay.jetty.Server.doStart(Server.java:224) at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) at me.jsn_man.WebServer.WebServer.run(WebServer.java:52) </code></pre> <p>If anyone can offer help that would be much appreciated.</p> <p>Also, if you have suggestions of what versions of Jetty and Quercus I should be using, that would also be helpful. I'm only using Jetty 6 because that's the version which had the most documentation about embedding.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload