Search code examples
solrsolrjbroadleaf-commerce

Broadleaf Commerce Standalone SOLR issue


I deployed broadleaf demo site on standalone tomcat server with mysql as backend and standalone solr server. I can access the solr server on 8983 port. I see that my cores are available at http://localhost:8983/solr/#/catalog and catalog_reindex (note the hash in url). I changed the common-shared.properties file to point to right URL but when I try to hit the SiteApplication, I get following error

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 405 HTTP method POST is not supported by this URL</title>
</head>
<body><h2>HTTP ERROR 405</h2>
<p>Problem accessing /solr/index.html. Reason:
<pre>    HTTP method POST is not supported by this URL</pre></p>
</body>
</html>

After this I extended the SolrSearchServiceImpl and changed the request method to GET but now I am getting error Expected mime type application/octet-stream but got text/html. and in response I get an html response with no detailed reason.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html ng-app="solrAdminApp">
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements.  See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License.  You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<head>
  <title>Solr Admin</title>

  <link rel="icon" type="image/x-icon" href="img/favicon.ico?_=6.2.1">
  <link rel="shortcut icon" type="image/x-icon" href="img/favicon.ico?_=6.2.1">

  <link rel="stylesheet" type="text/css" href="css/angular/common.css?_=6.2.1">
  <link rel="stylesheet" type="text/css" href="css/angular/analysis.css?_=6.2.1">
  <link rel="stylesheet" type="text/css" href="css/angular/cloud.css?_=6.2.1">
  <link rel="stylesheet" type="text/css" href="css/angular/cores.css?_=6.2.1">
  <link rel="stylesheet" type="text/css" href="css/angular/collections.css?_=6.2.1">
  <link rel="stylesheet" type="text/css" href="css/angular/dashboard.css?_=6.2.1">
  <link rel="stylesheet" type="text/css" href="css/angular/dataimport.css?_=6.2.1">
  <link rel="stylesheet" type="text/css" href="css/angular/files.css?_=6.2.1">
  <link rel="stylesheet" type="text/css" href="css/angular/index.css?_=6.2.1">
  <link rel="stylesheet" type="text/css" href="css/styles/java-properties.css?_=6.2.1">
  <link rel="stylesheet" type="text/css" href="css/angular/logging.css?_=6.2.1">
  <link rel="stylesheet" type="text/css" href="css/angular/menu.css?_=6.2.1">
  <link rel="stylesheet" type="text/css" href="css/angular/plugins.css?_=6.2.1">
  <link rel="stylesheet" type="text/css" href="css/angular/documents.css?_=6.2.1">
  <link rel="stylesheet" type="text/css" href="css/angular/query.css?_=6.2.1">
  <link rel="stylesheet" type="text/css" href="css/angular/stream.css?_=6.2.1">
  <link rel="stylesheet" type="text/css" href="css/angular/replication.css?_=6.2.1">
  <link rel="stylesheet" type="text/css" href="css/angular/schema.css?_=6.2.1">
  <link rel="stylesheet" type="text/css" href="css/angular/segments.css?_=6.2.1">
  <link rel="stylesheet" type="text/css" href="css/angular/threads.css?_=6.2.1">
  <link rel="stylesheet" type="text/css" href="css/angular/chosen.css?_=6.2.1">

  <meta http-equiv="x-ua-compatible" content="IE=9">
  <script src="libs/jquery-2.1.3.min.js"></script>
  <script src="libs/chosen.jquery.js"></script>
  <script src="libs/jquery.jstree.js"></script>
  <script src="libs/angular.js"></script>
  <script src="libs/angular-chosen.js"></script>
  <script src="libs/angular-resource.min.js"></script>
  <script src="libs/angular-route.min.js"></script>
  <script src="libs/angular-cookies.min.js"></script>
  <script src="libs/ngtimeago.js"></script>
  <script src="libs/highlight.js"></script>
  <script src="libs/d3.js"></script>
  <script src="js/angular/app.js"></script>
  <script src="js/angular/services.js"></script>
  <script src="js/angular/controllers/index.js"></script>
  <script src="js/angular/controllers/logging.js"></script>
  <script src="js/angular/controllers/cloud.js"></script>
  <script src="js/angular/controllers/collections.js"></script>
  <script src="js/angular/controllers/cores.js"></script>
  <script src="js/angular/controllers/threads.js"></script>
  <script src="js/angular/controllers/java-properties.js"></script>
  <script src="js/angular/controllers/core-overview.js"></script>
  <script src="js/angular/controllers/collection-overview.js"></script>
  <script src="js/angular/controllers/analysis.js"></script>
  <script src="js/angular/controllers/dataimport.js"></script>
  <script src="js/angular/controllers/documents.js"></script>
  <script src="js/angular/controllers/files.js"></script>
  <script src="js/angular/controllers/query.js"></script>
  <script src="js/angular/controllers/stream.js"></script>
  <script src="js/angular/controllers/plugins.js"></script>
  <script src="js/angular/controllers/replication.js"></script>
  <script src="js/angular/controllers/schema.js"></script>
  <script src="js/angular/controllers/segments.js"></script>

