Error with Solr integration with AEM
Hi,
I am following the tutorial Solr integration with AEM (Java) to integrate SOLR with AEM.
when I build the project, I get the error, but the bundle is active

[ERROR] The analyser found the following errors for author and publish :
[ERROR] [api-regions-exportsimports] com.astellas:aem-astellas-project.core:0.0.1-SNAPSHOT: Bundle aem-astellas-project.core:0.0.1-SNAPSHOT is importing package(s) [org.apache.solr.common, org.apache.solr.client.solrj.impl, org.apache.solr.common.params, org.apache.solr.client.solrj.response, org.apache.solr.client.solrj] in start level 20 but no bundle is exporting these for that start level. (com.astellas:aem-astellas-project.all:0.0.1-SNAPSHOT)public class SolrIndexServlet extends SlingAllMethodsServlet {
protected void doGet(final SlingHttpServletRequest req,
final SlingHttpServletResponse resp) throws IOException {
SolrClient solrClient = getSolrClient();
try {
// Get all documents from practice collection
//SolrQuery solrQuery = new SolrQuery("*:*");
// Get document having name as home
SolrQuery solrQuery = new SolrQuery();
solrQuery.set("q", "name:home");
QueryResponse queryResponse = solrClient.query("practice", solrQuery);
SolrDocumentList documents = queryResponse.getResults();
for(SolrDocument document : documents) {
document.getFirstValue("name");
}
} catch (SolrServerException e) {
throw new RuntimeException(e);
}
}
protected void doPost(final SlingHttpServletRequest req,
final SlingHttpServletResponse resp) throws IOException {
// POST the data to solr having name and id as home.
SolrInputDocument doc = new SolrInputDocument();
doc.addField("name", "home");
/*
Provide custom id as page path or some unique value.
It will help us to update same record as part of
next update, sync or POST data in
place of creating new or duplicate document.
*/
doc.addField("id", "home");
SolrClient solrClient = getSolrClient();
try {
solrClient.add("practice", doc);
solrClient.commit("practice");
} catch (SolrServerException e) {
throw new RuntimeException(e);
}
}
protected void doDelete(final SlingHttpServletRequest req,
final SlingHttpServletResponse resp) throws IOException {
SolrClient solrClient = getSolrClient();
try {
// Use below code to Delete all documents
// solrClient.deleteByQuery("*");
// Delete specific document having id == home and name == home
solrClient.deleteByQuery("practice", "(id:home) AND (name:home)");
solrClient.commit("practice");
} catch (SolrServerException e) {
throw new RuntimeException(e);
}
}
private static Http2SolrClient getSolrClient() {
return new Http2SolrClient.Builder("http://localhost:8983/solr")
.connectionTimeout(50000)
.build();
}
Could you please advise how can I solve it.
Best regards!