lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alin Simionoiu (JIRA)" <>
Subject [jira] [Commented] (SOLR-3781) when wiring Solr into a larger web application which controls the web context root,something can't work
Date Wed, 24 Apr 2013 14:29:16 GMT


Alin Simionoiu commented on SOLR-3781:

here's my setup (and initial page values).

i have solr inside a larger web application which starts in the root context (this part i
believe is critical). in my web.xml i have my servlets and filters, and i copied more or less
the solr web.xml context. 

i want solr to work from, let's say '/mysolr'. i'm changing the value here, not to be confused
with the default '/solr'
for the SolrRequstFilter i setup: path-prefix = /mysolr and the url-pattern = /mysolr/*

in the initial page of the UI, i have:
app_config.solr_path = '';
app_config.core_admin_path = '\/admin\/cores';

LoadAdminUiServlet seems to set the app_config.solr_path to request.getContextPath(), and
since my application works from root context it kind of makes sense for solr_path to be ''
(maybe is '\/' and it gets removed by the code later on). This will make all the calls inside
the admin.html to go against, let's say /admin/cores (invalid URL for me) instead of expected

if i provide my own copy of LoadAdminUiServlet, which sets app_config.solr_path='\/mysolr',
than the admin.html calls will double that for some reasons, '/mysolr/mysolr/admin/cores'
instead of '/mysolr/admin/cores', i can't figure this one out.

(as a hack i'm also using a copy of SolrRequestFilter which removes the double prefix if found,
and now admin.html kind of works. the only thing that i still have to figure out is the zookeeper
part, that one still doesn't work, not sure why is going against /zookeeper instead of /mysolr/zookeeper).

i'm just using '/admin/cores' as examples here, logging and all the other URL's have the same

Does this makes more sense now?

> when wiring Solr into a larger web application which controls the web context root,something
can't work
> -------------------------------------------------------------------------------------------------------
>                 Key: SOLR-3781
>                 URL:
>             Project: Solr
>          Issue Type: Bug
>          Components: SolrCloud
>    Affects Versions: 4.0-BETA
>         Environment: win7 jetty-distribution-7.6.5.v20120716
> startup param:
> -Djetty.port=8084 -DzkRun -Dbootstrap_conf=true
>            Reporter: shenjc
>            Priority: Minor
>              Labels: patch
>         Attachments: LoadAdminUiServlet.patch
>   Original Estimate: 24h
>  Remaining Estimate: 24h
> if i am wiring Solr into a larger web application which controls the web context root,
you will probably want to mount Solr under a path prefix (app.war with /app/solr mounted into
it, for example).
>  For example:
> RootApp.war-------- /
> myApp.war---------------/myApp
> prefixPath-------------------xxx
> jsdir------------------------------js
> js file--------------------------------main.js
> admin file-------------------------admin.html
> org.apache.solr.servlet.LoadAdminUiServlet
> line:49  InputStream in = getServletContext().getResourceAsStream("/admin.html");
> can't find admin/html because it's in the prefixPath directory
> line:149-150
> this.nodeName = this.hostName + ':' + this.localHostPort + '_' + this.localHostContext;
>     this.baseURL = this.localHost + ":" + this.localHostPort + "/" + this.localHostContext;
> it can't match this condition
> baseURL need to be http://xx:xx/myApp/myPrefixPath 
> eg. http://xx:xx/myApp/xxx

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message