Limited Time Offer!

For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!

Enroll Now

Apache Solr: Could not find or load main class org.apache.solr.util.SimplePostTool

Error

java -jar -Dc=tech_products post.jar *.xml
Error: Could not find or load main class org.apache.solr.util.SimplePostTool
Caused by: java.lang.ClassNotFoundException: org.apache.solr.util.SimplePostTool

Solution

Check the Solr Version: Ensure that you are using a version of Solr that includes the SimplePostTool. This tool was deprecated in later versions of Solr (starting from Solr 7.x) and removed in Solr 8.x. If you are using Solr 8.x or newer, SimplePostTool is no longer available, and you should use other methods such as the solr.PostTool in Java or curl commands to post data.

Apache Solr Error: Can’t find resource ‘solrconfig.xml’ in classpath

Error

Error CREATEing SolrCore 'new_core': Unable to create core [new_core] Caused by: Can't find resource 'solrconfig.xml' in classpath or '/opt/solr-9.6.0/server/solr/new_core'

Solution

Check the Directory: Ensure that the directory /opt/solr-9.6.0/server/solr/new_core actually exists on your server. If it does not, you will need to create it.

i used /opt/solr-9.6.0/server/solr/configsets/sample_techproducts_configs

Apache Solr: Solr instance is not running in SolrCloud mode

Error

curl --request POST \
> --url http://localhost:8983/api/collections \
> --header 'Content-Type: application/json' \
> --data '{
>   "name": "techproducts",
>   "numShards": 1,
>   "replicationFactor": 1
> }'
{"responseHeader":{"status":400,"QTime":416},"error":{"metadata":{"error-class":"org.apache.solr.common.SolrException","root-error-class":"org.apache.solr.common.SolrException"},"msg":"Solr instance is not running in SolrCloud mode.","code":400}}root@ip-172-31-41-118:/opt/solr-9.6.0/server/solr#

Solution

Git error: GH001: Large files detected. You may want to try Git Large File

Errors

C:\RajeshAll\github\ppt>git push origin master
Enumerating objects: 750, done.
Counting objects: 100% (694/694), done.
Delta compression using up to 8 threads
Compressing objects: 100% (584/584), done.
Writing objects: 100% (634/634), 606.82 MiB | 2.37 MiB/s, done.
Total 634 (delta 157), reused 15 (delta 1), pack-reused 0 (from 0)
remote: Resolving deltas: 100% (157/157), completed with 42 local objects.
remote: error: Trace: f7d8654f7202cd414ba887663661bdefcad7e457d2abeecfdeb2a7777bdc31a1
remote: error: See https://gh.io/lfs for more information.
remote: error: File azure/slides/azure-getting-started/Session-1.pdf is 425.95 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
To github.com:rajeshkumarin/ppts.git
 ! [remote rejected]     master -> master (pre-receive hook declined)
error: failed to push some refs to 'github.com:rajeshkumarin/ppts.git'

Solution

To remove Session-1.pdf from your commit in Git, follow these steps:

Revert the Commit: If the commit containing Session-1.pdf has not been pushed to the remote repository, you can use the following command to undo this commit while keeping the changes in your working directory:

$ git reset --soft HEAD~1

This command will move the current HEAD back to the previous commit, but keep the changes in your staging area.

Remove the File: Once the commit is undone, you need to remove the file from the staging area:

$ git reset HEAD azure/slides/azure-getting-started/Session-1.pdf

This command unstages Session-1.pdf but leaves it in your working directory.
Commit Again: Now, commit your changes again, excluding Session-1.pdf:


$ git commit -m "Your commit message"

Deal with the File Separately: If you still need to track Session-1.pdf but it is too large for GitHub, consider using Git Large File Storage (LFS). Install Git LFS and then set up LFS for your file types:


$ git lfs install
$ git lfs track "*.pdf"
$ git add .gitattributes

After setting up Git LFS, add your large file:


$ git add azure/slides/azure-getting-started/Session-1.pdf
git commit -m "Add large file with LFS"
Push Your Changes: Finally, push your changes to the remote repository:


$ git push origin master