</head>
<body ng-controller="MainController">

  <div id="wrapper" scrollable-when-small>

    <div id="header">

      <a href="./" id="solr"><span>Apache SOLR</span></a>

      <p id="environment">&nbsp;</p>

    </div>

    <div id="main" class="clearfix">

      <div class="header-message" id="init-failures" ng-show="showInitFailures">

          <h2>SolrCore Initialization Failures</h2>
          <ul>
              <li ng-repeat="(core,error) in initFailures"><strong>{{core}}:</strong> {{error}}</li>
          </ul>
          <p>Please check your logs for more information</p>

      </div>

      <div id="loading" class="loader universal-loader" loading-status-message>&nbsp;</div>

      <div id="connection-box" connection-message>
        <div id="connection-status-modal">
        </div>

        <div class="connection-status header-message">
          <h2>Connection to Solr lost</h2>
          <p>Please check the Solr instance.</p>
        </div>
  <div class="connection-status header-message" id="connection-status-recovered"  ng-show="connectionRecovered">
    <h2>Connection recovered...</h2>
    <p>Continuing to load data...</p>
  </div>
      </div>
      <div id="http-exception" class="header-message" ng-repeat="(url, exception) in exceptions">
        <div class="exception">{{exception.msg}}</div>
      </div>

      <div class="other-ui-link">
        Use <a class="ul" href="/solr/old.html">original UI</a><a target="_blank" href="http://wiki.apache.org/solr/AngularUI">&nbsp;<span class="help"></span></a>
      </div>

      <div id="content-wrapper">
        <div ng-view id="content">

        </div>
      </div>

      <div id="menu-wrapper">
        <div>

          <ul id="menu">

            <li id="index" class="global" ng-class="{active:page=='index'}"><p><a href="#/">Dashboard</a></p></li>

            <li id="logging" class="global" ng-class="{active:page=='logging'}"><p><a href="#/~logging">Logging</a></p>
              <ul ng-show="showingLogging">
                <li class="level" ng-class="{active:page=='logging-levels'}"><a href="#/~logging/level">Level</a></li>
              </ul>
            </li>

            <li id="cloud" class="global optional" ng-show="isCloudEnabled" ng-class="{active:showingCloud}"><p><a href="#/~cloud">Cloud</a></p>
              <ul ng-show="showingCloud">
                <li class="tree" ng-class="{active:page=='cloud-tree'}"><a href="#/~cloud?view=tree">Tree</a></li>
                <li class="graph" ng-class="{active:page=='cloud-graph'}"><a href="#/~cloud">Graph</a></li>
                <li class="rgraph" ng-class="{active:page=='cloud-rgraph'}"><a href="#/~cloud?view=rgraph">Graph (Radial)</a></li>
                <li class="dump" ng-class="{active:page=='cloud-dump'}"><a ng-click="dumpCloud()">Dump</a></li>
              </ul>
            </li>

            <li ng-show="isCloudEnabled" id="collections" class="global" ng-class="{active:page=='collections'}"><p><a href="#/~collections">Collections</a></p></li>
            <li ng-hide="isCloudEnabled" id="cores" class="global" ng-class="{active:page=='cores'}"><p><a href="#/~cores">Core Admin</a></p></li>

            <li id="java-properties" class="global" ng-class="{active:page=='java-props'}"><p><a href="#/~java-properties">Java Properties</a></li>

            <li id="threads" class="global" ng-class="{active:page=='threads'}"><p><a href="#/~threads">Thread Dump</a></p></li>

          </ul>

          <div id="collection-selector" ng-show="isCloudEnabled">
            <div id="has-collections" ng-show="collections.length!=0">
              <select data-placeholder="Collection Selector"
                      ng-model="currentCollection"
                      chosen
                      ng-change="showCollection(currentCollection)"
                      ng-options="collection.name for collection in collections"></select>
            </div>
            <p id="has-no-collections" ng-show="collections.length==0"><a href="#/~collections">
              No collections available
              <span>Go and create one</span>
            </a></p>
          </div>
          <div id="collection-menu" class="sub-menu" ng-show="currentCollection">
            <ul>
              <li class="overview" ng-class="{active:page=='collection-overview'}"><a href="#/{{currentCollection.name}}/collection-overview"><span>Overview</span></a></li>
              <li class="analysis" ng-class="{active:page=='analysis'}"><a href="#/{{currentCollection.name}}/analysis"><span>Analysis</span></a></li>
              <li class="dataimport" ng-class="{active:page=='dataimport'}"><a href="#/{{currentCollection.name}}/dataimport"><span>Dataimport</span></a></li>
              <li class="documents" ng-class="{active:page=='documents'}"><a href="#/{{currentCollection.name}}/documents"><span>Documents</span></a></li>
              <li class="files" ng-class="{active:page=='files'}"><a href="#/{{currentCollection.name}}/files"><span>Files</span></a></li>
              <li class="query" ng-class="{active:page=='query'}"><a href="#/{{currentCollection.name}}/query"><span>Query</span></a></li>
              <li class="stream" ng-class="{active:page=='stream'}"><a href="#/{{currentCollection.name}}/stream"><span>Stream</span></a></li>
              <li class="schema" ng-class="{active:page=='schema'}"><a href="#/{{currentCollection.name}}/schema"><span>Schema</span></a></li>
        </ul>
          </div>
          <div id="core-selector">
            <div id="has-cores" ng-show="cores.length!=0">
              <select data-placeholder="Core Selector"
                      ng-model="currentCore"
                      chosen
                      ng-change="showCore(currentCore)"
                      ng-options="core.name for core in cores"></select>
            </div>
            <p id="has-no-cores" ng-show="cores.length==0"><a href="#/~cores">
              No cores available
              <span>Go and create one</span>
            </a></p>
          </div>
          <div id="core-menu" class="sub-menu" ng-show="currentCore">
            <ul>
              <li class="overview" ng-class="{active:page=='overview'}"><a href="#/{{currentCore.name}}"><span>Overview</span></a></li>
              <li ng-hide="isCloudEnabled" class="analysis" ng-class="{active:page=='analysis'}"><a href="#/{{currentCore.name}}/analysis"><span>Analysis</span></a></li>
              <li ng-hide="isCloudEnabled" class="dataimport" ng-class="{active:page=='dataimport'}"><a href="#/{{currentCore.name}}/dataimport"><span>Dataimport</span></a></li>
              <li ng-hide="isCloudEnabled" class="documents" ng-class="{active:page=='documents'}"><a href="#/{{currentCore.name}}/documents"><span>Documents</span></a></li>
              <li ng-hide="isCloudEnabled" class="files" ng-class="{active:page=='files'}"><a href="#/{{currentCore.name}}/files"><span>Files</span></a></li>
              <li class="ping" ng-class="{active:page=='ping'}"><a ng-click="ping()"><span>Ping</span><small class="qtime" ng-show="showPing"> (<span>{{pingMS}}ms</span>)</small></a></li>
              <li class="plugins" ng-class="{active:page=='plugins'}"><a href="#/{{currentCore.name}}/plugins"><span>Plugins / Stats</span></a></li>
              <li ng-hide="isCloudEnabled" class="query" ng-class="{active:page=='query'}"><a href="#/{{currentCore.name}}/query"><span>Query</span></a></li>
              <li ng-hide="isCloudEnabled" class="replication" ng-class="{active:page=='replication'}"><a href="#/{{currentCore.name}}/replication"><span>Replication</span></a></li>
              <li ng-hide="isCloudEnabled" class="schema" ng-class="{active:page=='schema'}"><a href="#/{{currentCore.name}}/schema"><span>Schema</span></a></li>
              <li class="segments" ng-class="{active:page=='segments'}"><a href="#/{{currentCore.name}}/segments"><span>Segments info</span></a></li>
      </ul>
          </div>

        </div>
      </div>

      <div id="meta">

        <ul>

          <li class="documentation"><a href="http://lucene.apache.org/solr/"><span>Documentation</span></a></li>
          <li class="issues"><a href="http://issues.apache.org/jira/browse/SOLR"><span>Issue Tracker</span></a></li>
          <li class="irc"><a href="http://webchat.freenode.net/?channels=#solr"><span>IRC Channel</span></a></li>
          <li class="mailinglist"><a href="http://wiki.apache.org/solr/UsingMailingLists"><span>Community forum</span></a></li>
          <li class="wiki-query-syntax"><a href="https://cwiki.apache.org/confluence/display/solr/Query+Syntax+and+Parsing"><span>Solr Query Syntax</span></a></li>

        </ul>

      </div>

    </div>

  </div>

</body>
</html>

My SOLR version is 6.2.1 and Broadleaf version is 5.2.1


Solution

  • This is something that has to do with the indexing phase in Solr.

    I bet that if you have a look at Solr logs you will find some error (e.g. missing required field, multiple values for a non multivalued field)

    Andrea

    P.S. I don't know Broadleaf commerce but, the URL you should configure in the admin panel shouldn't have the # symbol, this is only valid in the admin console, which is implemented using AngularJS (that's the reason why the URL looks like that)