'Getting error with Jetty Solr?

I using Azure to host my VMs. In one VM I have web application based on Laravel Framework and another VM is used to be cache and searching vm. I installed Jetty and Solr on that VM. Now Jetty is running but I can't see that Solr is running. And my web server giving me this error on slack.

```ErrorException: Trying to get property of non-object in /srv/websites/test.com/app/test/Solr/Solr.php:248
Stack trace:
#0 /srv/websites/test.com/app/test/Solr/Solr.php(248): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(8, 'Trying to get p...', '/srv/websites/r...', 248, Array)
#1 /srv/websites/test.com/app/Http/Controllers/SearchController.php(39): App\test\Solr\Solr->search(Array)
#2 [internal function]: App\Http\Controllers\SearchController->getSearchResponse()
#3 /srv/websites/test.com/bootstrap/cache/compiled.php(9424): call_user_func_array(Array, Array)
#4 /srv/websites/test.com/bootstrap/cache/compiled.php(9486): Illuminate\Routing\Controller->callAction('getSearchRespon...', Array)
#5 /srv/websites/test.com/bootstrap/cache/compiled.php(9466): Illuminate\Routing\ControllerDispatcher->call(Object(App\Http\Controllers\SearchController), Object(Illuminate\Routing\Route), 'getSearchRespon...')
#6 [internal function]: Illuminate\Routing\ControllerDispatcher->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request)).............

One more if try to run this command

   $java -jar start.jar

It gives me error like that

</opt/solr># java -jar start.jar
java.io.FileNotFoundException: No XML configuration files specified in start.config or command line.
    at org.eclipse.jetty.start.Main.start(Main.java:502)
    at org.eclipse.jetty.start.Main.main(Main.java:96)

Usage: java -jar start.jar [options] [properties] [configs]
   java -jar start.jar --help  # for more information

If run service jetty status command to check status of jetty then the will be like

    Checking arguments to Jetty:
    START_INI      =  /opt/jetty/start.ini
    JETTY_HOME     =  /opt/jetty
    JETTY_BASE     =  /opt/jetty
    JETTY_CONF     =  /opt/jetty/etc/jetty.conf
    JETTY_PID      =  /var/run/jetty.pid
    JETTY_START    =  /opt/jetty/start.jar
    JETTY_LOGS     =  /opt/jetty/logs/
    CLASSPATH      =
    JAVA           =  /bin/java
    JAVA_OPTIONS   =  -Dsolr.solr.home=/opt/solr/solr  -Xms1024m -Xmx2048m -Djetty.state=/opt/jetty/jetty.state -Djetty.logs=/opt/jetty/logs/ -Djetty.home=/opt/jetty -Djetty.base=/opt/jetty -Djava.io.tmpdir=/tmp
    JETTY_ARGS     =  jetty-logging.xml jetty-started.xml
    RUN_CMD        =  /bin/java -Dsolr.solr.home=/opt/solr/solr -Xms1024m -Xmx2048m -Djetty.state=/opt/jetty/jetty.state -Djetty.logs=/opt/jetty/logs/ -Djetty.home=/opt/jetty -Djetty.base=/opt/jetty -Djava.io.tmpdir=/tmp -jar /opt/jetty/start.jar jetty-logging.xml jetty-started.xml

    Jetty running pid=49855

How can I resolve this issue? Java 1.8 is installed on Jetty VM.

VMs running on CentOS 7.2.

I'm not able ping Jetty vm using this http://my-ip:8983 or http://my-ip:3000 (port changed)



Solution 1:[1]

I have been using command like

java -jar /Applications/MAMP/htdocs/solr-4.9.1/example/start.jar

But it stops working and shows the same error as yours.

I solved it by changing the folder:

cd /Applications/MAMP/htdocs/solr-4.9.1/example

and starting it from the folder where start.jar is placed.

java -jar start.jar

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 mialdi98