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 Arnaud Garcia <ar...@gmail.com> on 2010/03/29 14:50:04 UTC
Getting solr response in HTML format : HTMLResponseWriter
Hello everybody
I m using NUTCH with SOLR and the result of solr searching as you know is in
XML format .
Because I want an HTML format for the response (like the result of NUTCH
searching result)
so I have tried to attach the xslt steelsheet to the response of SOLR with
passing this 2 variables wt=xslt&tr=example.xsl
while example.xsl is an included steelsheet to SOLR , but the response in
HTML was'nt very perfect .
So i have readen on the net that we can write an extension to the
QueryResponseWriter class like XMLResponseWriter (default)
and i m trying to build that .
I m proceeding like XMLREsponseWriter to create HTMLResponseWriter and i
have added this line <queryResponseWriter name="html"
class="org.apache.solr.
request.HTMLResponseWriter" /> in solr-config.xml
I have an error like this :
org.apache.solr.common.SolrException: Error loading class
'org.apache.solr.request.HTMLResponseWriter'
at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:373)
at org.apache.solr.core.SolrCore.createInstance(SolrCore.java:413)
at org.apache.solr.core.SolrCore.createInitInstance(SolrCore.java:435)
at org.apache.solr.core.SolrCore.initPlugins(SolrCore.java:1498)
at org.apache.solr.core.SolrCore.initPlugins(SolrCore.java:1492)
at org.apache.solr.core.SolrCore.initPlugins(SolrCore.java:1525)
at org.apache.solr.core.SolrCore.initWriters(SolrCore.java:1408)
at org.apache.solr.core.SolrCore.<init>(SolrCore.java:547)
at org.apache.solr.core.CoreContainer$Initializer.initialize(CoreContainer.java:137)
at org.apache.solr.servlet.SolrDispatchFilter.init(SolrDispatchFilter.java:83)
at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:99)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:594)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:139)
at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1218)
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:500)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:147)
at org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:161)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:147)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117)
at org.mortbay.jetty.Server.doStart(Server.java:210)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
at org.mortbay.xml.XmlConfiguration.main(XmlConfiguration.java:929)
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:597)
at org.mortbay.start.Main.invokeMain(Main.java:183)
at org.mortbay.start.Main.start(Main.java:497)
at org.mortbay.start.Main.main(Main.java:115)
Caused by: java.lang.ClassNotFoundException:
org.apache.solr.request.HTMLResponseWriter
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:627)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:357)
... 33 more
It appears that the compiler doesn't found the class HTMLResponseWriter
Does anyone know where additionnals information about the class
HTMLResponseWriter must be added to remove this error ????????????????
thanks for all
Re: Getting solr response in HTML format : HTMLResponseWriter
Posted by Chris Hostetter <ho...@fucit.org>.
: so I have tried to attach the xslt steelsheet to the response of SOLR with
: passing this 2 variables wt=xslt&tr=example.xsl
:
: while example.xsl is an included steelsheet to SOLR , but the response in
: HTML was'nt very perfect .
can you elaborate on what you mean by "wasn't very perfect" ? ... what was
wrong with it? ... was there an actaul bug, or were you just not happy
with how it looked? did you try modifying the exampl.xsl? (it's intended
purely as an example ... it's not ment to work for everyone as is)
: So i have readen on the net that we can write an extension to the
: QueryResponseWriter class like XMLResponseWriter (default)
: and i m trying to build that .
...
: I m proceeding like XMLREsponseWriter to create HTMLResponseWriter and i
I would strongly suggest that instead of doing this, you take a look at
the velocity response writer (in contrib) or tweet teh XSL some more ...
writing a custom HTMLResponseWriter isn't neraly as flexible as either of
those other two options -- particularly because the ResponseWriter API
requires you to deal with the Response objects in the order they are added
by the RequestHandler -- which isn't neccessarily the same order you want
to deal with them in an HTML response. (this isn't typically a problem
for most ResponseWriters because htey aren't typically intended to be read
by humans)
: org.apache.solr.common.SolrException: Error loading class
: 'org.apache.solr.request.HTMLResponseWriter'
1) if you are writing a custom ResponseWriter, you should be using your
own java package name, not "org.apache.solr.request"
: Caused by: java.lang.ClassNotFoundException:
: org.apache.solr.request.HTMLResponseWriter
2) it can't find your class. did you compile it? did you put it i na
jar? where did you put the jar? what does your solr install look like?
... the details are the key to understanding why it can't find your class.
-Hoss
Re: Getting solr response in HTML format : HTMLResponseWriter
Posted by Arnaud Garcia <ar...@gmail.com>.
2010/3/29 Arnaud Garcia <ar...@gmail.com>
> Hello everybody
>
> I m using NUTCH with SOLR and the result of solr searching as you know is
> in XML format .
>
>
> Because I want an HTML format for the response (like the result of NUTCH
> searching result)
>
> so I have tried to attach the xslt steelsheet to the response of SOLR with
> passing this 2 variables wt=xslt&tr=example.xsl
>
> while example.xsl is an included steelsheet to SOLR , but the response in
> HTML was'nt very perfect .
>
> So i have readen on the net that we can write an extension to the
> QueryResponseWriter class like XMLResponseWriter (default)
> and i m trying to build that .
>
> I m proceeding like XMLREsponseWriter to create HTMLResponseWriter and i
> have added this line <queryResponseWriter name="html"
> class="org.apache.solr.
> request.HTMLResponseWriter" /> in solr-config.xml
>
> I have an error like this :
>
> org.apache.solr.common.SolrException: Error loading class 'org.apache.solr.request.HTMLResponseWriter'
> at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:373)
>
> at org.apache.solr.core.SolrCore.createInstance(SolrCore.java:413)
> at org.apache.solr.core.SolrCore.createInitInstance(SolrCore.java:435)
> at org.apache.solr.core.SolrCore.initPlugins(SolrCore.java:1498)
> at org.apache.solr.core.SolrCore.initPlugins(SolrCore.java:1492)
>
> at org.apache.solr.core.SolrCore.initPlugins(SolrCore.java:1525)
> at org.apache.solr.core.SolrCore.initWriters(SolrCore.java:1408)
> at org.apache.solr.core.SolrCore.<init>(SolrCore.java:547)
> at org.apache.solr.core.CoreContainer$Initializer.initialize(CoreContainer.java:137)
>
> at org.apache.solr.servlet.SolrDispatchFilter.init(SolrDispatchFilter.java:83)
> at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:99)
> at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
>
> at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:594)
> at org.mortbay.jetty.servlet.Context.startContext(Context.java:139)
> at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1218)
>
> at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:500)
> at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448)
> at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
>
> at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:147)
> at org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:161)
> at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
>
> at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:147)
> at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
> at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117)
>
> at org.mortbay.jetty.Server.doStart(Server.java:210)
> at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
> at org.mortbay.xml.XmlConfiguration.main(XmlConfiguration.java:929)
> 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:597)
>
> at org.mortbay.start.Main.invokeMain(Main.java:183)
> at org.mortbay.start.Main.start(Main.java:497)
> at org.mortbay.start.Main.main(Main.java:115)
> Caused by: java.lang.ClassNotFoundException: org.apache.solr.request.HTMLResponseWriter
>
> at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
>
> at java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:627)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Class.java:247)
>
> at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:357)
> ... 33 more
>
> It appears that the compiler doesn't found the class HTMLResponseWriter
>
> Does anyone know where additionnals information about the class
> HTMLResponseWriter must be added to remove this error ????????????????
>
>
> thanks for all
>
>