You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Frank Brown <br...@stancounty.com> on 2011/12/24 00:48:10 UTC

Installing TomEE as a windows service

I have an instance of TomEE on which I've deployed an application.  I'd like to install TomEE as a Windows Service so it will automatically start after reboot.  Since TomEE is in fact (I think?) Tomcat with openejb.war installed and configuration changes made, I thought I could install a TomEE service as I would a Tomcat service.
 
The version of TomEE I have installed is apache-tomee-6.0.29.  I copied tomcat6.exe and service.exe from apache-tomcat-6.0.32/bin to apache-tomee-6.0.29/bin and tried the following:
 
Opened command prompt to "c:\opt\apache-tomee-6.0.29\bin" and entered this:
 
c:\> tomcat6 //IS//TomEE --DisplayName="Apache TomEE (openejb 3.1.4)" \
    --Install="c:\opt\apache-tomee-6.0.29\bin\tomcat6.exe"  \
    --Jvm=auto --StartMode=jvm --StopMode=jvm \
    --StartClass=org.appach.catalina.startup.Bootstrap  --StartParams=start \
    --StopClass=org.appach.catalina.startup.Bootstrap  --StopParams=stop
 
It installed the service, but the service does not start.  Presumably it's an issue with certain assumptions made by tomcat6.exe, but I have no clue what the issue is.
 
 
I would guess many people have installed TomEE as a windows service.  Can someone share with me how that can be done? 
 
 
 
 
 

Re: Installing TomEE as a windows service

Posted by Frank Brown <br...@stancounty.com>.
Thank you, Karan.  I had tried using tomcat6.exe directly, but didn't try using service.bat.  Your email inspired me to try again.  It turns out service.bat is setting a bunch of environment variables like PR_* that are needed by tomcat6.exe, and in executing tomcat6.exe directly I was omitting those variables.
 
I have a regular Tomcat instance running as well as TomEE, so my goal was to get a service with the Display Name and Description more to my liking.  To achieve that, I just modified service.bat
as follows:
 
set SERVICE_NAME=TomEE
set PR_DISPLAYNAME=Apache TomEE 6.0.29
set PR_DESCRIPTION=Apache TomEE 6.0.29 Server - http://tomcat.apache.org/ plus http://openejb.apache.org/ 
 
Then executed "service.bat install"
 
Now, I have my two services, easily distinguished from one another:
 
serviceName: tomcat6
displayName: Apache Tomcat 6.0.18
description: Apache Tomcat 6.0.18 Server - http://tomcat.apache.org/ 
 
serviceName: TomEE
dsplayName:  Apache TomEE 6.0.29
description:  Apache TomEE 6.0.29 Server - http://tomcat.apache.org/ plus http://openejb.apache.org/ 
 
 
Thanks, all.
 

>>> On 12/27/2011 at 11:03 PM, Karan Malhi <ka...@gmail.com> wrote:
Another way you can try is :
1. Copy service.bat , tomcat7.exe and tomcat7w.exe(you may not need
this one) from an existing tomcat7 installation, and paste them into
bin directory of Tomee
2. Run the following command from the bin directory (in the console)
    service.bat install tomee

If you open "Services" , you should be able to see Apache Tomcat tomee
listed there. You should be able to start/stop the service easily.



On Sat, Dec 24, 2011 at 12:07 AM, Romain Manni-Bucau
<rm...@gmail.com> wrote:
> Hi,
>
> a script is here for openejb standalone:
> https://svn.apache.org/repos/asf/openejb/trunk/openejb/assembly/openejb-standalone/src/main/resources/service.install.as.admin.bat 
>
> i didn't try for tomee but it shouldn't be so different. It is based on
> openejb-daemon module.
>
> - Romain
>
>
> 2011/12/24 Frank Brown <br...@stancounty.com>
>
>> I have an instance of TomEE on which I've deployed an application.  I'd
>> like to install TomEE as a Windows Service so it will automatically start
>> after reboot.  Since TomEE is in fact (I think?) Tomcat with openejb.war
>> installed and configuration changes made, I thought I could install a TomEE
>> service as I would a Tomcat service.
>>
>> The version of TomEE I have installed is apache-tomee-6.0.29.  I copied
>> tomcat6.exe and service.exe from apache-tomcat-6.0.32/bin to
>> apache-tomee-6.0.29/bin and tried the following:
>>
>> Opened command prompt to "c:\opt\apache-tomee-6.0.29\bin" and entered this:
>>
>> c:\> tomcat6 //IS//TomEE --DisplayName="Apache TomEE (openejb 3.1.4)" \
>>    --Install="c:\opt\apache-tomee-6.0.29\bin\tomcat6.exe"  \
>>    --Jvm=auto --StartMode=jvm --StopMode=jvm \
>>    --StartClass=org.appach.catalina.startup.Bootstrap  --StartParams=start
>> \
>>    --StopClass=org.appach.catalina.startup.Bootstrap  --StopParams=stop
>>
>> It installed the service, but the service does not start.  Presumably it's
>> an issue with certain assumptions made by tomcat6.exe, but I have no clue
>> what the issue is.
>>
>>
>> I would guess many people have installed TomEE as a windows service.  Can
>> someone share with me how that can be done?
>>
>>
>>
>>
>>
>>



