Jetty downgrade

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Jetty downgrade

Erik Hatcher
I had trouble returning a field from Solr (as detailed in a previous  
e-mail) using the built-in Jetty.  It worked fine with Tomcat, and I  
just tried it with Jetty 5.1.11RC0 and it works as well.  It seems  
the Jetty version in Solr's repository is an "unstable" version that  
has some type of response rendering bug (with use of NIO?) but that  
the latest "stable" release works fine.

Are there reasons we need to have an unstable version of Jetty built  
into the example app?  Or would it be ok to switch to 5.1.11RC0?

In making the downgrade of Jetty, I encountered a web.xml issue and  
got this exception with the default web.xml:

09:50:08.053 WARN!! [main]  
org.mortbay.jetty.servlet.WebApplicationContext.doStart
(WebApplicationContext.java:519) >12> Configuration error on file:/
Users/erik/jetty-5.1.11RC0/webapps/solr/
org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration  
of element 'web-app'.
         at  
org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException
(Unknown Source)
         at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown  
Source)
         at org.apache.xerces.impl.XMLErrorReporter.reportError
(Unknown Source)
         at org.apache.xerces.impl.XMLErrorReporter.reportError
(Unknown Source)
         at  
org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement
(Unknown Source)
         at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement
(Unknown Source)
         at  
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement
(Unknown Source)
         at org.apache.xerces.impl.XMLNSDocumentScannerImpl
$NSContentDispatcher.scanRootElementHook(Unknown Source)
         at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl
$FragmentContentDispatcher.dispatch(Unknown Source)
         at  
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument
(Unknown Source)
         at org.apache.xerces.parsers.XML11Configuration.parse
(Unknown Source)
         at org.apache.xerces.parsers.XML11Configuration.parse
(Unknown Source)
         at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
         at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown  
Source)
         at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
         at org.mortbay.xml.XmlParser.parse(XmlParser.java:217)
         at org.mortbay.xml.XmlParser.parse(XmlParser.java:235)
         at org.mortbay.jetty.servlet.XMLConfiguration.configureWebApp
(XMLConfiguration.java:190)
         at  
org.mortbay.jetty.servlet.WebApplicationContext.configureWebApp
(WebApplicationContext.java:425)
         at org.mortbay.jetty.servlet.WebApplicationContext.doStart
(WebApplicationContext.java:478)
         at org.mortbay.util.Container.start(Container.java:72)
         at org.mortbay.http.HttpServer.doStart(HttpServer.java:708)
         at org.mortbay.util.Container.start(Container.java:72)
         at org.mortbay.jetty.Server.main(Server.java:460)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.mortbay.start.Main.invokeMain(Main.java:151)
         at org.mortbay.start.Main.start(Main.java:476)
         at org.mortbay.start.Main.main(Main.java:94)

I modified web.xml to the following and all worked just fine.

<?xml version="1.0" encoding="UTF-8"?>
   <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://
java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
    version="2.4">

   <servlet>
     <servlet-name>SolrServer</servlet-name>
     <servlet-class>org.apache.solr.servlet.SolrServlet</servlet-class>
     <load-on-startup>0</load-on-startup>
   </servlet>

   <servlet>
     <servlet-name>SolrUpdate</servlet-name>
     <servlet-class>org.apache.solr.servlet.SolrUpdateServlet</
