Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Running AMC2 as a Windows Service

18 views
Skip to first unread message

Andrew Findlay

unread,
Aug 26, 2005, 7:09:58 AM8/26/05
to
I am setting up a production ITDI server, and need to provide a way
for the operations group to monitor it. AMC2 is the obvious thing
to use, but I have a problem: it does not start at boot time!
This would be easy to fix on Unix, but I have to make it work on
a Windows server this time. The Admin Guide just refers to the
start_amc.bat script, which starts the webserver from a command line.
Unfortunately, on Windows there is no way to run this script at
boot time.

As the webserver is a Java application it might be possible to
use JavaService from http://javaservice.objectweb.org/
but to do that I would need to know the name of the class to
start, which is not mentioned anywhere as far as I can see.

Has anyone managed to get AMC2 to run as a Windows service?
I cannot see it being much use on a Windows platform unless
this can be done...

Andrew
--
-----------------------------------------------------------------------
| From Andrew Findlay, Skills 1st Ltd |
| Consultant in large-scale systems, networks, and directory services |
| http://www.skills-1st.co.uk/ +44 1628 782565 |
-----------------------------------------------------------------------

Rudy Sutjiato

unread,
Aug 26, 2005, 4:24:55 PM8/26/05
to
There are a few options to do this:
1. Configure automatic login on your Windows Server and add "start_amc.bat"
to your Windows "Startup".
2. As you mentioned, use the JavaService. The class that get called by the
AMC is: com.ibm.di.amc.tomcat.EmbeddedTomcat.class which resides in
webserver.jar. However, I am not sure whether you can run this as service.
3. AMC is a web application. Instead of using the embedded tomcat, you can
use a full version of tomcat. With a few tweaks to the web.xml, you should
be able to run it in tomcat and since you can run tomcat as windows service,
AMC will get started during windows bootup.

Hope this helps.

Regards,
Rudy Sutjiato
Any views or opinions presented in this email are solely those of the author
and do not necessarily represent those of the company.

"Andrew Findlay" <andrew....@skills-1st.co.uk> wrote in message
news:1173342.P...@brick.skills-1st.co.uk...

Andrew Findlay

unread,
Aug 30, 2005, 3:44:09 PM8/30/05
to
I enquired about running AMC2 as a Windows service:

Rudy Sutjiato wrote:

> There are a few options to do this:
> 1. Configure automatic login on your Windows Server and add
> "start_amc.bat" to your Windows "Startup".

That would be easy, but is not acceptable in most service environments.

> 2. As you mentioned, use the JavaService. The class that get called by the
> AMC is: com.ibm.di.amc.tomcat.EmbeddedTomcat.class which resides in
> webserver.jar. However, I am not sure whether you can run this as service.

I tried that one today, but got the same result as when I was using the
install templates that came with JavaService: it created the service OK,
but hung during service startup. I don't know of any way to debug it,
so I am stuck. This is the install script that I used:

------------------------------------------
rem Assumes that JavaService.exe has already been copied to this directory
as AMC2Service.exe

rem This is all one line:
AMC2Service -install AMC2
C:PROGRA~1\IBM\IBMDirectoryIntegrator\_jvm\jre\bin\classic\jvm.dll
-Djava.class.path=C:\PROGRA~1\IBM\IBMDirectoryIntegrator/jars/webserver.jar
-start com.ibm.di.amc.tomcat.EmbeddedTomcat.class -params start amc2
C:PROGRA~1\IBM\IBMDirectoryIntegrator/ibm_help/eclipse/plugins/org.eclipse.tomcat_4.0.6.2/webapps/amc2
9090
-------------------------------------------

The odd mix of forward and backwards slashes comes from the start_amc.bat
script, and the use of 'PROGRA~1' in place of 'Program Files' is because
the JavaService docs say that spaces are not permitted in arguments.

> 3. AMC is a web application. Instead of using the embedded tomcat, you can
> use a full version of tomcat. With a few tweaks to the web.xml, you should
> be able to run it in tomcat and since you can run tomcat as windows
> service, AMC will get started during windows bootup.

