forrest-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ross Gardler <rgard...@apache.org>
Subject Re: AW: forrest on Windows as background process
Date Fri, 10 Feb 2006 18:03:29 GMT
Johannes Schaefer wrote:
> Ross Gardler wrote:
> 
>>Johannes Schaefer wrote:
>>
>>>Jan.Materne@rzf.fin-nrw.de wrote:
>>>
>>>
>>>>>Johannes Schaefer wrote:
>>>>>
>>>>>
>>>>>>Hi!
>>>>>>
>>>>>>We need to run a forrest server as background process on Win-XP.
>>>>>>On Unix we can do 'forrest run&'.
>>>>>>
>>>>>>How can I achieve this on Windows?
>>>>>
>>>>>I'm not a windows user so can't help directly. But the windows
>>>>>terminology (I believe) is to run Forest as a "service".
>>>>>
>>>>>Perhaps that will help in a web search or prompt some windows users
>>>>>with better knowledge than I to tell us what they know (even if it
>>>>>is that I am incorrect in my assumptions).
>>>
>>>
>>>It does not seem to be a trivial task :-(
>>>
>>>
>>>
>>>>I would try service wrappers like http://jsrvany.sourceforge.net/
>>>
>>>
>>>Thanks for the pointer, I guess I want to try
>>>  "... the java wrapper provided by
>>>   http://wrapper.tanukisoftware.org
>>>   to provide jetty as an Win32 service."
>>>since it comes with Jetty 4.2.25 (extra/win32)
>>>
>>>Next problem is that I'm no ant expert and I'm not able to decypher
>>>how to start 'forrest run' as a jetty app without using forrest.bat
>>>Can anyone bridge the gap and give me a commandline like
>>>
>>> >java org.mortbay.jetty.Server ...
>>>
>>>maybe plus some environment variables (CLASSPATH and the lot).
>>
>>I wrote some code for the Eclipse plugin that does all that. I'd
>>recommend starting your investigation at [1] (in particular starting at
>>the line "monitor.subTask("Starting Server")".
>>
>>This builds the classloader etc. for the Eclipse execution environment.
>>It's a long time since I wrote the code but I'm pretty sure the majority
>>of code is not dependant on Eclipse, it's only the actual execution code
> 
> 
> Can you confirm that I read the code correctly?
> Why do you call 'ant ... init' first?
> 
> 1. Invoke ant with
>    -Dproject.home=%WORKING_DIR% \
>    -Dbasedir=%FORREST_HOME%/main \
>    -Dforrest.home=%FORREST_HOME% \
>    init

I forgot about that. The reason for the call is because there is some 
preparation that needs doing (install of plugins etc). I never 
implemented this in Java because it is not a long running process and 
therefore doesn't need to be stopped by the user (whereas the server does).

I'm not sure how you would deal with this. There was a passing remark on 
  IRC about doing such initialisation after Forrest has started, but 
this is not a trivial job I'm afraid, although certainly one worth doing 
as it would facilitate inprocess changing of configuration files.

> 2. Invoke jetty with
>    %JETTY_CONF%/jettyconf.xml \
>    %FORREST_CORE_WEBAPP% \
>    %FORREST_ENDORSED_LIB% \
>    %WORKING_DIR% \
>    %CLASSPATH%
> 
> quite sure about
> WORKING_DIR  = project directory (where forrest.properties live)
> FORREST_HOME = forrest installation directory
> JETTY_CONF   = based on WORKING_DIR or wherever jettyconf.xml lives
> CLASSPATH containing pratically all *.jar files within Forrest?!
> guessing
> FORREST_CORE_WEBAPP  = FORREST_HOME/main
> FORREST_ENDORSED_LIB = FORREST_HOME/lib/endorsed

 From memory, that is all correct. If you hit problems I'll dig into the 
code with you.

(I'm on and off IRC tonight as it is Forrest Friday)

Ross

Mime
View raw message