servlet-class>
     <load-on-startup>1</load-on-startup>
   </servlet>

   <servlet-mapping>
     <servlet-name>SolrServer</servlet-name>
     <url-pattern>/select/*</url-pattern>
   </servlet-mapping>

   <servlet-mapping>
     <servlet-name>SolrUpdate</servlet-name>
     <url-pattern>/update/*</url-pattern>
   </servlet-mapping>

   <servlet>
     <servlet-name>ping</servlet-name>
     <jsp-file>/admin/ping.jsp</jsp-file>
   </servlet>
   <servlet-mapping>
     <servlet-name>ping</servlet-name>
     <url-pattern>/admin/ping</url-pattern>
   </servlet-mapping>

</web-app>

I'd be happy to work on fixing the example to use this version of  
Jetty and update web.xml.  Any objections?

        Erik

Reply | Threaded
Open this post in threaded view
|

Re: Jetty downgrade

Bill Au
+1 my personal preference is always to use the stable/production version.

Bill

On 4/24/06, Erik Hatcher <[hidden email]> wrote:

>
> I had trouble returning a field from Solr (as detailed in a previous
> e-mail) using the built-in Jetty.  It worked fine with Tomcat, and I
> just tried it with Jetty 5.1.11RC0 and it works as well.  It seems
> the Jetty version in Solr's repository is an "unstable" version that
> has some type of response rendering bug (with use of NIO?) but that
> the latest "stable" release works fine.
>
> Are there reasons we need to have an unstable version of Jetty built
> into the example app?  Or would it be ok to switch to 5.1.11RC0?
>
> In making the downgrade of Jetty, I encountered a web.xml issue and
> got this exception with the default web.xml:
>
> 09:50:08.053 WARN!! [main]
> org.mortbay.jetty.servlet.WebApplicationContext.doStart
> (WebApplicationContext.java:519) >12> Configuration error on file:/
> Users/erik/jetty-5.1.11RC0/webapps/solr/
> org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration
> of element 'web-app'.
>          at
> org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException
> (Unknown Source)
>          at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown
> Source)
>          at org.apache.xerces.impl.XMLErrorReporter.reportError
> (Unknown Source)
>          at org.apache.xerces.impl.XMLErrorReporter.reportError
> (Unknown Source)
>          at
> org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement
> (Unknown Source)
>          at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement
> (Unknown Source)
>          at
> org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement
> (Unknown Source)
>          at org.apache.xerces.impl.XMLNSDocumentScannerImpl
> $NSContentDispatcher.scanRootElementHook(Unknown Source)
>          at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl
> $FragmentContentDispatcher.dispatch(Unknown Source)
>          at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument
> (Unknown Source)
>          at org.apache.xerces.parsers.XML11Configuration.parse
> (Unknown Source)
>          at org.apache.xerces.parsers.XML11Configuration.parse
> (Unknown Source)
>          at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
>          at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
> Source)
>          at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
>          at org.mortbay.xml.XmlParser.parse(XmlParser.java:217)
>          at org.mortbay.xml.XmlParser.parse(XmlParser.java:235)
>          at org.mortbay.jetty.servlet.XMLConfiguration.configureWebApp
> (XMLConfiguration.java:190)
>          at
> org.mortbay.jetty.servlet.WebApplicationContext.configureWebApp
> (WebApplicationContext.java:425)
>          at org.mortbay.jetty.servlet.WebApplicationContext.doStart
> (WebApplicationContext.java:478)
>          at org.mortbay.util.Container.start(Container.java:72)
>          at org.mortbay.http.HttpServer.doStart(HttpServer.java:708)
>          at org.mortbay.util.Container.start(Container.java:72)
>          at org.mortbay.jetty.Server.main(Server.java:460)
>          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>          at sun.reflect.NativeMethodAccessorImpl.invoke
> (NativeMethodAccessorImpl.java:39)
>          at sun.reflect.DelegatingMethodAccessorImpl.invoke
> (DelegatingMethodAccessorImpl.java:25)
>          at java.lang.reflect.Method.invoke(Method.java:585)
>          at org.mortbay.start.Main.invokeMain(Main.java:151)
>          at org.mortbay.start.Main.start(Main.java:476)
>          at org.mortbay.start.Main.main(Main.java:94)
>
> I modified web.xml to the following and all worked just fine.
>
> <?xml version="1.0" encoding="UTF-8"?>
>    <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>     xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://
> java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
>     version="2.4">
>
>    <servlet>
>      <servlet-name>SolrServer</servlet-name>
>      <servlet-class>org.apache.solr.servlet.SolrServlet</servlet-class>
>      <load-on-startup>0</load-on-startup>
>    </servlet>
>
>    <servlet>
>      <servlet-name>SolrUpdate</servlet-name>
>      <servlet-class>org.apache.solr.servlet.SolrUpdateServlet</
> servlet-class>
>      <load-on-startup>1</load-on-startup>
>    </servlet>
>
>    <servlet-mapping>
>      <servlet-name>SolrServer</servlet-name>
>      <url-pattern>/select/*</url-pattern>
>    </servlet-mapping>
>
>    <servlet-mapping>
>      <servlet-name>SolrUpdate</servlet-name>
>      <url-pattern>/update/*</url-pattern>
>    </servlet-mapping>
>
>    <servlet>
>      <servlet-name>ping</servlet-name>
>      <jsp-file>/admin/ping.jsp</jsp-file>
>    </servlet>
>    <servlet-mapping>
>      <servlet-name>ping</servlet-name>
>      <url-pattern>/admin/ping</url-pattern>
>    </servlet-mapping>
>
> </web-app>
>
> I'd be happy to work on fixing the example to use this version of
> Jetty and update web.xml.  Any objections?
>
>         Erik
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Jetty downgrade

Yonik Seeley
In reply to this post by Erik Hatcher
I'm OK with a downgrade... there wasn't any particular reason to go
with Jetty6 other than it was the latest-and-greatest.
There is still the tomcat vs jetty issue though:

http://www.nabble.com/tutorial-or-demo-download-t1121522.html#a2933223

It does seem like the first thing many people try to do is get Solr
running with Tomcat.  Perhaps that's another reason for the example to
be Tomcat based?

-Yonik

On 4/24/06, Erik Hatcher <[hidden email]> wrote:
> I had trouble returning a field from Solr (as detailed in a previous
> e-mail) using the built-in Jetty.  It worked fine with Tomcat, and I
> just tried it with Jetty 5.1.11RC0 and it works as well.  It seems
> the Jetty version in Solr's repository is an "unstable" version that
> has some type of response rendering bug (with use of NIO?) but that
> the latest "stable" release works fine.
>
> Are there reasons we need to have an unstable version of Jetty built
> into the example app?  Or would it be ok to switch to 5.1.11RC0?
Reply | Threaded
Open this post in threaded view
|

Re: Jetty downgrade

Erik Hatcher
I'm on the Jetty side of the fence when it comes to the Tomcat debate  
personally.  Jetty has always been very fast and running "java -jar  
start.jar" is so much more pleasant than I've experienced with  
Tomcat.  If someone wants to push Tomcat in so that it can be run in  
a similarly fast and lightweight way then I'm +1 for sure.  Quite  
likely my experience with Tomcat is outdated and it could be done  
much like Jetty.

        Erik


On Apr 24, 2006, at 12:15 PM, Yonik Seeley wrote:

> I'm OK with a downgrade... there wasn't any particular reason to go
> with Jetty6 other than it was the latest-and-greatest.
> There is still the tomcat vs jetty issue though:
>
> http://www.nabble.com/tutorial-or-demo-download-t1121522.html#a2933223
>
> It does seem like the first thing many people try to do is get Solr
> running with Tomcat.  Perhaps that's another reason for the example to
> be Tomcat based?
>
> -Yonik
>
> On 4/24/06, Erik Hatcher <[hidden email]> wrote:
>> I had trouble returning a field from Solr (as detailed in a previous
>> e-mail) using the built-in Jetty.  It worked fine with Tomcat, and I
>> just tried it with Jetty 5.1.11RC0 and it works as well.  It seems
>> the Jetty version in Solr's repository is an "unstable" version that
>> has some type of response rendering bug (with use of NIO?) but that
>> the latest "stable" release works fine.
>>
>> Are there reasons we need to have an unstable version of Jetty built
>> into the example app?  Or would it be ok to switch to 5.1.11RC0?