Hmm - that has potential, but it needs vastly more knowledge of Java and
Tomcat than I have time to acquire!

Thanks for the suggestions

Peter Hegedüs

unread,
Oct 26, 2005, 1:55:22 AM10/26/05
to
Interesting discussion...
I'm up this creak as well...

I actually tried to fiddle around with the tomcat solution

- Installed tomcat 5.5
- Deployed the amc2.war file from TDI /jars folder.
- In the web.xml there are some references to properties files
which at first where not found when starting. (Could not log on)
(Did finally not change anything, don't really know what I'm doing)
- Managed to get the files found by placing a copy of the TDI /amc
into the tomcat root folder - not in webapps as one would think.
files where found but the certificates where missing.
- Copied the certificatish files from TDI folder to the Tomcat root,
an behold! It is possible to log in!
- At this point it is possible to configure a server - which worked!
Unfortunately large parts of the AMC does not produce any listings!
That is the app is working but fo instance nothing is shown in the
process listing - at this point the server responds with some
more lower level error messages.
- Close but no cigar...
- I thought was i might be using a to modern tomact, as the embeded
seems to be of 4.2.x so i downgraded
first to 5.0 and then to 4.2 with different, but worse results.
In 4.2 I actually could not make the app find the /amc files even
though I moved them around and tried different alterations of the
web.xml (But as stated, this is not my cup of tea, really)

Have you had any success with the other options?

/Peter

Andrew Findlay

unread,
Oct 26, 2005, 6:44:36 AM10/26/05
to
Peter Hegedüs wrote:

> Interesting discussion...
> I'm up this creak as well...
>
> I actually tried to fiddle around with the tomcat solution
>
> - Installed tomcat 5.5

It looks as if you know a lot more about Tomcat than I do...

> Have you had any success with the other options?

No. I tried to get the embedded server running under JavaService but nothing
useful happenned and I don't have the information and tools needed to debug
it. I did not try the automatic login option as that is simply not
acceptable in the environment I was working in.

This really needs some input from the developers: how did they actually
intend this to be used in production?

Karthik

unread,
Oct 26, 2005, 11:48:09 AM10/26/05
to
Pls try to use Tomcat 4.x version if you don't want to use the embedded
tomcat engine. That might work. You can then configure tomcat 4.x to run as
a service.

But I tried this as a workaround even with the embedded tomcat engine (Pls
note that I did this on XP).
(This workaround is based on the assumption that you want amc2 to be started
when the system starts up).

I created a windows schedule task and specified start_amc.bat as the command
to run and made it start in my TDI install directory.
This is how I created the task on XP:
1. Start/All Programs/Accessories/System Tools/Schedule TAsks
2. in the add schedule wizard, browse and select start_amc.bat
3. One of the options for scheduling the task is "when my computer starts".
select this
4. You will need to enter password for startup and click finish

On every system start, start_amc will be executed and amc2 can be accessed.
This is as close as it gets to starting it asa service.
Hope this helps and is acceptable for now.

- Karthik


"Andrew Findlay" <andrew....@skills-1st.co.uk> wrote in message

news:1277319.1...@brick.skills-1st.co.uk...

Jay White

unread,
Oct 28, 2005, 1:56:25 PM10/28/05
to
I use a free Java Service Wrapper from:
http://wrapper.tanukisoftware.org. Below is my wrapper.conf for AMC2 as a
service. It took a few hours to get this working so enjoy it!

I really want to do this for Webshere Express, but that looks complex enough
to take a week.

