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 Aleksander Akerø <al...@gurusoft.no> on 2011/12/29 14:40:48 UTC

3.5 QueryResponseWriter

Hi!

So I've decided try out Solr 3.5.0.

What I have done this far is basicly just to copy the /example/solr 
folder, install the webapp .war file in a tomcat instance and start up.

At first I complained about the VelocityResponseWriter, so i created a 
/lib folder in /$SOLR_HOME and added the velocity jar from dist. That 
seemed to take care of the VRW error.

But now I get an "NoClassDefFoundError" wich sais something about 
QueryResponseWriter. So I guess I'm missing this one too then? But I 
have a feeling that this should be a part of the solr core jar?

Maybe someone could explain this for me?

-- 
Aleksander Akerø
Systemutvikler
Mobil: 944 89 054

Gurusoft AS
Telefon: 92 44 09 99
Østre Kullerød 5, 3241 Sandefjord
www.gurusoft.no


Re: 3.5 QueryResponseWriter

Posted by Chris Hostetter <ho...@fucit.org>.
: Well, what I did was to create a lib directory within $SOLR_HOME (
: $SOLR_HOME/lib ), and that is where I put the VRM  jar found in the dist
: folder. Then what I did to the solrconfig was basicly to uncomment all of the
: <lib > statements and use <lib dir="../lib" />. The solrconfig is placed as
: normal in $SOLR_HOME/conf. Is it wrong to do so?

Hmmm... that may be the cause of the problem -- you don't need to do both.  
either add a <lib/> directive pointed at where you put VRW *OR* put it in 
$SOLR_HOME/lib ... don't do both (that may confuse your JVM classloader 
... i'd have to sit down and really think through what's happening there)

: To me this "QueryResponseWriter" thing doesn't necessarily have anything to do
: with VRM. Are all of the libraries from the /dist and contrib folder necessary

it has everything to do with VRW .. VelocityResponseWriter is a subclass 
of QueryResponseWriter, when VRW is 
loaded the JVM will attempt to rectify it's entire java class 
inheritence tree, using the classloader that VRW was loaded with, which 
then delegates up the tree of classloaders (looking at other specified 
lib dirs, and the solr.war, and the container classloader, and the 
bootloader, etc...).  if the classpath is "wonky" (ie: VRW exists in 
two places for example) then you can get errors like this even if class 
loader X has already loaded a base class (like QRW) if it's not consulted 
in the delegation.

: for startup? Because my routine in setting up solr is to only copy the /solr
: folder from /example and into my tomcat environment. So everything "above" the

well, for starters, you should not copy "example/solr" "into my tomcat 
environment" .. the only thing that needs copied into tomcat is the 
solr.war (either by putting it in the webapps directory, or by pointing to 
it fro ma context file) and then solr.war is the only thing that needs to 
know about (your copy of) the example/solr directory (either using a 
system property or jndi).  But as i said: classpaths are a pain in the 
ass, if you actually *copy* example/solr somewhere in your tomcat 
installation dir, it's *possible* that you have done so in a way that 
tomcat is finding things like the VRW jar in a "higher" classpath before 
it ever even loads the solr.war and the QRW base class.

: /solr folder does not exist. When I want to use additional features i mainly
: copy the needed jar files into $SOLR_HOME/lib as explained above. So this

that should work fine ... as long as:

  a) you aren't telling solr load the same jars more then once (see above 
about not needing <lib/> if you use $SOLR_HOME/lib) ... you can check if 
that's happening by looking at your log messages on solr startup and see 
if there are duplicates in the list of jars solr says it's adding ot hte 
classpath

  b) tomcat isn't already loading these jars ... this is harder to 
recognize, but the safe way to do it is to keep all of these jars the hell 
away from tomcat.


-Hoss

Re: 3.5 QueryResponseWriter

