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 Tim Dunphy <bl...@gmail.com> on 2015/05/06 22:29:15 UTC

solr 3.6.2 under tomcat 8 missing corename in path

I'm trying to setup an old version of Solr for one of our drupal
developers. Apparently only versions 1.x or 3.x will work with the current
version of drupal.

I'm setting up solr 3.4.2 under tomcat.

And I'm getting this error when I start tomcat and surf to the /solr/admin
URL:

 HTTP Status 404 - missing core name in path

    type Status report

    message missing core name in path

    description The requested resource is not available.

I have solr living in /opt:

    # ls -ld /opt/solr
    lrwxrwxrwx. 1 root root 17 May  6 12:48 /opt/solr -> apache-solr-3.6.2

And I have my cores located here:

    # ls -ld /opt/solr/admin/cores
    drwxr-xr-x. 3 root root 4096 May  6 14:37 /opt/solr/admin/cores

Just one core so far, until I can get this working.

    # ls -l /opt/solr/admin/cores/
    total 4
    drwxr-xr-x. 5 root root 4096 May  6 14:08 collection1

I have this as my solr.xml file:

    <solr persistent="false"
      <cores adminPath="/admin/cores" defaultCoreName="collection1">
         <core name="collection1" instanceDir="collection1" />
       </cores>
    </solr>

Which is located in these two places:

    # ls -l /opt/solr/solr.xml /usr/local/tomcat/conf/Catalina/solr.xml
    -rw-r--r--. 1 root root 169 May  6 14:38 /opt/solr/solr.xml
    -rw-r--r--. 1 root root 169 May  6 14:38
/usr/local/tomcat/conf/Catalina/solr.xml

These are the contents of my /opt/solr directory

    # ls -l  /opt/solr/
    total 436
    drwxr-xr-x.  3 root root   4096 May  6 14:37 admin
    -rw-r--r--.  1 root root 176647 Dec 18  2012 CHANGES.txt
    drwxr-xr-x.  3 root root   4096 May  6 12:48 client
    drwxr-xr-x.  9 root root   4096 Dec 18  2012 contrib
    drwxr-xr-x.  3 root root   4096 May  6 12:48 dist
    drwxr-xr-x.  3 root root   4096 May  6 12:48 docs
    -rw-r--r--.  1 root root   1274 May  6 13:28 elevate.xml
    drwxr-xr-x. 11 root root   4096 May  6 12:48 example
    -rw-r--r--.  1 root root  81331 Dec 18  2012 LICENSE.txt
    -rw-r--r--.  1 root root  20828 Dec 18  2012 NOTICE.txt
    -rw-r--r--.  1 root root   5270 Dec 18  2012 README.txt
    -rw-r--r--.  1 root root  55644 May  6 13:27 schema.xml
    -rw-r--r--.  1 root root  60884 May  6 13:27 solrconfig.xml
    -rw-r--r--.  1 root root    169 May  6 14:38 solr.xml


Yet, when I bounce tomcat, this is the result that I get:

    HTTP Status 404 - missing core name in path

    type Status report

    message missing core name in path

    description The requested resource is not available.

Cany anyone tell me what I'm doing wrong?


Thanks!!
Tim


-- 
GPG me!!

gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B

Re: solr 3.6.2 under tomcat 8 missing corename in path

Posted by Shawn Heisey <ap...@elyograg.org>.
On 5/7/2015 11:03 AM, Tim Dunphy wrote:
> When I browse to /solr I see a link that points me to /solr/admin. And when
> I click on that link is when I see the error:
>
> *missing core name in path*
>
>
> I think what my problem is, is that I am not listing the cores correctly in
> the solr.xml file.
>
> This is what I have in my solr.xml file:
>
>   <solr persistent="false"
>       <cores adminPath="/admin/cores" defaultCoreName="collection1">
>          <core name="collection1" instanceDir="collection1" />
>        </cores>
>     </solr>
>
> So what I did was create a directory at solr/admin/cores and put
> collection1 there:
>
> [root@aoadbld00032la solr]# ls -ld admin/cores/collection1
> drwxr-xr-x. 5 root root 4096 May  6 17:29 admin/cores/collection1
>
> So, if I assume correctly, that the way I reference the collection1
> directory is the problem, how can I express this differently in my solr.xml
> file so that it works?

The adminPath (/admin/cores) is a *URL* path, not a *filesystem* path.

Let's back up a bit.

Your tomcat config needs some way to start Solr.  This can either be
done by dropping "solr.war" into an automatic deployment directory, or
placing an XML file (context fragment) telling Tomcat how to find the
.war, the context path (usually /solr) and possibly some other settings.

