Marius Grigaitis
Marius Grigaitis

Reputation: 2520

Running jetty+solr on Windows server

I am trying to create service for Windows.

I have .bat script that launches jetty with solr:

cd ../jetty
java -Djetty.home="C:/Webs/lrt-archyvas/jetty" -Djava.ext.dirs="C:/Webs/lrt-archyvas/parts/jetty-download/lib;C:/Webs/lrt-archyvas/parts/jetty-download/lib/jsp" -jar C:/Webs/lrt-archyvas/parts/jetty-download/start.jar C:/Webs/lrt-archyvas/jetty/etc/jetty.xml C:/Webs/lrt-archyvas/jetty/etc/jetty-deploy.xml C:/Webs/lrt-archyvas/jetty/etc/jetty-webapps.xml OPTIONS=Server,jmx,resources,websocket,ext,plus,annotations

I want to create service and in that case I want to use this http://drupal.org/node/1359598 tutorial.

Problem is that I can't use cd and go into jetty directory. I have to set it in parameters but I am unable to.

When I run this script from other directory I get the following:

2012-03-02 13:04:51.493:INFO::jetty-7.3.1.v20110307
2012-03-02 13:04:51.511:INFO::Deployment monitor C:\Webs\lrt-archyvas\bin\webapp
s at interval 1
2012-03-02 13:04:51.538:INFO::Started [email protected]:8080

It uses "C:\Webs\lrt-archyvas\bin\" (cwd) as jetty.home to load webapps. And I set it to C:/Webs/lrt-archyvas/jetty.

How can I override this?

Upvotes: 1

Views: 2272

Answers (4)

HIRUKAWA Ryo
HIRUKAWA Ryo

Reputation: 76

You can be easily run as a Windows service Solr can be used to exewrap.
Solr Windows Service all-in-one packages are also distributed.

http://exewrap.sourceforge.jp/solr/

Upvotes: 0

Samarth Bhargava
Samarth Bhargava

Reputation: 4228

You can try using procrun from Apache Commons Daemon project. Following post has lot of details.

Running Jetty 7 as Windows Service

Upvotes: 0

jesse mcconnell
jesse mcconnell

Reputation: 7182

You can set jetty.home on the java commandline with -Djetty.home="C:\foo"

(you also ought to use windows paths for that to work I suspect, hence the backslashes)

the jetty start mechanism should pick this setting up and operate from there

I should add that since this is jetty 7 apparently being used there ought to be a start.ini file somewhere in there that you should be able to specify the options and xml files on. You can use the --dry-run option to have the actual option string that is being used.

If you experiment with --dry-run you should be able to iron out the precise string to drop into that service window for things to work. That ought to take some of the tedious process out of determining the correct string.

cheers

Upvotes: 1

romje
romje

Reputation: 660

I fear not being very helpful ... Could you give us more details ? What kind of software are you trying to use to set your application as a Windows service. Don't know if you can afford to use this product but it's a very good one : tutorial article download page

Have you edited the start.config Jetty file ? I guess it may be confused by a wrong location of the jar file (jetty home is computed like this in Jetty)....

HTH Jerome

Upvotes: 0

Related Questions