You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by harrysmith <ha...@gmail.com> on 2010/08/13 04:32:34 UTC

DataImportHandler and SAXParseExceptions with Jetty

Win XP, Solr 1.4.1 out of the box install, using jetty. If I add greater than
or less than (ie < or >) in any xml field and attempt to load or run from
the DataImportConsole I receive a SAXParseException. Example follows:

If I don't have a 'less than' it works just fine. I know this must work,
because the examples given on the wiki show deltaQueries using a greater
than/less than compare.


Relevant snippet from data-config.xml :

<entity name="item" query="select * from project_items where rownum < 500">

Stack trace received:
org.apache.solr.common.SolrException: FATAL: Could not create importer.
DataImporter config invalid
	at
org.apache.solr.handler.dataimport.DataImportHandler.inform(DataImportHandler.java:121)
	at
org.apache.solr.handler.dataimport.DataImportHandler.handleRequestBody(DataImportHandler.java:222)
	at
org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131)
	at org.apache.solr.core.SolrCore.execute(SolrCore.java:1316)
	at
org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:338)
	at
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:241)
	at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1089)
	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365)
	at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
	at
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:211)
	at
org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
	at org.mortbay.jetty.Server.handle(Server.java:285)
	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:502)
	at
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:821)
	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:513)
	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:208)
	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:378)
	at
org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:226)
	at
org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442)
Caused by: org.apache.solr.handler.dataimport.DataImportHandlerException:
Exception occurred while initializing context
	at
org.apache.solr.handler.dataimport.DataImporter.loadDataConfig(DataImporter.java:190)
	at
org.apache.solr.handler.dataimport.DataImporter.<init>(DataImporter.java:101)
	at
org.apache.solr.handler.dataimport.DataImportHandler.inform(DataImportHandler.java:113)
	... 22 more
Caused by: org.xml.sax.SAXParseException: The value of attribute "query"
associated with an element type "null" must not contain the '<' character.
	at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown
Source)
	at
com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown
Source)
	at
org.apache.solr.handler.dataimport.DataImporter.loadDataConfig(DataImporter.java:178)
	... 24 more

-- 
View this message in context: http://lucene.472066.n3.nabble.com/DataImportHandler-and-SAXParseExceptions-with-Jetty-tp1125898p1125898.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: DataImportHandler and SAXParseExceptions with Jetty

Posted by Chris Hostetter <ho...@fucit.org>.
: > page.  Use &lt; instead of <.  When I first ran into this, I was 
: > surprised that &rt; was not required as well, but it's probably a good 
: > idea to use it, just in case things tighten up in the future.
: > 
: 
: Thanks, confirming this worked using '&amp;lt'; instead of <. It would help
: to note this in the wiki as I found it confusing the dataQuery examples used
: '<'.

relying on the laxness of some XML parsers in the examples is just a plain 
bad idea ... i've fixed the wiki page to only use properly XML escaped ">" 
anywhere i noticed it ... if anyone notices some i missed by all means 
please fix them.



-Hoss


Re: DataImportHandler and SAXParseExceptions with Jetty

Posted by harrysmith <ha...@gmail.com>.

Shawn Heisey-4 wrote:
> 
> Because < and > are critical characters in XML, you have to encode them 
> to actually use them as part of your config, just as you do on an HTML 
> page.  Use &lt; instead of <.  When I first ran into this, I was 
> surprised that &rt; was not required as well, but it's probably a good 
> idea to use it, just in case things tighten up in the future.
> 

Thanks, confirming this worked using '&amp;lt'; instead of <. It would help
to note this in the wiki as I found it confusing the dataQuery examples used
'<'.

-- 
View this message in context: http://lucene.472066.n3.nabble.com/DataImportHandler-and-SAXParseExceptions-with-Jetty-tp1125898p1136004.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: DataImportHandler and SAXParseExceptions with Jetty

Posted by Shawn Heisey <so...@elyograg.org>.
  On 8/12/2010 8:32 PM, harrysmith wrote:
> Win XP, Solr 1.4.1 out of the box install, using jetty. If I add greater than
> or less than (ie<  or>) in any xml field and attempt to load or run from
> the DataImportConsole I receive a SAXParseException. Example follows:
>
> If I don't have a 'less than' it works just fine. I know this must work,
> because the examples given on the wiki show deltaQueries using a greater
> than/less than compare.
>
Because < and > are critical characters in XML, you have to encode them 
to actually use them as part of your config, just as you do on an HTML 
page.  Use &lt; instead of <.  When I first ran into this, I was 
surprised that &rt; was not required as well, but it's probably a good 
idea to use it, just in case things tighten up in the future.