My wrapper.conf for AMC2 is as follows: (Edit it for your directories.

#********************************************************************
# Wrapper Properties
#********************************************************************
# Java Application
wrapper.java.command=D:\Program Files\IBM\ITDI/_jvm/jre/bin/java

# Java Main class. This class must implement the WrapperListener interface
# or guarantee that the WrapperManager class is initialized. Helper
# classes are provided to do this for you. See the Integration section
# of the documentation for details.
wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp

# Java Classpath (include wrapper.jar) Add class path elements as
# needed starting from 1
wrapper.java.classpath.1=./wrapper.jar
wrapper.java.classpath.2=D:\Progra~1\IBM\ITDI\jars\webserver.jar

# Java Library Path (location of Wrapper.DLL or libwrapper.so)
wrapper.java.library.path.1=D:\Progra~1\IBM\ITDI

# Java Additional Parameters
#wrapper.java.additional.1=

# Initial Java Heap Size (in MB)
#wrapper.java.initmemory=3

# Maximum Java Heap Size (in MB)
#wrapper.java.maxmemory=64

# Application parameters. Add parameters as needed starting from 1
wrapper.app.parameter.1=com.ibm.di.amc.tomcat.EmbeddedTomcat
wrapper.app.parameter.2="D:\Program
Files\IBM\ITDI/ibm_help/eclipse/plugins/org.eclipse.tomcat_4.0.6.2" amc2
wrapper.app.parameter.3="D:\Program
Files\IBM\ITDI/ibm_help/eclipse/plugins/org.eclipse.tomcat_4.0.6.2/webapps/amc2"
"9091"
#********************************************************************
# Wrapper Logging Properties
#********************************************************************
# Format of output for the console. (See docs for formats)
wrapper.console.format=PM

# Log Level for console output. (See docs for log levels)
wrapper.console.loglevel=INFO

# Log file to use for wrapper output logging.
wrapper.logfile=/ITDI Logs/wrapper.log

# Format of output for the log file. (See docs for formats)
wrapper.logfile.format=LPTM

# Log Level for log file output. (See docs for log levels)
wrapper.logfile.loglevel=INFO

# Maximum size that the log file will be allowed to grow to before
# the log is rolled. Size is specified in bytes. The default value
# of 0, disables log rolling. May abbreviate with the 'k' (kb) or
# 'm' (mb) suffix. For example: 10m = 10 megabytes.
wrapper.logfile.maxsize=0

# Maximum number of rolled log files which will be allowed before old
# files are deleted. The default value of 0 implies no limit.
wrapper.logfile.maxfiles=0

# Log Level for sys/event log output. (See docs for log levels)
wrapper.syslog.loglevel=NONE

#********************************************************************
# Wrapper Windows Properties
#********************************************************************
# Title to use when running as a console
wrapper.console.title=AMC2
#********************************************************************
# Wrapper Windows NT/2000/XP Service Properties
#********************************************************************
# WARNING - Do not modify any of these properties when an application
# using this configuration file has been installed as a service.
# Please uninstall the service before modifying this section. The
# service can then be reinstalled.

# Name of the service
wrapper.ntservice.name=AMC2START
# Display name of the service
wrapper.ntservice.displayname=Start AMC2 Service

# Description of the service
wrapper.ntservice.description=Start AMC2 Service

# Service dependencies. Add dependencies as needed starting from 1
wrapper.ntservice.dependency.1=

# Mode in which the service is installed. AUTO_START or DEMAND_START
wrapper.ntservice.starttype=AUTO_START

# Allow the service to interact with the desktop.
wrapper.ntservice.interactive=false

Andrew Findlay

unread,
Nov 11, 2005, 4:45:00 AM11/11/05
to
Karthik wrote:

> But I tried this as a workaround even with the embedded tomcat engine (Pls
> note that I did this on XP).

> I created a windows schedule task and specified start_amc.bat as the


> command to run and made it start in my TDI install directory.
> This is how I created the task on XP:
> 1. Start/All Programs/Accessories/System Tools/Schedule TAsks
> 2. in the add schedule wizard, browse and select start_amc.bat
> 3. One of the options for scheduling the task is "when my computer
> starts". select this
> 4. You will need to enter password for startup and click finish
>
> On every system start, start_amc will be executed and amc2 can be
> accessed. This is as close as it gets to starting it asa service.
> Hope this helps and is acceptable for now.

Thanks for that - it is very much the simplest suggestion I have
seen for doing this. I tested it on Windows 2000 Server, and would add an
extra action:

5. Before clicking Finish, check the 'advanced options' box
6. In the advanced options, select the Config tab and un-check the 'Stop
this task if it runs for' box.

I have added this to the Hints and Tips section of the TDI Users website:

http://www.tdi-users.org/

0 new messages