https://wiki.apache.org/solr/SolrTomcat#Installing_Solr_instances_under_Tomcat

Part of the config that you can give is a directory known as the Solr
Home.  If you don't specify it, it defaults to "./solr" -- meaning a
directory named "solr" in the current working directory of the process
that actually starts your container.  I highly recommend that you
specify the solr home, either with "-Dsolr.solr.home=/path/to/solr" on
the java commandline, or with a JNI environment variable named
"solr/home" in the context fragment.

Once you have your Solr Home figured out, you put your solr.xml file
there, and your instanceDir for each of your cores will be relative to
that directory as well.  Inside the instanceDir you must have a conf
directory, which contains solrconfig.xml and schema.xml, plus any other
config files referenced by those two files.

If you're running SolrCloud, then the config is in zookeeper, not on the
disk in the conf directory, but the instanceDir for each core works much
the same other than that.

I would recommend you have persistent set to true in your solrconfig.xml
file.  A great number of possible problems with the CoreAdmin API can be
avoided that way.

Thanks,
Shawn


Re: solr 3.6.2 under tomcat 8 missing corename in path

Posted by Tim Dunphy <bl...@gmail.com>.
Hi Shawn,


> The URL must include the core name.  Your defaultCoreName is
> collection1, and I'm guessing you don't have a core named collection1.
> Try browsing to just /solr instead of /solr/admin ... you should get a
> list of links for valid cores, each of which will take you to the admin
> page for that core.
> Probably what you will find is that when you click on one of those
> links, you will end up on /solr/corename/admin.jsp as the URL in your
> browser.


When I browse to /solr I see a link that points me to /solr/admin. And when
I click on that link is when I see the error:

*missing core name in path*


I think what my problem is, is that I am not listing the cores correctly in
the solr.xml file.

This is what I have in my solr.xml file:

  <solr persistent="false"
      <cores adminPath="/admin/cores" defaultCoreName="collection1">
         <core name="collection1" instanceDir="collection1" />
       </cores>
    </solr>

So what I did was create a directory at solr/admin/cores and put
collection1 there:

[root@aoadbld00032la solr]# ls -ld admin/cores/collection1
drwxr-xr-x. 5 root root 4096 May  6 17:29 admin/cores/collection1

So, if I assume correctly, that the way I reference the collection1
directory is the problem, how can I express this differently in my solr.xml
file so that it works?

Thanks,
Tim



On Wed, May 6, 2015 at 8:00 PM, Shawn Heisey <ap...@elyograg.org> wrote:

> On 5/6/2015 2:29 PM, Tim Dunphy wrote:
> > I'm trying to setup an old version of Solr for one of our drupal
> > developers. Apparently only versions 1.x or 3.x will work with the
> current
> > version of drupal.
> >
> > I'm setting up solr 3.4.2 under tomcat.
> >
> > And I'm getting this error when I start tomcat and surf to the
> /solr/admin
> > URL:
> >
> >  HTTP Status 404 - missing core name in path
> >
> >     type Status report
> >
> >     message missing core name in path
> >
> >     description The requested resource is not available.
>
> The URL must include the core name.  Your defaultCoreName is
> collection1, and I'm guessing you don't have a core named collection1.
>
> Try browsing to just /solr instead of /solr/admin ... you should get a
> list of links for valid cores, each of which will take you to the admin
> page for that core.
>
> Probably what you will find is that when you click on one of those
> links, you will end up on /solr/corename/admin.jsp as the URL in your
> browser.
>
> Thanks,
> Shawn
>
>


-- 
GPG me!!

gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B

Re: solr 3.6.2 under tomcat 8 missing corename in path

Posted by Shawn Heisey <ap...@elyograg.org>.
On 5/6/2015 2:29 PM, Tim Dunphy wrote:
> I'm trying to setup an old version of Solr for one of our drupal
> developers. Apparently only versions 1.x or 3.x will work with the current
> version of drupal.
> 
> I'm setting up solr 3.4.2 under tomcat.
> 
> And I'm getting this error when I start tomcat and surf to the /solr/admin
> URL:
> 
>  HTTP Status 404 - missing core name in path
> 
>     type Status report
> 
>     message missing core name in path
> 
>     description The requested resource is not available.

The URL must include the core name.  Your defaultCoreName is
collection1, and I'm guessing you don't have a core named collection1.

Try browsing to just /solr instead of /solr/admin ... you should get a
list of links for valid cores, each of which will take you to the admin
page for that core.

Probably what you will find is that when you click on one of those
links, you will end up on /solr/corename/admin.jsp as the URL in your
browser.

Thanks,
Shawn