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 Theodore Omtzigt <to...@stillwater-sc.com> on 2010/04/27 03:08:58 UTC
Installing Solr under Glassfish
I am having trouble getting solr configured under glassfish.
I am following the setup instructions from
(http://wiki.apache.org/solr/SolrInstall). I copied the example solr
home directory example/solr to /var/solr.
When I deploy the solr.war and start it, I get the error that it cannot
find solrconfig.xml and the places that it was looking are classpath and
'solr/conf'.
First I tried to set the java property solr.solr.home=/var/solr, in both
the generic JVM configuration as well as a default startup property and
web container. That did not change the error message.
The error message also indicates that the $CWD is set to some config
directory under the default glassfish domain. So to test that idea, I
copied the whole 'solr/conf' directory to that location and the admin
console comes up. However, that doesn't appear to be the proper
configuration either since none of the xlts appear to get triggered and
I get an unadorned xml doc as return result. It also does not appear to
be the way that glassfish wants its webapps configured.
I also looked at the web.xml in WEB-INF of the deployed web application
and found a segment that states that you can set the Solr home directory
directly in web.xml. So I tried that, but that gives exactly the same
solrconfig.xml not found error.
Thus, I have run out of options mentioned in either the wiki or the
config files. So, any suggestions how to do configure Solr to work under
Glassfish?
Theo
Re: Installing Solr under Glassfish
Posted by Chris Hostetter <ho...@fucit.org>.
: Nope, still not right. The index is not created under solr home, instead it is
: created relative to $CWD, which in Glassfish is in the configuration area of
: the domain.
:
: How do I get the index back to live under solr.solr.home?
what does your dataDir directive in solrconfig.xml look like?
As a recall, an oddity of SOlr that has always existed is that if you
declare a dataDir path it is relative the CWD -- if you don't declare one
then solr defaults to "data" in the instanceDir (aka: solr home for
single core use)
-Hoss
Re: Installing Solr under Glassfish
Posted by Theodore Omtzigt <to...@stillwater-sc.com>.
Nope, still not right. The index is not created under solr home, instead
it is created relative to $CWD, which in Glassfish is in the
configuration area of the domain.
How do I get the index back to live under solr.solr.home?
Theo
On 4/26/2010 9:32 PM, Theodore Omtzigt wrote:
> Turns out that I was almost there, just stuck that system property in
> the wrong place. There is a "Systems Properties" form just for these
> types of things. Sticking them in the JVM or Web Container properties
> wasn't the right thing to do.
>
> The only problem I now still have is that the xml response is raw. How
> do I trigger the xlts transformations for a easier to read xml rendering?
>
> For those interested in the answer here are the steps I went through
> to get Solr configured under Glassfish
>
> first, I used the command line
> bin/asadmin deploy solr.war
> to deploy the application.
>
> Then I copied the Solr home directory structure (from the
> documentation is example/solr) to /var/solr
> There is a java system property for solr by the name solr.solr.home
> that you can set to direct the Solr web application to find its home
> directory at a particular place. So in our case that system property
> needs to be set as follows:
>
> solr.solr.home=/var/solr
>
> In the "Enterprise Server" form (Common Tasks/Enterprise Server in
> the left navigation menu of the Administration console) there is a tab
> called "System Properties". Add the above mentioned property in this
> form. save it.
> Then go back to the "General" tab. Just underneath the "General
> Information" label there is a button with the command "Restart". Hit
> that to restart the Glassfish server. I guess, if you set this
> property before you deploy the Solr web application you don't need to
> do a restart, but I didn't confirm that behavior.
>
>
> Once restarted, go to the applications tab and launch the Solr
> application. And now the Solr web application will come up in a
> separate browser window.
>
>
>
> On 4/26/2010 9:08 PM, Theodore Omtzigt wrote:
>>
>> I am having trouble getting solr configured under glassfish.
>>
>> I am following the setup instructions from
>> (http://wiki.apache.org/solr/SolrInstall). I copied the example solr
>> home directory example/solr to /var/solr.
>>
>> When I deploy the solr.war and start it, I get the error that it cannot
>> find solrconfig.xml and the places that it was looking are classpath and
>> 'solr/conf'.
>>
>> First I tried to set the java property solr.solr.home=/var/solr, in both
>> the generic JVM configuration as well as a default startup property and
>> web container. That did not change the error message.
>>
>> The error message also indicates that the $CWD is set to some config
>> directory under the default glassfish domain. So to test that idea, I
>> copied the whole 'solr/conf' directory to that location and the admin
>> console comes up. However, that doesn't appear to be the proper
>> configuration either since none of the xlts appear to get triggered and
>> I get an unadorned xml doc as return result. It also does not appear to
>> be the way that glassfish wants its webapps configured.
>>
>> I also looked at the web.xml in WEB-INF of the deployed web application
>> and found a segment that states that you can set the Solr home directory
>> directly in web.xml. So I tried that, but that gives exactly the same
>> solrconfig.xml not found error.
>>
>> Thus, I have run out of options mentioned in either the wiki or the
>> config files. So, any suggestions how to do configure Solr to work under
>> Glassfish?
>>
>> Theo
>>
>
Re: Installing Solr under Glassfish
Posted by Theodore Omtzigt <to...@stillwater-sc.com>.
Turns out that I was almost there, just stuck that system property in
the wrong place. There is a "Systems Properties" form just for these
types of things. Sticking them in the JVM or Web Container properties
wasn't the right thing to do.
The only problem I now still have is that the xml response is raw. How
do I trigger the xlts transformations for a easier to read xml rendering?
For those interested in the answer here are the steps I went through to get Solr configured under Glassfish
first, I used the command line
bin/asadmin deploy solr.war
to deploy the application.
Then I copied the Solr home directory structure (from the documentation is example/solr) to /var/solr
There is a java system property for solr by the name solr.solr.home that you can set to direct the Solr web application to find its home directory at a particular place. So in our case that system property needs to be set as follows:
solr.solr.home=/var/solr
In the "Enterprise Server" form (Common Tasks/Enterprise Server in the left navigation menu of the Administration console) there is a tab called "System Properties". Add the above mentioned property in this form. save it.
Then go back to the "General" tab. Just underneath the "General Information" label there is a button with the command "Restart". Hit that to restart the Glassfish server. I guess, if you set this property before you deploy the Solr web application you don't need to do a restart, but I didn't confirm that behavior.
Once restarted, go to the applications tab and launch the Solr application. And now the Solr web application will come up in a separate browser window.
On 4/26/2010 9:08 PM, Theodore Omtzigt wrote:
>
> I am having trouble getting solr configured under glassfish.
>
> I am following the setup instructions from
> (http://wiki.apache.org/solr/SolrInstall). I copied the example solr
> home directory example/solr to /var/solr.
>
> When I deploy the solr.war and start it, I get the error that it cannot
> find solrconfig.xml and the places that it was looking are classpath and
> 'solr/conf'.
>
> First I tried to set the java property solr.solr.home=/var/solr, in both
> the generic JVM configuration as well as a default startup property and
> web container. That did not change the error message.
>
> The error message also indicates that the $CWD is set to some config
> directory under the default glassfish domain. So to test that idea, I
> copied the whole 'solr/conf' directory to that location and the admin
> console comes up. However, that doesn't appear to be the proper
> configuration either since none of the xlts appear to get triggered and
> I get an unadorned xml doc as return result. It also does not appear to
> be the way that glassfish wants its webapps configured.
>
> I also looked at the web.xml in WEB-INF of the deployed web application
> and found a segment that states that you can set the Solr home directory
> directly in web.xml. So I tried that, but that gives exactly the same
> solrconfig.xml not found error.
>
> Thus, I have run out of options mentioned in either the wiki or the
> config files. So, any suggestions how to do configure Solr to work under
> Glassfish?
>
> Theo
>