Posted by Aleksander Akerø <so...@gmail.com>.
Den 30.12.2011 06:03, skrev Chris Hostetter:
> : Looks like you've experienced the issue described with fixes here:
> :<http://www.lucidimagination.com/search/document/48b9e75fe68be4b7>
>
> but specifically, since you've already copied the jar file in question,
> and are now getting a class not found for the *baseclass* it suggests you
> have a diff problem....
>
> :>  What I have done this far is basicly just to copy the /example/solr
> : folder, install the webapp .war file in a tomcat instance and start up.
> :>  >  At first I complained about the VelocityResponseWriter, so i created
> : a /lib folder in /$SOLR_HOME and added the velocity jar from dist. That
> : seemed to take care of the VRW error.>  >  But now I get an
> : "NoClassDefFoundError" wich sais something about QueryResponseWriter. So
>
> ...that suggests that it is loading VRW at a higher (or lower depending on
> how you look at it) classloader then where it loads the rest of the solr
> jars.
>
> if you are using the example solr setup, then it sounds like you copied
> the jar to "example/lib" (which is where the jetty jars live) instead of
> "example/solr/lib" (which would be a new lib folder in the $SOLR_HOME dir.
>
> unfortunately, people frequently get these confused, which is one of the
> reasons i have started encouraging people to just use the<lib />
> declarations in their solrconfig.xml file instead of making a single "lib"
> dir in $SOLR_HOME.  (but either way, you'll need to remove the copy of the
> VRW jar you've got loading in the system classpath before either approach
> will work)
>
>
>
> -Hoss
>
Well, what I did was to create a lib directory within $SOLR_HOME ( 
$SOLR_HOME/lib ), and that is where I put the VRM  jar found in the dist 
folder. Then what I did to the solrconfig was basicly to uncomment all 
of the <lib > statements and use <lib dir="../lib" />. The solrconfig is 
placed as normal in $SOLR_HOME/conf. Is it wrong to do so?

To me this "QueryResponseWriter" thing doesn't necessarily have anything 
to do with VRM. Are all of the libraries from the /dist and contrib 
folder necessary for startup? Because my routine in setting up solr is 
to only copy the /solr folder from /example and into my tomcat 
environment. So everything "above" the /solr folder does not exist. When 
I want to use additional features i mainly copy the needed jar files 
into $SOLR_HOME/lib as explained above. So this jetty lib folder you are 
talking about, does not exist for me.

Re: 3.5 QueryResponseWriter

Posted by Chris Hostetter <ho...@fucit.org>.
: Looks like you've experienced the issue described with fixes here: 
: <http://www.lucidimagination.com/search/document/48b9e75fe68be4b7>

but specifically, since you've already copied the jar file in question, 
and are now getting a class not found for the *baseclass* it suggests you 
have a diff problem....

: > What I have done this far is basicly just to copy the /example/solr 
: folder, install the webapp .war file in a tomcat instance and start up. 
: > > At first I complained about the VelocityResponseWriter, so i created 
: a /lib folder in /$SOLR_HOME and added the velocity jar from dist. That 
: seemed to take care of the VRW error. > > But now I get an 
: "NoClassDefFoundError" wich sais something about QueryResponseWriter. So 

...that suggests that it is loading VRW at a higher (or lower depending on 
how you look at it) classloader then where it loads the rest of the solr 
jars.

if you are using the example solr setup, then it sounds like you copied 
the jar to "example/lib" (which is where the jetty jars live) instead of 
"example/solr/lib" (which would be a new lib folder in the $SOLR_HOME dir.

unfortunately, people frequently get these confused, which is one of the 
reasons i have started encouraging people to just use the <lib /> 
declarations in their solrconfig.xml file instead of making a single "lib" 
dir in $SOLR_HOME.  (but either way, you'll need to remove the copy of the 
VRW jar you've got loading in the system classpath before either approach 
will work)



-Hoss

Re: 3.5 QueryResponseWriter

Posted by Erik Hatcher <er...@gmail.com>.
Aleksander -

Looks like you've experienced the issue described with fixes here: <http://www.lucidimagination.com/search/document/48b9e75fe68be4b7>

	Erik

On Dec 29, 2011, at 08:40 , Aleksander Akerø wrote:

> Hi!
> 
> So I've decided try out Solr 3.5.0.
> 
> What I have done this far is basicly just to copy the /example/solr folder, install the webapp .war file in a tomcat instance and start up.
> 
> At first I complained about the VelocityResponseWriter, so i created a /lib folder in /$SOLR_HOME and added the velocity jar from dist. That seemed to take care of the VRW error.
> 
> But now I get an "NoClassDefFoundError" wich sais something about QueryResponseWriter. So I guess I'm missing this one too then? But I have a feeling that this should be a part of the solr core jar?
> 
> Maybe someone could explain this for me?
> 
> -- 
> Aleksander Akerø
> Systemutvikler
> Mobil: 944 89 054
> 
> Gurusoft AS
> Telefon: 92 44 09 99
> Østre Kullerød 5, 3241 Sandefjord
> www.gurusoft.no
>