-- 

Karan Singh Malhi
twitter.com/KaranSinghMalhi

Re: Installing TomEE as a windows service

Posted by Karan Malhi <ka...@gmail.com>.
Another way you can try is :
1. Copy service.bat , tomcat7.exe and tomcat7w.exe(you may not need
this one) from an existing tomcat7 installation, and paste them into
bin directory of Tomee
2. Run the following command from the bin directory (in the console)
    service.bat install tomee

If you open "Services" , you should be able to see Apache Tomcat tomee
listed there. You should be able to start/stop the service easily.



On Sat, Dec 24, 2011 at 12:07 AM, Romain Manni-Bucau
<rm...@gmail.com> wrote:
> Hi,
>
> a script is here for openejb standalone:
> https://svn.apache.org/repos/asf/openejb/trunk/openejb/assembly/openejb-standalone/src/main/resources/service.install.as.admin.bat
>
> i didn't try for tomee but it shouldn't be so different. It is based on
> openejb-daemon module.
>
> - Romain
>
>
> 2011/12/24 Frank Brown <br...@stancounty.com>
>
>> I have an instance of TomEE on which I've deployed an application.  I'd
>> like to install TomEE as a Windows Service so it will automatically start
>> after reboot.  Since TomEE is in fact (I think?) Tomcat with openejb.war
>> installed and configuration changes made, I thought I could install a TomEE
>> service as I would a Tomcat service.
>>
>> The version of TomEE I have installed is apache-tomee-6.0.29.  I copied
>> tomcat6.exe and service.exe from apache-tomcat-6.0.32/bin to
>> apache-tomee-6.0.29/bin and tried the following:
>>
>> Opened command prompt to "c:\opt\apache-tomee-6.0.29\bin" and entered this:
>>
>> c:\> tomcat6 //IS//TomEE --DisplayName="Apache TomEE (openejb 3.1.4)" \
>>    --Install="c:\opt\apache-tomee-6.0.29\bin\tomcat6.exe"  \
>>    --Jvm=auto --StartMode=jvm --StopMode=jvm \
>>    --StartClass=org.appach.catalina.startup.Bootstrap  --StartParams=start
>> \
>>    --StopClass=org.appach.catalina.startup.Bootstrap  --StopParams=stop
>>
>> It installed the service, but the service does not start.  Presumably it's
>> an issue with certain assumptions made by tomcat6.exe, but I have no clue
>> what the issue is.
>>
>>
>> I would guess many people have installed TomEE as a windows service.  Can
>> someone share with me how that can be done?
>>
>>
>>
>>
>>
>>



-- 

Karan Singh Malhi
twitter.com/KaranSinghMalhi

Re: Installing TomEE as a windows service

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi,

a script is here for openejb standalone:
https://svn.apache.org/repos/asf/openejb/trunk/openejb/assembly/openejb-standalone/src/main/resources/service.install.as.admin.bat

i didn't try for tomee but it shouldn't be so different. It is based on
openejb-daemon module.

- Romain


2011/12/24 Frank Brown <br...@stancounty.com>

> I have an instance of TomEE on which I've deployed an application.  I'd
> like to install TomEE as a Windows Service so it will automatically start
> after reboot.  Since TomEE is in fact (I think?) Tomcat with openejb.war
> installed and configuration changes made, I thought I could install a TomEE
> service as I would a Tomcat service.
>
> The version of TomEE I have installed is apache-tomee-6.0.29.  I copied
> tomcat6.exe and service.exe from apache-tomcat-6.0.32/bin to
> apache-tomee-6.0.29/bin and tried the following:
>
> Opened command prompt to "c:\opt\apache-tomee-6.0.29\bin" and entered this:
>
> c:\> tomcat6 //IS//TomEE --DisplayName="Apache TomEE (openejb 3.1.4)" \
>    --Install="c:\opt\apache-tomee-6.0.29\bin\tomcat6.exe"  \
>    --Jvm=auto --StartMode=jvm --StopMode=jvm \
>    --StartClass=org.appach.catalina.startup.Bootstrap  --StartParams=start
> \
>    --StopClass=org.appach.catalina.startup.Bootstrap  --StopParams=stop
>
> It installed the service, but the service does not start.  Presumably it's
> an issue with certain assumptions made by tomcat6.exe, but I have no clue
> what the issue is.
>
>
> I would guess many people have installed TomEE as a windows service.  Can
> someone share with me how that can be done?
>
>
>
>
>
>